Skip to content

farmsim/farms_foo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

farms-foo

A sample Python package for learning PyPI deployment and testing for FARMS.

Install

pip install farms-foo

Usage

from farms_foo import hello

print(hello("world"))  # "Hello, world!"

Development

# Create a virtual environment and install dev dependencies
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# Run tests
pytest


## Building

### Local build

```bash
python -m build

This compiles Cython extensions and produces a wheel for your current platform + Python version, along with a source distribution.

# Build both (default)
python -m build

# Only sdist
python -m build --sdist

# Only wheel
python -m build --wheel

# Skip the isolated build environment (use your current venv)
python -m build --no-isolation

Cross-platform wheels (CI only)

cibuildwheel runs in GitHub Actions to build wheels across Linux, macOS, and Windows for multiple Python versions. It requires each Python version to be installed, so it's designed for CI — not local use.

To test it locally, you can limit it to your installed Python:

pip install cibuildwheel
CIBW_BUILD="cp312-*" cibuildwheel --output-dir wheelhouse

Replace cp312 with whichever Python version you have installed.

Check before uploading

twine check dist/*

Publishing

TestPyPI (practice)

twine upload --repository testpypi dist/*
pip install --index-url https://test.pypi.org/simple/ farms-foo

PyPI

twine upload dist/*

CI/CD (automated)

The GitHub Actions workflow handles this automatically:

  1. On push/PR to main — builds wheels on Ubuntu, macOS, and Windows across Python 3.9, 3.11, 3.12
  2. On GitHub Release — publishes all wheels + sdist to PyPI via trusted publishing

To trigger a release:

git tag v0.1.0
git push origin v0.1.0

Then create a Release on GitHub from that tag.

About

Dummy project repo for testing deployment

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors