- Testing setup with
pytest
- Github actions for:
- Automatic testing
- Automatic bumping version and publish to PyPi for every push to master
- Bulding Sphinx docs and a manuscript
- Command line interface using Typer (optional)
Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):
pip install -U cookiecutter
Create your project from this template by running the following command and following the steps:
cookiecutter https://github.com/.......
- Remove the .disabled from .github/workflows/bumpversion.yml.disabled
- In your Github repository go to Settings -> Action -> General -> Workflow permissions and change Workflow permissions to read and write permissions.
Now, whenever you push to master, the version will be bumped.
- Make sure you have a user on https://pypi.org/. Create one if you need to.
- Create an API-token for your PyPi-user at https://pypi.org/manage/account/
- In your Github repository, go to Settings -> Secrets -> Actions and create a repository secret. Name it PYPI_API_TOKEN and paste in the API-token you created.
- Try pushing to master. Check that the Github Action for publishing PyPi package ran without errors. If it succeeded, you will now be able to find your package published on PyPi.
Go to Settings on your project on Github. Choose Pages and select Deply from branch under Source.
Select the gh-pages branch and the docs folder and click Save.
Make branch called gh-pages locally and push it. This will be the branch that Github uses to host the page and you will never use it locally:
git branch gh-pages git push origin gh-pages
Make some arbitrary change in a file in the docs_source directory on your master branch and push the changes.
Check that the github action for making documentation ran successfully. If it did, you will be able to find your documentation on https://[organization].github.io/[project-name]
Make a dev-branch. The idea is that all changes are pushed and synced as often as possible to the dev branch and thatt he master branch contains a more stable version of your project. Avoid creating too many other branches.
After making a dev-branch, push it to Github and check that the Github actions are running and not failing. The Github actions are set up so that tests are run when changes are pushed to the dev-branch, and they will publish a package and make documentation when changes are pushed to master.