-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCONTRIBUTING
More file actions
103 lines (75 loc) · 3.05 KB
/
CONTRIBUTING
File metadata and controls
103 lines (75 loc) · 3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Contributing
## Code of Conduct
Please review the [Code of Conduct](https://github.com/Python-Community-News/.github/blob/main/CODE_OF_CONDUCT.md) before contributing to this project.
## Project Structure
```
.
├── src
│ └── gh_issues
│ ├── __init__.py
│ ├── github.py
│ ├── issue_parser.py
│ └── repo.py
├── tests
│ ├── conftest.py
│ ├── test_github.py
│ ├── test_issue.py
│ ├── test_issue_parser.py
│ └── test_repo.py
├── CONTRIBUTING
├── LICENSE
├── pyproject.toml
├── README.md
├── requirements-publish.txt
└── requirements.txt
```
## Getting Started
## Issue > Fork > Pull Request
This is the prferred workflow for contributing to this project.
1. Create an issue describing the feature or bug you want to fix
2. Wait for feedback from the maintainers (don't move onto step 3 until you get a 👍 from the maintainers)
3. Fork the repository
4. Make your changes
5. **TEST YOUR CHANGES** - See [Testing](#testing)
6. Lint your code - See [Linting](#linting)
7. Submit a pull request
# Recommended Development Environment
It's recommended that you use a virtual environment and pip to manage your dependencies.
```bash
python -m venv .venv
. .venv/bin/activate
```
# Which requirements file should I use?
To contribute to the project you will need `requirements.txt`. You **SHOULD NOT** use `requirements-publish.txt` unless you are publishing the project to PyPI.
```bash
`pip install -r requirements.txt`
```
## Testing
This project uses [pytest](https://docs.pytest.org/en/stable/) for testing. To run the tests use the following command:
```bash
python -m pytest
```
There are more settings in the pyproject.toml that configure the testing environment.
### Coverage
This project aims to have 100% (C0) test coverage. This is configured in the `pyproject.toml` file. Don't change the coverage settings unless you've consulted with the maintainers.
## Linting
### Pre-commit
To make it easier to run the linter and formatter we have configured [pre-commit](https://pre-commit.com/). To install pre-commit run the following command:
```bash
# After you've installed dependencies
pre-commit run --all-files
```
The project from then on will lint and format your code before you commit it.
>Tools that run with pre-commit
linters for `md` and `yaml` files
[black](https://github.com/psf/black)
[isort](https://github.com/pyQA/isort)
[pip-tools](https://github.com/jazzband/pip-tools)
## Publishing
> **NOTE:** You should not publish this project unless you are a maintainer. Or you are publishing your own fork of this project. If you are publishing your own fork of this project you should change the name of the project in the `pyproject.toml` file.
Publishing is done using `setuptools` and `twine`. To publish the project you will need to install the `requirements-publish.txt` file. The version should be generated from the current git tag.
```bash
pip install -r requirements-publish.txt
python -m build
python -m twine upload dist/*
```