You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Runtime dependencies should be added to `pyproject.toml` in the `dependencies` list under `[project]`.
- Development dependencies, such as for testing or documentation, should be added to `pyproject.toml` in one of the lists under `[project.optional-dependencies]`.
## Packaging/One command install
You can distribute your code using PyPI.
[The guide](https://guide.esciencecenter.nl/#/language_guides/python?id=building-and-packaging-code) can
help you decide which tool to use for packaging.
{%ifAddLocalTests -%}
## Testing and code coverage
- Tests should be put in the `tests` folder.
- The `tests` folder contains:
- Example tests that you should replace with your own meaningful tests (file: `test_my_module.py`)
- The testing framework used is [PyTest](https://pytest.org)
- The project uses [GitHub action workflows](https://docs.github.com/en/actions) to automatically run tests on GitHub infrastructure against multiple Python versions
- Workflows can be found in [`.github/workflows`](.github/workflows/)
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/language_guides/python?id=testing)
{%- endif%}
{%ifAddLocalDocumentation -%}
## Documentation
- Documentation should be put in the [`docs/`](docs/) directory. The contents have been generated using `sphinx-quickstart` (Sphinx version 1.6.5).
- We recommend writing the documentation using Restructured Text (reST) and Google style docstrings.
- [Restructured Text (reST) and Sphinx CheatSheet](https://thomas-cokelaer.info/tutorials/sphinx/rest_syntax.html)
- The documentation is set up with the ReadTheDocs Sphinx theme.
- Check out its [configuration options](https://sphinx-rtd-theme.readthedocs.io/en/latest/).
- [AutoAPI](https://sphinx-autoapi.readthedocs.io/) is used to generate documentation for the package Python objects.
{%ifAddOnlineDocumentation%}- `.readthedocs.yaml` is the ReadTheDocs configuration file. When ReadTheDocs is building the documentation this package and its development dependencies are installed so the API reference can be rendered.{%endif -%}
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/language_guides/python?id=documentation)
{%- endif%}
## Coding style conventions and code quality
- [Relevant section in the NLeSC guide](https://guide.esciencecenter.nl/#/language_guides/python?id=coding-style-conventions) and [README.dev.md](README.dev.md).
{%ifAddSonarCloud -%}
## Continuous code quality
[Sonarcloud](https://www.sonarsource.com/products/sonarcloud/) is used to perform quality analysis and code coverage report
- `sonar-project.properties` is the SonarCloud [configuration](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/analysis-parameters/) file
- `.github/workflows/sonarcloud.yml` is the GitHub action workflow which performs the SonarCloud analysis
{%- endif%}
## Package version number
- We recommend using [semantic versioning](https://packaging.python.org/en/latest/discussions/versioning/).
- For convenience, the package version is stored in a single place: `pyproject.toml` under the `tool.bumpversion` header.
- Don't forget to update the version number before [making a release](https://guide.esciencecenter.nl/#/best_practices?id=releases)!
## Logging
- We recommend using the logging module for getting useful information from your module (instead of using print).
- The project is set up with a logging example.
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/language_guides/python?id=logging)
{%ifAddChangeLog -%}
## CHANGELOG.md
- Document changes to your software package
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices?id=releases)
{%- endif%}
{%ifAddCitation -%}
## CITATION.cff
- To allow others to cite your software, add a `CITATION.cff` file
- It only makes sense to do this once there is something to cite (e.g., a software release with a DOI).
- Follow the [making software citable](https://book.the-turing-way.org/communication/citable/citable-steps) chapter of the Turing Way.
{%- endif%}
{%ifAddCodeConduct -%}
## CODE_OF_CONDUCT.md
- Information about how to behave professionally
- [Relevant section in the Turing Way](https://book.the-turing-way.org/reproducible-research/code-documentation/code-documentation-project#code-of-conduct)
{%- endif%}
{%ifAddContributing -%}
## CONTRIBUTING.md
- Information about how to contribute to this software package
- [Relevant section in the Turing Way](https://book.the-turing-way.org/reproducible-research/code-documentation/code-documentation-project#contributing-guidelines)
{%- endif%}
## MANIFEST.in
- List non-Python files that should be included in a source distribution
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/language_guides/python?id=building-and-packaging-code)
## NOTICE
- List of attributions of this project and Apache-license dependencies
- [Relevant section on the Apache License documentation](https://infra.apache.org/licensing-howto.html#mod-notice)