Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create CONTRIBUTING.md #128

Closed

Conversation

artiom-matvei
Copy link
Contributor

No description provided.

@artiom-matvei
Copy link
Contributor Author

@vincentarelbundock Please have a look and let me know if you have some additional personal documentation locally on your computer that would be helpful to share in this file.

@vincentarelbundock
Copy link
Owner

Here's a suggestion with more details:

# Contributing to `marginaleffects` for Python

Thank you for your interest in contributing to the `marginaleffects` Python project!

This document outlines guidelines and instructions for setting up the development environment, running tests, and ensuring your code follows the project standards.

## Development Environment

We manage the development environment using [`uv`](https://docs.astral.sh/uv/guides/projects/#creating-a-new-project) for dependency management, task execution, and testing. All necessary information is in the `.toml` and `.lock` files, and `uv` will handle dependency management automatically.

### Setting Up the Environment

Clone the repository

```bash
git clone git@github.com:vincentarelbundock/pymarginaleffects.git
cd pymarginaleffects
```

Create and activate the virtual environment using `uv`:

```bash
uv venv .venv
source .venv/bin/activate.sh
```

Install the project and its dependencies:

```bash
uv pip install .
```

### Running Tests

We use `pytest` for testing. The testing environment is fully managed by `uv`. To run the tests, simply execute:

```bash
uv run --all-extras pytest
```

`uv` will automatically install any missing dependencies before running the tests.

### Code Formatting and Linting

This project follows strict code formatting and linting rules enforced by `ruff`. Before submitting any code, make sure to run `ruff` to format your files and check for linting errors.

You can run `ruff` by executing:

```bash
uv run --all-extras ruff check marginaleffects
uv run --all-extras ruff format marginaleffects
```

Make sure there are no linting errors before submitting your changes.

## Contribution Guidelines

0. Be nice!
1. Fork the repository and create a new branch for your feature or bugfix.
2. Ensure all your changes are well-documented in the code, documentation, and changelog (if necessary).
3. Write tests for any new functionality or changes you make.
4. Run the tests and ensure everything passes before submitting your pull request.
5. Ensure your code is formatted and linted using `ruff`.
6. Push your changes to your forked repository.
7. Create a pull request (PR) on the main repository.
8. Make sure to include a clear description of your changes and reference any related issues (if applicable).

We appreciate your contributions and look forward to reviewing your pull requests!

## Makefile

The `marginaleffects` repository includes a `Makefile` to facilitate some common tasks.

### Windows

1. Install make for Windows https://gnuwin32.sourceforge.net/packages/make.htm.
2. Add it to your path variable.
3. Then you can use scripts specified in the Makefile. e.g. `make test`

@vincentarelbundock
Copy link
Owner

I added this to the main branch. Closing this PR. Thanks for the initiative, and feel free to add other info if you think of something relevant

@artiom-matvei artiom-matvei deleted the contributing branch October 18, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants