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.3.tar.gz (3.9 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.3-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: treetops-0.0.3.tar.gz
  • Upload date:
  • Size: 3.9 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.3.tar.gz
Algorithm Hash digest
SHA256 cde7479896150644f04e5f55644e1c93feb0028d6458c2c2d78da41264501f30
MD5 ee649c0ec7e6272e749af6e54af616cc
BLAKE2b-256 d94eb6f2406399f5a4b286c619f1cd27b4a1a0f56b81578fb8dc0028ac3fe0ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for treetops-0.0.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: treetops-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 24611e80e510c3c10e65273b93d1a1f894b97574c718a7b6d24d65028d7baa02
MD5 414a96698c6bb79e1ab290366576029b
BLAKE2b-256 541688bc79ecc64b4b91cb1351c7fb620e6d4027016052de8b4f1622b6c1fa91

See more details on using hashes here.

Provenance

The following attestation bundles were made for treetops-0.0.3-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