Simple Poetry
A clean, automated setup for publishing simple Python packages to PyPI using Poetry and GitHub Actions.
Setup
-
Prepare GitHub repo
- Create new GitHub repository / fork this repository
- Setup PyPI Credentials in repository secrets
PYPI_TOKEN: PyPI API token
-
Replace text in files
- Rename
simple_poetryfolder to<package_name> - Replace all
simple_poetryinstance in files to<package_name> - Replace all
simple-poetryinstance in files to<package-name> - Replace all
3.8instance in files to<target-python-version> - Replace
ppeetteerrswith<github_user_name>
- Rename
-
Enter Package Information
pyproject.toml: Project description, authors<package_name>/__init__.py: Author and emailREADME.md: Customize it, change the name and description especially
-
Further Customizations
mkdocs.yaml: Edit theme andmkdocstringspreferences (Can also add sub-pages to API Reference etc.).devcontainer.json: Add preferred extensions / build configurations (e.g. use GPUs)Dockerfile: Install necessary formatters / linters / packages for local testingdocs/: Write your documentation.github/workflows/push.yaml: Remove thetests::Run Testsstep if you need to run tests locally (e.g. if your tests require GPU). Keep the rest to upload Codecov..gitignore: Removecoverage.xmlif you need to run tests locally.
-
Publish and Setup GitHub Pages
commitandpushyour changes- Create first release
- Go to
Settingsand activate your GitHub Pages using thegh-pagesbranch