diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c5cf7c7995cfcf605f85779ca0448d2ce29fad0d..aae54bcd7d2a942e4ff849ed6eb4aee887ff3eff 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,14 @@ # Contribute guide +## Install development environment + +- [Install Poetry](https://python-poetry.org/docs/#installation) +- Install DuniterPy runtime and dev (test) dependencies: + +```bash +poetry install +``` + ## Development workflow Create and push a feature or bugfix release out of the `main` branch. @@ -90,6 +99,38 @@ duniterpy> poetry run pytest tests/helpers/test_ws2p.py::test_generate_ws2p_endp Follow [this documentation](https://github.com/Lucas-C/pre-commit-hooks#removing-old-license-and-replacing-it-with-a-new-one) Only difference is to update the year in `license_header.txt` rather than `LICENSE.txt`. +## Manual packaging and deployment to PyPI test and PyPI repositories + +Change and commit and tag the new version number (semantic version number) + +```bash +./release.sh 1.2.0 +``` + +Build the PyPI package in the `dist` folder + +```bash +make build +``` + +Deploy the package to PyPI test repository: + +```bash +make deploy_test +``` + +Install DuniterPy from PyPI test repository and its dependencies from PyPI: + +```bash +pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.python.org/simple/ duniterpy +``` + +Deploy the package on PyPI repository: + +```bash +make deploy +``` + ## Release workflow To handle a release, you have to follow this workflow: @@ -106,3 +147,21 @@ To handle a release, you have to follow this workflow: - Create a MR containing the changelog and the commit updating the version - Once the MR is merged to `main`, push the tag with `git push --tags` - To release to PyPI, the pipeline based on the tag should be used by triggerring the manual job on the `main` branch + +### How to generate and read locally the autodoc + +- Install Sphinx, included into the `doc` dependencies group: + +```bash +poetry install --with doc +``` + +- Generate HTML documentation in `public` directory: + +```bash +make docs +``` + +## Docstrings + +- When writing docstrings, use the reStructuredText format recommended by https://www.python.org/dev/peps/pep-0287/#docstring-significant-features diff --git a/README.md b/README.md index f816e837e6b7bae6beb3697ef2f5cf82f0bd7712..b9175f8c7c64d6c5ae3749ce20e1be7875892b61 100644 --- a/README.md +++ b/README.md @@ -93,79 +93,9 @@ poetry run python >>> asyncio.get_event_loop().run_until_complete(examples.request_data_async()) ``` -### How to generate and read locally the autodoc +## Contributing -- Install Sphinx, included into the development dependencies: - -```bash -poetry install -``` - -- Generate HTML documentation in `public` directory: - -```bash -make docs -``` - -## Development - -- When writing docstrings, use the reStructuredText format recommended by https://www.python.org/dev/peps/pep-0287/#docstring-significant-features - -- Use `make check` commands to check the code and the format. - -- Install runtime dependencies - -```bash -poetry install --no-dev -``` - -- Before submitting a merge requests, please check the static typing and tests. - -- Install dev dependencies - -```bash -poetry install -``` - -- Check static typing with [mypy](http://mypy-lang.org/) - -```bash -make mypy -``` - -## Packaging and deploy - -### PyPI - -Change and commit and tag the new version number (semantic version number) - -```bash -./release.sh 0.42.3 -``` - -Build the PyPI package in the `dist` folder - -```bash -make build -``` - -Deploy the package to PyPI test repository: - -```bash -make deploy_test -``` - -Install the package from PyPI test repository - -```bash -pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.python.org/simple/ duniterpy -``` - -Deploy the package on the PyPI repository: - -```bash -make deploy -``` +- Checkout the [contributing guide](CONTRIBUTING.md). ## Packaging status