Contributing#
Contributions to networkx-backbone are welcome.
Development setup#
Clone the repository and install in editable mode with all development dependencies:
git clone https://github.com/brianckeegan/networkx_backbone.git
cd networkx_backbone
pip install -e ".[full,test,docs]"
Running tests#
Run the test suite with pytest:
pytest
Run with verbose output:
pytest tests/ -v
Building documentation#
Build the documentation locally:
cd docs
make html
The built documentation will be in docs/_build/html/.
Code style#
Follow PEP 8 for Python code
Use NumPy-style docstrings for all public functions
Include
Parameters,Returns,Raises(if applicable),References, andExamplessections in docstringsUse RST
.. math::directives for mathematical formulasUse
:func:and:mod:roles for cross-references within docstrings
Publishing to PyPI#
PyPI releases are published automatically from the
.github/workflows/publish-to-PyPI.yml workflow when a GitHub Release is
published. The workflow follows the PyPA trusted publishing guide:
https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
Package versions are derived automatically from Git tags using
setuptools-scm. Do not edit a version string in pyproject.toml.
Maintainers should configure PyPI trusted publishing once in the PyPI project settings:
Open the
networkx-backboneproject on PyPI and add a trusted publisher for this GitHub repository.Use the workflow filename
publish-to-PyPI.ymland environment namepypi.Create and push a version tag (for example
v0.2.0) and then publish a GitHub Release from that tag; the workflow will run tests, build distributions, verify them withtwine check, and publish to PyPI using that tag as the package version.
Submitting changes#
Fork the repository
Create a feature branch
Make your changes with tests
Run the test suite to verify
Submit a pull request