Skip to main content
Beta
This lesson is in the beta phase, which means that it is ready for teaching by instructors outside of the original author team.
Packaging
Key Points
- Virtual environments isolate software
- Virtual environments solve the update problem
- A task runner makes it easier to contribute to software
- Put your code and tests in a standard package structure
- Use a
pyproject.toml file to describe a Python
package
- Packages should include a README, LICENSE, and CHANGELOG.
- Choose an existing software license
- You can also include
.gitignore to avoid from
committing non-source files.
- Packages should have a version attribute
- Semantic versioning is an abbreviated changelog, not the solution to
all problems
- You can use packaging tools so that the version number needs
updating in one (and only one) place
- CI can publish Python packages
- Tagging and GitHub Releases are used to publish versions
- Zenodo and CITATION.cff are useful for citations
- Sphinx or MkDocs are both good for documentation
- Sphinx is great for documentation
- MkDocs is great for documentation
- Run tests and static checks on your codebase.
- A task runner makes it easier to contribute to software
- Set up GitHub Actions on your project
- Run your tests on multiple platforms and with multiple Python
versions