| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A template to quickly get you creating an open-source python library or project with linting, static analysis, CI, and CD to PyPI.
To use this template, click the green "Use this template" button in the github web interface. Then run:
git clone YOUR_REPO
# then cd into your local repo, and run:
./bootstrapAnd follow the on-screen prompts. bootstrap uses some git data (like detecting your username and repository name), so cloning the repo generated from the template is necessary.
General sanity checks and best practices are performed on provided responses. To disable these, run with the --no-verify flag:
./bootstrap --no-verifyThis template's bootstrap functionality only works on MacOS/Linux/WSL, it will not work natively on windows. The resulting project, however, may be windows-compatible.
Features dependent if project is a library or a standalone project.
uv support.
Optional command line interface boilerplate using Cyclopts.
Optional C binding support via Cython.
To setup, goto ReadTheDocs Dashboard and click on "Import a Project".
To locally build the docs:
cd docs/
make htmlThis results in html files in docs/build/html/. Double click docs/build/html/index.html to view the docs in your web browser.
Pre-commit linting and static analysis. The following hooks are pre-configured and will automatically run on git commit:
Docker support for standalone projects.
GitHub Actions for:
Running pre-commit on pull requests and commits to main.
Running unit tests, coverage, and verify docs build on pull requests and commits to main.
Build and upload wheels to PyPI on semver tags vX.Y.Z.
Publishing uses a PyPI Trusted Publisher (OIDC); no API token or GitHub secret is required. To set it up, go to PyPI -> Your account -> Publishing -> "Add a new pending publisher" and enter:
The first tagged release will then create the PyPI project automatically.
If using Cython, pre-built binary packages will be created for all major operating systems, python versions, and computer architectures.
Build and upload docker images to Dockerhub.
This template has an option to add boilerplate for Cython. Cython is a programming language that simplifies the creation of C extensions for Python. The Cython documentation is quite good; the aim of this section is to explain what this template sets up, and what actions will still need to be performed by you. This explanation assumes you are familiar with C. Replace any reference here to pythontemplate with your project name.
When developing, you must re-run uv sync to re-compile changes made in C/Cython code. The resulting, built Cython code will be importable from pythontemplate._c_extension, so it may be good to add something like the following to your pythontemplate/__init__.py:
__all__ = [
"Foo",
]
from pythontemplate._c_extension import FooIf you find this in the git history of a project and you like the structure, visit this template at https://github.com/BrianPugh/python-template .
| Back | FazBrowse Home | New Git URL |