Skip to content

Commit 2ff3b12

Browse files
committed
chore: update contribution guidelines
- removes unused `.pre-commit-config.yaml` - removes unused `compose.yaml`
1 parent ede7c67 commit 2ff3b12

File tree

3 files changed

+79
-48
lines changed

3 files changed

+79
-48
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 79 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22

33
Hi, to start, you need the following installed on your system.
44

5-
1. [Git](https://git-scm.com/)
6-
2. [Python](https://www.python.org/) v3.8 or later and
7-
3. [PDM](https://pdm-project.org/en/stable/) 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 etc.
10-
11-
12-
First [fork](https://github.com/python-validators/validators/fork) this repository. Then clone it to your system. Then install development dependencies.
5+
1. [Git](https://git-scm.com)
6+
2. [Python](https://www.python.org) v3.8 or later
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.
1310

11+
First [fork this repository](https://github.com/python-validators/validators/fork). Clone it to your system. Install development dependencies.
1412

1513
```sh
16-
# cloning repository
17-
$ git clone "https://github.com/YOUR_USERNAME/validators.git"
18-
# changing directory
14+
# clone repository
15+
$ git clone "https://github.com/YOUR-USERNAME/validators.git"
16+
# change directory
1917
$ cd validators
20-
# installing development dependencies
18+
# install development dependencies
2119
$ pdm install
2220
```
2321

@@ -30,6 +28,74 @@ $ . ./.venv/bin/activate # replace `/bin/` with `/Scripts/` if you're on Windows
3028
$ tox
3129
```
3230

33-
Create a git branch. You can now make changes to the source code. If needed, test your change by running `pytest`. Commit, push and create a pull request.
31+
Create a git branch. You can now make changes to the source code. If needed, test your change by running `tox`. Commit, push and create a pull request.
3432

3533
If you're in doubt feel free to start a discussion [here](https://github.com/python-validators/validators/discussions). Thanks for taking interest in this library.
34+
35+
## Documentation
36+
37+
> Documentation is extracted from the source code. Please follow [Google's Python Doc Style](https://google.github.io/styleguide/pyguide.html).
38+
39+
If you're adding/removing a module, you must update the `nav` key in `mkdocs.yml`.
40+
Then export documentation as follows:
41+
42+
```sh
43+
$ . ./.venv/bin/activate
44+
# generate documentation
45+
$ python package/export TYPE # where TYPE is any of `doc`, `man` or `web`.
46+
47+
# doc - generates docs found here: https://yozachar.github.io/pyvalidators
48+
# man - generates sphinx based manpages
49+
# web - generates sphinx based web docs
50+
```
51+
52+
You can preview the generated documentation:
53+
54+
```sh
55+
$ . ./.venv/bin/activate
56+
# To preview mkdocs
57+
$ mkdocs serve
58+
# To preview man pages
59+
$ man docs/_build/man/validators.1
60+
# To preview sphinx webpages
61+
$ python -m http.server -d docs/_build/web
62+
```
63+
64+
## Versioning, Packaging & Releasing (for collaborators)
65+
66+
> You must be familiar with [semantic versioning](https://semver.org) and [Python packaging](https://packaging.python.org).
67+
68+
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.
69+
2. Update the changelog. Version number must be updated in both [`SECURITY.md`](SECURITY.md) and [`src/validators/__init__.py`](src/validators/__init__.py).
70+
3. The final merge commit on the upstream (ie. this repo) is tagged.
71+
72+
```sh
73+
# syncing with upstream
74+
$ git pull upstream master
75+
$ git push
76+
# tagging that final merge commit before release
77+
$ GIT_COMMITTER_DATE=$(git log -n1 --pretty=%aD) git tag -a -m "vMAJOR.MINOR.PATCH" vMAJOR.MINOR.PATCH
78+
# pushing tag to remote
79+
$ git push --tag
80+
$ git push upstream --tag
81+
```
82+
83+
4. To update versioned docs, you must track the `gh-pages` onto a local branch. `git checkout --track upstream/gh-pages`, once.
84+
5. Checkout to the tag you want to include in the versioned documentation `git checkout TAG_NAME`.
85+
6. Then using [`mike`](https://github.com/jimporter/mike) (which is already a dev dependency) run `mike deploy -p -u VERSION stable`.
86+
7. Or use `mike deploy -p -u dev master`, which will deploy docs in the CURRENT commit as the `latest` documentation.
87+
8. Run `./package/roll.sh` (or `./package/roll.ps1`) to generate both sdist and bdist.
88+
9. Install [`twine`](https://pypi.org/project/twine) using [`pipx`](https://pipx.pypa.io) to upload package to PyPI.
89+
90+
```sh
91+
# publishing
92+
$ twine check dist/*
93+
$ twine upload dist/*
94+
```
95+
96+
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:
97+
98+
```sh
99+
# generate sha256sum
100+
$ sha256sum dist/validators-VERSION-py3-none-any.whl > dist/validators-VERSION-py3-none-any.whl.sha256
101+
```

compose.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)