From 0480de7a41a1d466cd42e29a7365745d4f488903 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 26 May 2026 03:37:41 +0000 Subject: [PATCH] Add Python package skeleton with CI, tests, and tooling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - src/pyweather layout with version, __init__.py - pyproject.toml (hatchling build, ruff, mypy, pytest+cov config) - pytest smoke test with 100% coverage - GitHub Actions CI: lint, test matrix (3.10–3.12), typecheck - CHANGELOG.md (Keep a Changelog format) - README with install/dev instructions https://claude.ai/code/session_01E67vXnnhvttsvkdoeUegDa --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++ CHANGELOG.md | 14 +++++++++++ README.md | 41 +++++++++++++++++++++++++++++- pyproject.toml | 52 +++++++++++++++++++++++++++++++++++++++ src/pyweather/__init__.py | 4 +++ tests/__init__.py | 0 tests/test_pyweather.py | 6 +++++ 7 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml create mode 100644 CHANGELOG.md create mode 100644 pyproject.toml create mode 100644 src/pyweather/__init__.py create mode 100644 tests/__init__.py create mode 100644 tests/test_pyweather.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6d587b4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,41 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - run: pip install ruff + - run: ruff check . + - run: ruff format --check . + + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - run: pip install -e ".[dev]" + - run: pytest + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - run: pip install -e ".[dev]" + - run: mypy src/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..227881b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.1.0] - 2026-05-26 + +### Added + +- Initial project skeleton. diff --git a/README.md b/README.md index 1cf1d7d..5657980 100644 --- a/README.md +++ b/README.md @@ -1 +1,40 @@ -# PyWeather \ No newline at end of file +# PyWeather + +A Python weather library. + +## Installation + +```bash +pip install pyweather +``` + +## Development + +```bash +git clone https://github.com/citizenweather/pyweather +cd pyweather +pip install -e ".[dev]" +``` + +Run the test suite: + +```bash +pytest +``` + +Lint and format: + +```bash +ruff check . +ruff format . +``` + +Type-check: + +```bash +mypy src/ +``` + +## License + +GPL-3.0 — see [LICENSE](LICENSE). diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..25ca285 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,52 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "pyweather" +version = "0.1.0" +description = "A Python weather library" +readme = "README.md" +license = { file = "LICENSE" } +requires-python = ">=3.10" +authors = [{ name = "Aidan Hogg", email = "aidankhogg@gmail.com" }] +keywords = ["weather"] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] +dependencies = [] + +[project.optional-dependencies] +dev = ["pytest", "pytest-cov", "ruff", "mypy"] + +[project.urls] +Homepage = "https://github.com/citizenweather/pyweather" +Repository = "https://github.com/citizenweather/pyweather" +Issues = "https://github.com/citizenweather/pyweather/issues" + +[tool.hatch.build.targets.wheel] +packages = ["src/pyweather"] + +[tool.ruff] +line-length = 88 +target-version = "py310" + +[tool.ruff.lint] +select = ["E", "F", "I", "UP"] + +[tool.mypy] +python_version = "3.10" +strict = true + +[tool.pytest.ini_options] +testpaths = ["tests"] +addopts = "--cov=pyweather --cov-report=term-missing" + +[tool.coverage.run] +source = ["src/pyweather"] diff --git a/src/pyweather/__init__.py b/src/pyweather/__init__.py new file mode 100644 index 0000000..35f3901 --- /dev/null +++ b/src/pyweather/__init__.py @@ -0,0 +1,4 @@ +"""PyWeather — a Python weather library.""" + +__version__ = "0.1.0" +__all__: list[str] = [] diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_pyweather.py b/tests/test_pyweather.py new file mode 100644 index 0000000..20f6fd9 --- /dev/null +++ b/tests/test_pyweather.py @@ -0,0 +1,6 @@ +import pyweather + + +def test_version() -> None: + assert isinstance(pyweather.__version__, str) + assert pyweather.__version__ != ""