|
1 |
| -# How to contribute to `validators` |
| 1 | +# Contributing to `validators` |
2 | 2 |
|
3 | 3 | Hi, to start, you need the following installed on your system.
|
4 | 4 |
|
5 | 5 | 1. [Git](https://git-scm.com)
|
6 | 6 | 2. [Python](https://www.python.org) v3.8 or later
|
7 | 7 | 3. [PDM](https://pdm-project.org) for easy dependency management
|
8 |
| -4. (Optional/Recommended) NodeJS for type checking |
9 |
| -5. (Optional/Recommended) [mise](https://github.com/jdx/mise) to manage multiple versions of Python & NodeJS. |
| 8 | +4. (Optional/Recommended) [`NodeJS`](https://nodejs.org/en) for type checking |
| 9 | +5. (Optional/Recommended) [`mise`](https://github.com/jdx/mise) to manage multiple versions of Python, NodeJS and other such tools. |
10 | 10 |
|
11 |
| -First [fork this repository](https://github.com/python-validators/validators/fork). Uncheck "fork only `master`", because for versioned docs you'll need `gh-pages` too. Clone it to your system. Install development dependencies. |
| 11 | +First [fork this repository](https://github.com/python-validators/validators/fork). (If you are or intend to be a collaborator, uncheck "fork only `master`", because for versioned docs you'll need `gh-pages` branch too.) Clone it to your system and install the development dependencies. |
12 | 12 |
|
13 | 13 | ```sh
|
14 | 14 | # clone repository
|
@@ -63,39 +63,49 @@ $ python -m http.server -d docs/_build/web
|
63 | 63 |
|
64 | 64 | > You must be familiar with [semantic versioning](https://semver.org) and [Python packaging](https://packaging.python.org).
|
65 | 65 |
|
66 |
| -1. Take a look at the [`CHANGES.md`](CHANGES.md). They are generated with [GitHub's releaser](https://github.com/python-validators/validators/releases/new), and then modified. |
67 |
| -2. Update the changelog. Version number must be updated in both [`SECURITY.md`](SECURITY.md) and [`src/validators/__init__.py`](src/validators/__init__.py). |
| 66 | +### Tagging |
| 67 | + |
| 68 | +1. Take a look at [`CHANGES.md`](CHANGES.md). They are generated with [GitHub's releaser](https://github.com/python-validators/validators/releases/new), and then modified to fit the shown style. |
| 69 | +2. Update the [changelog](CHANGES.md). Version number must be updated in both [`SECURITY.md`](SECURITY.md) and [`src/validators/__init__.py`](src/validators/__init__.py). |
68 | 70 | 3. The final merge commit on the upstream (i.e. this repo) is tagged.
|
69 | 71 |
|
70 | 72 | ```sh
|
71 | 73 | # syncing with upstream
|
72 | 74 | $ git pull upstream master
|
73 | 75 | $ git push
|
74 | 76 | # tagging that final merge commit before release
|
75 |
| - $ GIT_COMMITTER_DATE=$(git log -n1 --pretty=%aD) git tag -a -m "vMAJOR.MINOR.PATCH" vMAJOR.MINOR.PATCH |
| 77 | + $ GIT_COMMITTER_DATE=$(git log -n1 --pretty=%aD) git tag -a -m "vMAJOR.MINOR.PATCH" MAJOR.MINOR.PATCH |
76 | 78 | # pushing tag to remote
|
77 | 79 | $ git push --tag
|
78 | 80 | $ git push upstream --tag
|
79 | 81 | ```
|
80 | 82 |
|
81 |
| -4. To preview versioned docs, run `mike serve` (`mike` is already a dev dependency). |
82 |
| -5. To update it, checkout to the tag you want to include in the versioned documentation `git checkout TAG_NAME`. |
83 |
| -6. Then run `mike deploy -p -u VERSION stable` OR run `mike deploy -p -u dev master`, |
84 |
| -7. Which will deploy docs in the CURRENT commit as the `latest` documentation, onto `gh-pages` branch. |
85 |
| -8. Run `./package/roll.sh` (or `./package/roll.ps1`) to generate both `sdist` and `bdist`. |
86 |
| -9. Install [`twine`](https://pypi.org/project/twine) using [`pipx`](https://pipx.pypa.io) to upload package to PyPI. |
| 83 | +### Versioned documentation |
| 84 | + |
| 85 | +1. To preview versioned docs, run `mike serve` (`mike` is a dev dependency). |
| 86 | +2. Then (look at <https://yozachar.github.io/pyvalidators/stable/>) |
| 87 | + - to publish stable docs run `mike deploy -p -u VERSION stable` after checking out to a stable tag name like `0.28.3` (note: document `VERSION = 0.29 if tag_name == 0.29.1`). |
| 88 | + - to publish bleeding-edge docs run `mike deploy -p -u dev master` after checking out to the `master` branch. |
| 89 | +3. This will deploy docs to the `gh-pages` branch (see: <https://github.com/python-validators/validators/tree/gh-pages/>) |
| 90 | +
|
| 91 | +### Packaging and releasing |
| 92 | +
|
| 93 | +1. Run `./package/roll.sh` (or `./package/roll.ps1`) to generate both `sdist` and `bdist`. |
| 94 | +2. Install [`twine`](https://pypi.org/project/twine) using [`pipx`](https://pipx.pypa.io) to upload package to PyPI. |
87 | 95 |
|
88 | 96 | ```sh
|
89 | 97 | # publishing
|
90 | 98 | $ twine check dist/*
|
91 | 99 | $ twine upload dist/*
|
92 | 100 | ```
|
93 | 101 |
|
94 |
| -10. Create a GitHub release with the contents from the [changelog](CHANGES.md). Upload the wheel from `dist/` along with the shasum file generated with: |
| 102 | +3. Create a GitHub release with the contents from the [changelog](CHANGES.md). Upload the wheel from `dist/` along with the shasum file generated with: |
95 | 103 |
|
96 | 104 | ```sh
|
97 | 105 | # generate sha256sum
|
98 | 106 | $ sha256sum dist/validators-VERSION-py3-none-any.whl > dist/validators-VERSION-py3-none-any.whl.sha256
|
99 | 107 | ```
|
100 | 108 |
|
101 |
| -Thanks for taking interest in this library! |
| 109 | +--- |
| 110 | +
|
| 111 | +Thank your for taking interest in this library! |
0 commit comments