Skip to main content

Python Project Template

After creating a new git repository copy over:
* docs
* poetry_template
* tests
* pyproject.toml
* README.md

Go through the project and change the placeholder values. pyproject.toml contains the list of the most important values present throughout the project.

Finally, delete this note.
# Note: Install Python 3
# Update pip and install virtualenv (dependency encapsulator) and black (linter; IDE needs to be restarted)

# Note: install Poetry for Linux
$: curl -sSL https://install.python-poetry.org | python3 -

# Note: install Poetry for Windows
$: (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -

$: curl -sSL https://install.python-poetry.org | python3 - --uninstall
# Note: `.toml` project name and package have to match (poetry-template; poetry_template)
$: poetry install  # install all dependencies

dist

$: pip install dist/poetry_template-0.1.4-py3-none.any.whl

$: poetry-template

docs

$: poetry shell
$: cd docs
# Note: review source/conf.py and source/index.rst
$: make html
# Note: see docs in docs/build/apidocs/index.html

poetry_template

$: poetry run poetry-template --help
$: poetry run python ./poetry_template/runner.py --help

$: poetry run python ./poetry_template/runner.py -x 2 -y -1 -tuple A B C -list D -list E -list F -move rock

tests

$: poetry run pytest --durations=0
$: poetry run pytest --cov=poetry_template --cov-report=html tests
# Note: see coverage report in htmlcov/index.html
# Note: exclude directories from coverage report through .coveragerc

poetry.lock

Dependencies, Python version and the virtual environment are managed by Poetry.

$: poetry search Package-Name
$: poetry add [-D] Package-Name[==Package-Version]

pyproject.toml

Define project entry point and metadata.

Linters

$: poetry run black .

MyPy

$: poetry run mypy ./poetry_template ./tests

cProfile

$: poetry run python ./poetry_template/profiler.py

Build and publish

$: poetry build

# Note: get the token from your PiPy account
$: poetry config pypi-token.pypi PyPI-Api-Access-Token
$: poetry publish --build
https://pypi.org/project/poetry-template/

Metadata

Release files for poetry-template 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poetry-template 0.1.4
File Size Uploaded Provenance
poetry-template-0.1.4.tar.gz 5.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for poetry-template 0.1.4
File Interpreter ABI Platform
poetry_template-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 11.5 kB

Release files / poetry-template-0.1.4.tar.gz

Download URL poetry-template-0.1.4.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a43d61bd13fe85a7d190b42852985a48eae94e5ffb7dfd54f241ba3526f9b23d
BLAKE2b-256 checksum
How to use checksums
117e0ed69d34e1f8d84ae3ea948aa868d294f0d92ca928ad5e9d3dcda07f5a0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.8 Windows/10

Release files / poetry_template-0.1.4-py3-none-any.whl

Download URL poetry_template-0.1.4-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
130a718efe8cc02d421086d4c18df45f241625ae4bb733f68aa378548f904a4a
BLAKE2b-256 checksum
How to use checksums
5170c284e6ca95006eedd11bcf92638d716f2d3c8219c719ab114d296f681f53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.8.8 Windows/10

Security for poetry-template 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page