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 .
Building the Package
The build module prepares the distribution files (.whl and .tar.gz) for PyPI.
python -m build
# Files are created in the dist/ directory.
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file treetops-0.0.1.tar.gz.
File metadata
- Download URL: treetops-0.0.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d0bf0e2d94252a80ec6db2df1b55fddbff5e2a82231b5b5b258d5497771065a
|
|
| MD5 |
2c918232fc901ba1f1f2847c50c60dcd
|
|
| BLAKE2b-256 |
d0e8487dabb9894d798c1f9ab6ad97bd97b42a27b25583445c3f8acde7dbf672
|
File details
Details for the file treetops-0.0.1-py3-none-any.whl.
File metadata
- Download URL: treetops-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70a6299224036cb967b90c6c07fd9cf1c0a64761957bbca55f66c2279e226ab4
|
|
| MD5 |
b622896e799123ebdab9152b006ab849
|
|
| BLAKE2b-256 |
e6fabc5302d36a0bbfccfaa1c48056a312650bf32b46e2c3e60b63bde4e1c43d
|