Skip to content
Snippets Groups Projects
Commit 90b9f1d8 authored by Moul's avatar Moul
Browse files

doc: Merge contributing from readme into contributing.md (#105)

Adapt contributing documentation from readme
moved non-covered doc to contributing

Readme: add link to contributing
Add initial "Install development environment" §
parent 03d17159
No related branches found
No related tags found
1 merge request!188Clarify readme and contributing documentation (#105, #155)
# 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
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment