Skip to main content

A simple Python package template

Project description

Treetops

A simple Python package template for MLOps abstraction.

Installation

Install the latest stable version from PyPI:

pip install treetops

Or install the development version from source:

git clone https://github.com/tylerlanigan/treetops.git
cd treetops
# Installs package dependencies, but not dev tools
pip install .

Usage

from treetops.example import hello

# Greet the world
print(hello())
# Output: Hello, World!

Development

Setup Development Environment

The best practice is to use pyenv to manage your Python versions and venv to isolate your project dependencies.

Prerequisites

  • pyenv installed (for managing Python versions)
  • Git installed

Step-by-Step Setup

Clone the repository:

git clone https://github.com/tylerlanigan/treetops.git
cd treetops

Install and activate the required Python version:

# Install the Python version specified in .python-version (e.g., 3.11.9)
# This step requires pyenv
pyenv install 

# Set the local Python version for this project's directory
pyenv local 

Create and activate the standardized virtual environment:

# Create the virtual environment folder named .venv
python -m venv .venv

# Activate the virtual environment
source .venv/bin/activate 

Install the package in editable mode with development dependencies:

# Ensure pip is up-to-date
python -m pip install --upgrade pip

# Install the package in editable mode (-e) along with all [dev] dependencies (pytest, ruff, etc.)
pip install -e ".[dev]"

Working with the Editable Install

Once installed with pip install -e .[dev], any changes you make to the source code will be immediately available without needing to reinstall.

Run Tests: Execute the test suite using the development dependency pytest.

pytest tests/

Run Linter/Formatter: Use the ruff tool for fast code quality checks and automatic formatting.

# Check and apply automatic fixes (linting, import sorting)
ruff check --fix . 

# Apply standard formatting (like Black)
ruff format .

🚀 Publishing a New Release

The Treetops package uses secure, token-less GitHub Actions Trusted Publishing (OIDC) for deployment. Releases are only published to PyPI when a version tag (v*) is pushed.

Follow this workflow to release a new version:

First tag the version (using 0.0.3 as an example)

git tag v0.0.3

Push the tag to GitHub. This triggers the automated CI/CD workflow, which builds and publishes the package to PyPI.

git push origin v0.0.3 

License

MIT License - see LICENSE file for details.

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

treetops-0.0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

treetops-0.0.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file treetops-0.0.2.tar.gz.

File metadata

  • Download URL: treetops-0.0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for treetops-0.0.2.tar.gz
Algorithm Hash digest
SHA256 96af5e17f5e8e1c3fa5f7d91b11bc5008183a44b05742b296afd82a992ecb9ab
MD5 e9f6526c75eb1780217ad37a93fdf688
BLAKE2b-256 441b9721166ce57cb0fc5082a1027c30591aabeca3d72acc12e112d985ff7e30

See more details on using hashes here.

Provenance

The following attestation bundles were made for treetops-0.0.2.tar.gz:

Publisher: publish.yml on tylerlanigan/treetops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file treetops-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: treetops-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for treetops-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a1d184986a9b60613ed24459d0825ade5474396145d77129b1d43825c2d9e4b9
MD5 0c93bfb55e3d326cad3c94b1943e9b83
BLAKE2b-256 1eebd2af06def437df62cf904c994fb3f8c8f92c6592638af0875ce69c8092d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for treetops-0.0.2-py3-none-any.whl:

Publisher: publish.yml on tylerlanigan/treetops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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