Skip to content

Commit 554221d

Browse files
docs: modularize CONTRIBUTING.md from README.md
1 parent 2e573f8 commit 554221d

File tree

2 files changed

+123
-45
lines changed

2 files changed

+123
-45
lines changed

.github/CONTRIBUTING.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Contributing
2+
3+
<details>
4+
<summary>Table of Contents</summary>
5+
6+
- [Fork](#fork)
7+
- [Install](#install)
8+
- [Develop](#develop)
9+
- [Test](#test)
10+
- [Lint](#lint)
11+
- [Release](#release)
12+
13+
</details>
14+
15+
Pull requests are welcome! By participating in this project, you agree to abide by our [code of conduct](https://github.com/remarkablemark/.github/blob/master/CODE_OF_CONDUCT.md).
16+
17+
## Fork
18+
19+
[Fork](https://github.com/remarkablemark/python_package_template/fork) and then clone the repository:
20+
21+
```sh
22+
# replace <USER> with your username
23+
git clone git@github.com:<USER>/python_package_template.git
24+
```
25+
26+
```sh
27+
cd python_package_template
28+
```
29+
30+
## Install
31+
32+
Install [Python](https://www.python.org/):
33+
34+
```sh
35+
brew install python
36+
```
37+
38+
Create the virtual environment:
39+
40+
```sh
41+
python3 -m venv .venv
42+
```
43+
44+
Activate the virtual environment:
45+
46+
```sh
47+
source .venv/bin/activate
48+
```
49+
50+
Install the dependencies:
51+
52+
```sh
53+
pip install -e '.[test]'
54+
```
55+
56+
Install pre-commit into your git hooks:
57+
58+
```sh
59+
pre-commit install
60+
```
61+
62+
## Develop
63+
64+
Make your changes, add tests/documentation, and ensure tests pass:
65+
66+
```sh
67+
pytest
68+
```
69+
70+
Write a commit message that follows the [Conventional Commits](https://www.conventionalcommits.org/) specification:
71+
72+
- **feat**: A new feature
73+
- **fix**: A bug fix
74+
- **perf**: A code change that improves performance
75+
- **refactor**: A code change that neither fixes a bug nor adds a feature
76+
- **test**: Add missing tests or correct existing tests
77+
- **build**: Changes that affect the build system or external dependencies
78+
- **ci**: Updates configuration files and scripts for continuous integration
79+
- **docs**: Documentation only changes
80+
81+
Push to your fork and create a [pull request](https://github.com/remarkablemark/python_package_template/compare/).
82+
83+
At this point, wait for us to review your pull request. We'll try to review pull requests within 1-3 business days. We may suggest changes, improvements, and/or alternatives.
84+
85+
Things that will improve the chance that your pull request will be accepted:
86+
87+
- [ ] Write tests that pass [CI](https://github.com/remarkablemark/python_package_template/actions/workflows/test.yml).
88+
- [ ] Write solid documentation.
89+
- [ ] Write a good [commit message](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#commit).
90+
91+
## Test
92+
93+
Run tests:
94+
95+
```sh
96+
pytest
97+
```
98+
99+
## Build
100+
101+
Generate distribution packages:
102+
103+
```sh
104+
python3 -m build
105+
```
106+
107+
Upload all of the archives under `dist`:
108+
109+
```sh
110+
twine upload --repository testpypi dist/*
111+
```
112+
113+
Install the package:
114+
115+
```sh
116+
pip install --index-url https://test.pypi.org/simple/ --no-deps python_package_template
117+
```
118+
119+
## Release
120+
121+
Release and publish are automated with [Release Please](https://github.com/googleapis/release-please).

README.md

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,53 +16,10 @@ Print greeting:
1616

1717
```py
1818
from python_package_template import template
19-
print(template.hello())
20-
```
21-
22-
## Development
23-
24-
Create the virtual environment:
25-
26-
```sh
27-
python3 -m venv .venv
28-
```
29-
30-
Activate the virtual environment:
31-
32-
```sh
33-
source .venv/bin/activate
34-
```
35-
36-
Install the dependencies:
37-
38-
```sh
39-
pip install -e '.[test]'
40-
```
4119

42-
Install pre-commit into your git hooks:
43-
44-
```sh
45-
pre-commit install
46-
```
47-
48-
Generate distribution packages:
49-
50-
```sh
51-
python3 -m build
52-
```
53-
54-
Upload all of the archives under `dist`:
55-
56-
```sh
57-
twine upload --repository testpypi dist/*
58-
```
59-
60-
Install the package:
61-
62-
```sh
63-
pip install --index-url https://test.pypi.org/simple/ --no-deps python_package_template
20+
print(template.hello())
6421
```
6522

6623
## License
6724

68-
[MIT](LICENSE)
25+
[MIT](https://github.com/remarkablemark/python_package_template/blob/master/LICENSE)

0 commit comments

Comments
 (0)