Skip to main content

A sample package

Project description

Say Hello!

Say Hello! Logo

Python Package Template using UV

Python PyPi UV PyTest

Getting Started

  1. You need to have UV installed. You can find instructions here.

  2. Create the virtual environment

uv venv # create env .venv
uv sync # install dependencies
  1. Start developping :
  • Add your library code in the src/ directory
  • Write tests in the tests/ directory
  • Add your license
  • Update pyproject.toml with your package information
  1. In order to commit you need to :
    • Have no error from linter (ruff)
    • Pass all tests (pytest)

Development Workflows

Code Quality

To ensure a certain level of code quality, Ruff is used.

Configuration can be found in pyproject.toml.

Test

Tests must be write in tests and follow the convention of pytest

Scripts

All automation scripts are defined in noxfile.py file.

To run them use the following commands :

nox                   # Run all scripts
nox -s <script_name>  # Run a scpecific script

Available scripts :

  • lint : Check the codebase respect all linting and format rules
  • clean : Delete build directory dist
  • tests : Run tests from tests folder with python version from 3.9 to 3.13

You can list them with nox --list.

See Nox documentation if you want to know more.

Publishing your package

Automatic Publishing

Your package is automatically published when you push to:

  • main branch → Published to PyPI
  • dev branch → Published to TestPyPI

Manual Publishing

You can also publish it manually with the following commands :

uv publish --token YOUR_PYPI_TOKEN
# OR
uv publish --index testpypi --token YOUR_TEST_PYPI_TOKEN

Installing your package

Once published, your package can be installed with:

uv add your-package-name
uv add --default-index https://test.pypi.org/simple/ your-package-name # For testing

Or use pip :

pip install your-package-name
pip install --index-url https://test.pypi.org/simple/ your-package-name # For testing

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

say_hello_sample_library-0.1.2.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

say_hello_sample_library-0.1.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file say_hello_sample_library-0.1.2.tar.gz.

File metadata

File hashes

Hashes for say_hello_sample_library-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a365afd3f679560e2e0173c3368494c2e9605311c21a54c58ac3e2e68b40a11c
MD5 068ffcac38f31a52630b54dfcf623da1
BLAKE2b-256 dc33c54600c6d5cf314ab4f53fd621cd2ce8f971a53706d94cabff5106da5b85

See more details on using hashes here.

File details

Details for the file say_hello_sample_library-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for say_hello_sample_library-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ee699d786f8ea950e714a4a02c8f05f42858baa03baa9b6798a6fbb465b0e385
MD5 93ddc875ed6bc9d9b76a8cd8ecbd13c0
BLAKE2b-256 fc7715f1177414f260ae50940be45d531e595422a7b051077cd099321bab1441

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page