Skip to content

About

A sampel python package distributed to PyPI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

mathkit-helpers

A small collection of dependency-free math helper functions for Python, managed with uv.

Installation

pip install mathkit-helpers

Usage

from mathkit_helpers import add, is_prime, mean

add(2, 3)          # 5
is_prime(17)        # True
mean([1, 2, 3, 4])  # 2.5

Available functions: add, subtract, multiply, divide, factorial, is_prime, gcd, lcm, mean, median.

Development

This project uses uv for dependency management and packaging.

# Install dependencies (including dev dependencies)
uv sync

# Run tests
uv run pytest

Building and publishing to PyPI

Build

uv build

This produces a wheel and sdist in dist/.

Publish manually

# Test PyPI first (recommended)
uv publish --index testpypi --token <your-testpypi-token>

# Real PyPI
uv publish --token <your-pypi-token>

You can also configure credentials via the UV_PUBLISH_TOKEN environment variable instead of passing --token.

Publish via GitHub Actions (recommended)

This repo includes .github/workflows/publish.yml, which builds and publishes to PyPI automatically whenever a GitHub Release is published, using PyPI Trusted Publishing (no API tokens stored in the repo).

To set it up:

  1. On PyPI, go to your project's Settings → Publishing and add a new trusted publisher:
    • Owner: your GitHub username/org
    • Repository name: this repo's name
    • Workflow name: publish.yml
    • Environment name: pypi
  2. In your GitHub repo, go to Settings → Environments and create an environment named pypi (optionally with required reviewers for extra safety).
  3. Bump the version in pyproject.toml and push.
  4. Create a GitHub Release (tag e.g. v0.1.0) — the workflow will build and publish automatically.

License

MIT — see LICENSE.

About

A sampel python package distributed to PyPI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages