diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d202a33 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e86aa95..4e7dbbc 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.12'] + python-version: ['3.14'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Filter changed file paths to outputs - uses: dorny/paths-filter@v2.11.1 + uses: dorny/paths-filter@v3.0.2 id: changes with: filters: | @@ -28,36 +28,37 @@ jobs: python_files: - 'src/*.py' - 'src/**/*.py' + - pyproject.toml + - uv.lock - name: Should publish # if: steps.changes.outputs.docs == 'true' || steps.changes.outputs.root_docs == 'true' || steps.changes.outputs.python_files == 'true' run: echo "PUBLISH=$(echo true)" >> $GITHUB_ENV - - name: Install poetry + - name: Install uv + uses: astral-sh/setup-uv@v7 if: env.PUBLISH == 'true' - run: pipx install "poetry==1.7.1" + with: + enable-cache: true - name: Set up Python ${{ matrix.python-version }} if: env.PUBLISH == 'true' - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: 'poetry' + run: uv python install ${{ matrix.python-version }} - - name: Install dependencies [w/ docs] + - name: Install dependencies if: env.PUBLISH == 'true' - run: poetry install --with=docs,lint + run: uv sync --all-extras --dev - name: Print python versions if: env.PUBLISH == 'true' run: | python -V - poetry run python -V + uv run python -V - name: Build documentation if: env.PUBLISH == 'true' run: | - pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd + pushd docs; make SPHINXBUILD='uv run sphinx-build' html; popd - name: Push documentation to S3 if: env.PUBLISH == 'true' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 262c525..1100994 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,43 +9,49 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] docutils-version: ['0.18', '0.19'] + pytest-version: ['7', '8', '9'] + exclude: + # Exclude pytest 7 from Python 3.14 to reduce matrix size + - python-version: '3.14' + pytest-version: '7' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - name: Install poetry - run: pipx install "poetry==1.7.1" + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: 'poetry' + run: uv python install ${{ matrix.python-version }} - name: Install dependencies - run: | - poetry install --with=docs,test,coverage,lint - poetry run pip install docutils~=${{ matrix.docutils-version }} + run: uv sync --all-extras --dev + + - name: Install specific pytest version + run: uv pip install "pytest~=${{ matrix.pytest-version }}.0" - - name: Print python versions + - name: Print python and pytest versions run: | python -V - poetry run python -V + uv run python -V + uv run pytest --version - - name: Lint with ruff - run: poetry run ruff . + - name: Lint with ruff check + run: uv run ruff check . - - name: Format with ruff - run: poetry run ruff format . --check + - name: Format with ruff format + run: uv run ruff format . --check - name: Lint with mypy - run: poetry run mypy . + run: uv run mypy . - name: Test with pytest - run: poetry run py.test --cov=./ --cov-report=xml + run: uv run py.test --cov=./ --cov-report=xml - - uses: codecov/codecov-action@v3 + - uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} @@ -53,31 +59,35 @@ jobs: runs-on: ubuntu-latest needs: build if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + permissions: + id-token: write + attestations: write strategy: matrix: - python-version: ['3.12'] + python-version: ['3.14'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - name: Install poetry - run: pipx install "poetry==1.7.1" + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: 'poetry' + run: uv python install ${{ matrix.python-version }} + + - name: Install dependencies + run: uv sync --all-extras --dev - name: Build package if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - run: poetry build + run: uv build - name: Publish package if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@release/v1 with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - skip_existing: true + attestations: true + skip-existing: true diff --git a/.gitignore b/.gitignore index 4552ce9..0621c10 100644 --- a/.gitignore +++ b/.gitignore @@ -81,3 +81,8 @@ pip-wheel-metadata/ # Monkeytype monkeytype.sqlite3 + +# Claude code +**/CLAUDE.local.md +**/CLAUDE.*.md +**/.claude/settings.local.json diff --git a/.python-version b/.python-version index bccc8c8..4eba2a6 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.12.1 3.11.7 3.10.12 3.9.13 3.8.13 3.7.13 +3.13.0 diff --git a/.tmuxp.yaml b/.tmuxp.yaml index 52a00f6..5acf59c 100644 --- a/.tmuxp.yaml +++ b/.tmuxp.yaml @@ -1,13 +1,13 @@ session_name: gp-libs start_directory: ./ # load session relative to config location (project root). shell_command_before: -- '[ -f .venv/bin/activate ] && source .venv/bin/activate && reset' +- uv virtualenv --quiet > /dev/null 2>&1 && clear windows: - window_name: gp-libs focus: True layout: main-horizontal options: - main-pane-height: 35 + main-pane-height: 67% panes: - focus: true - pane @@ -16,7 +16,7 @@ windows: - window_name: docs layout: main-horizontal options: - main-pane-height: 35 + main-pane-height: 67% start_directory: docs/ panes: - focus: true diff --git a/.tool-versions b/.tool-versions index 3984384..ecb9f91 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,2 @@ -poetry 1.7.1 -python 3.12.1 3.11.6 3.10.12 3.9.13 3.8.13 3.7.13 +uv 0.9.17 +python 3.14 3.13.11 3.12.12 3.11.14 3.10.19 diff --git a/.windsurfrules b/.windsurfrules new file mode 100644 index 0000000..e5c31a1 --- /dev/null +++ b/.windsurfrules @@ -0,0 +1,136 @@ +# libtmux Python Project Rules + + +- uv - Python package management and virtual environments +- ruff - Fast Python linter and formatter +- py.test - Testing framework + - pytest-watcher - Continuous test runner +- mypy - Static type checking +- doctest - Testing code examples in documentation + + + +- Use a consistent coding style throughout the project +- Format code with ruff before committing +- Run linting and type checking before finalizing changes +- Verify tests pass after each significant change + + + +- Use reStructuredText format for all docstrings in src/**/*.py files +- Keep the main description on the first line after the opening `"""` +- Use NumPy docstyle for parameter and return value documentation +- Format docstrings as follows: + ```python + """Short description of the function or class. + + Detailed description using reStructuredText format. + + Parameters + ---------- + param1 : type + Description of param1 + param2 : type + Description of param2 + + Returns + ------- + type + Description of return value + """ + ``` + + + +- Use narrative descriptions for test sections rather than inline comments +- Format doctests as follows: + ```python + """ + Examples + -------- + Create an instance: + + >>> obj = ExampleClass() + + Verify a property: + + >>> obj.property + 'expected value' + """ + ``` +- Add blank lines between test sections for improved readability +- Keep doctests simple and focused on demonstrating usage +- Move complex examples to dedicated test files at tests/examples//test_.py +- Utilize pytest fixtures via doctest_namespace for complex scenarios + + + +- Run tests with `uv run py.test` before committing changes +- Use pytest-watcher for continuous testing: `uv run ptw . --now --doctest-modules` +- Fix any test failures before proceeding with additional changes + + + +- Make atomic commits with conventional commit messages +- Start with an initial commit of functional changes +- Follow with separate commits for formatting, linting, and type checking fixes + + + +- Use the following commit message format: + ``` + Component/File(commit-type[Subcomponent/method]): Concise description + + why: Explanation of necessity or impact. + what: + - Specific technical changes made + - Focused on a single topic + + refs: #issue-number, breaking changes, or relevant links + ``` + +- Common commit types: + - **feat**: New features or enhancements + - **fix**: Bug fixes + - **refactor**: Code restructuring without functional change + - **docs**: Documentation updates + - **chore**: Maintenance (dependencies, tooling, config) + - **test**: Test-related updates + - **style**: Code style and formatting + +- Prefix Python package changes with: + - `py(deps):` for standard packages + - `py(deps[dev]):` for development packages + - `py(deps[extra]):` for extras/sub-packages + +- General guidelines: + - Subject line: Maximum 50 characters + - Body lines: Maximum 72 characters + - Use imperative mood (e.g., "Add", "Fix", not "Added", "Fixed") + - Limit to one topic per commit + - Separate subject from body with a blank line + - Mark breaking changes clearly: `BREAKING:` + + + +- Use fixtures from conftest.py instead of monkeypatch and MagicMock when available +- For instance, if using libtmux, use provided fixtures: server, session, window, and pane +- Document in test docstrings why standard fixtures weren't used for exceptional cases +- Use tmp_path (pathlib.Path) fixture over Python's tempfile +- Use monkeypatch fixture over unittest.mock + + + +- Prefer namespace imports over importing specific symbols +- Import modules and access attributes through the namespace: + - Use `import enum` and access `enum.Enum` instead of `from enum import Enum` + - This applies to standard library modules like pathlib, os, and similar cases +- For typing, use `import typing as t` and access via the namespace: + - Access typing elements as `t.NamedTuple`, `t.TypedDict`, etc. + - Note primitive types like unions can be done via `|` pipes + - Primitive types like list and dict can be done via `list` and `dict` directly +- Benefits of namespace imports: + - Improves code readability by making the source of symbols clear + - Reduces potential naming conflicts + - Makes import statements more maintainable + diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..03c55a7 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,307 @@ +# AGENTS.md + +This file provides guidance to AI agents (including Claude Code, Cursor, and other LLM-powered tools) when working with code in this repository. + +## CRITICAL REQUIREMENTS + +### Test Success +- ALL tests MUST pass for code to be considered complete and working +- Never describe code as "working as expected" if there are ANY failing tests +- Even if specific feature tests pass, failing tests elsewhere indicate broken functionality +- Changes that break existing tests must be fixed before considering implementation complete +- A successful implementation must pass linting, type checking, AND all existing tests + +## Project Overview + +gp-libs is a Python library providing internal utilities and extensions for git-pull projects. It focuses on extending Sphinx documentation and pytest functionality with support for docutils-compatible markup formats. + +Key features: +- **doctest_docutils**: Reimplementation of Python's doctest with support for reStructuredText and Markdown +- **pytest_doctest_docutils**: pytest plugin for running doctests in documentation files +- **linkify_issues**: Sphinx extension that converts issue references (e.g., `#123`) to hyperlinks +- Supports testing doctest examples in `.rst` and `.md` files +- Powers documentation testing across the git-pull ecosystem + +## Development Environment + +This project uses: +- Python 3.10+ +- [uv](https://github.com/astral-sh/uv) for dependency management +- [ruff](https://github.com/astral-sh/ruff) for linting and formatting +- [mypy](https://github.com/python/mypy) for type checking +- [pytest](https://docs.pytest.org/) for testing + - [pytest-watcher](https://github.com/olzhasar/pytest-watcher) for continuous testing + +## Common Commands + +### Setting Up Environment + +```bash +# Install dependencies +uv pip install --editable . +uv pip sync + +# Install with development dependencies +uv pip install --editable . -G dev +``` + +### Running Tests + +```bash +# Run all tests +make test +# or directly with pytest +uv run pytest + +# Run a single test file +uv run pytest tests/test_doctest_docutils.py + +# Run a specific test +uv run pytest tests/test_doctest_docutils.py::test_function_name + +# Run tests with test watcher +make start +# or +uv run ptw . + +# Run tests with doctests +uv run ptw . --now --doctest-modules +``` + +### Linting and Type Checking + +```bash +# Run ruff for linting +make ruff +# or directly +uv run ruff check . + +# Format code with ruff +make ruff_format +# or directly +uv run ruff format . + +# Run ruff linting with auto-fixes +uv run ruff check . --fix --show-fixes + +# Run mypy for type checking +make mypy +# or directly +uv run mypy src tests + +# Watch mode for linting (using entr) +make watch_ruff +make watch_mypy +``` + +### Development Workflow + +Follow this workflow for code changes (see `.cursor/rules/dev-loop.mdc`): + +1. **Format First**: `uv run ruff format .` +2. **Run Tests**: `uv run pytest` +3. **Run Linting**: `uv run ruff check . --fix --show-fixes` +4. **Check Types**: `uv run mypy` +5. **Verify Tests Again**: `uv run pytest` + +### Documentation + +```bash +# Build documentation +make build_docs + +# Start documentation server with auto-reload +make start_docs + +# Update documentation CSS/JS +make design_docs +``` + +## Code Architecture + +gp-libs provides utilities for documentation testing and Sphinx extensions: + +``` +src/ +├── doctest_docutils.py # Core doctest reimplementation +├── pytest_doctest_docutils.py # pytest plugin +├── linkify_issues.py # Sphinx extension +├── docutils_compat.py # Compatibility layer +└── gp_libs.py # Package metadata +``` + +### Core Modules + +1. **doctest_docutils** (`src/doctest_docutils.py`) + - Reimplementation of Python's standard library `doctest` module + - Supports docutils-compatible markup (reStructuredText and Markdown) + - Handles `doctest_block`, `.. doctest::` directive, and ` ```{doctest} ` code blocks + - PEP-440 version specifier support for conditional tests + - Can be run directly: `python -m doctest_docutils README.md -v` + +2. **pytest_doctest_docutils** (`src/pytest_doctest_docutils.py`) + - pytest plugin integrating doctest_docutils with pytest + - Collects and runs doctests from `.rst` and `.md` files + - Full pytest fixture and conftest.py support + - Registered as `pytest11` entry point + +3. **linkify_issues** (`src/linkify_issues.py`) + - Sphinx extension for automatic issue linking + - Converts `#123` references to clickable hyperlinks + - Configured via `issue_url_tpl` in Sphinx conf.py + +4. **docutils_compat** (`src/docutils_compat.py`) + - Compatibility layer for cross-version docutils support + - Provides `findall()` abstraction for different docutils versions + +5. **gp_libs** (`src/gp_libs.py`) + - Package metadata (version, title, author, URLs) + +## Testing Strategy + +gp-libs uses pytest for testing with custom fixtures. The test suite includes: + +- Unit tests for doctest parsing and execution +- Integration tests for pytest plugin functionality +- Sphinx app factory for testing extensions + +### Test Structure + +``` +tests/ +├── test_doctest_docutils.py # Tests for doctest module +├── test_pytest_doctest_docutils.py # Tests for pytest plugin +├── test_linkify_issues.py # Tests for linkify extension +├── conftest.py # Fixtures and sphinx app factory +└── regressions/ # Regression tests +``` + +### Testing Guidelines + +1. **Use existing fixtures over mocks** (see `.cursor/rules/dev-loop.mdc`) + - Use fixtures from conftest.py instead of `monkeypatch` and `MagicMock` when available + - Document in test docstrings why standard fixtures weren't used for exceptional cases + +2. **Preferred pytest patterns** + - Use `tmp_path` (pathlib.Path) fixture over Python's `tempfile` + - Use `monkeypatch` fixture over `unittest.mock` + +3. **Running tests continuously** + - Use pytest-watcher during development: `uv run ptw .` + - For doctests: `uv run ptw . --now --doctest-modules` + +## Coding Standards + +For detailed coding standards, refer to `.cursor/rules/dev-loop.mdc`. Key highlights: + +### Imports + +- **Use namespace imports for stdlib**: `import enum` instead of `from enum import Enum`; third-party packages may use `from X import Y` +- **For typing**, use `import typing as t` and access via namespace: `t.NamedTuple`, etc. +- **Use `from __future__ import annotations`** at the top of all Python files + +### Docstrings + +Follow NumPy docstring style for all functions and methods (see `.cursor/rules/dev-loop.mdc`): + +```python +"""Short description of the function or class. + +Detailed description using reStructuredText format. + +Parameters +---------- +param1 : type + Description of param1 +param2 : type + Description of param2 + +Returns +------- +type + Description of return value +""" +``` + +### Doctest Guidelines + +1. **Use narrative descriptions** for test sections rather than inline comments +2. **Move complex examples** to dedicated test files at `tests/examples//test_.py` +3. **Keep doctests simple and focused** on demonstrating usage +4. **Add blank lines between test sections** for improved readability + +### Git Commit Standards + +See `.cursor/rules/git-commits.mdc` for detailed commit message standards. + +Format commit messages as: +``` +Component/File(commit-type[Subcomponent/method]): Concise description + +why: Explanation of necessity or impact. +what: +- Specific technical changes made +- Focused on a single topic +``` + +Common commit types: +- **feat**: New features or enhancements +- **fix**: Bug fixes +- **refactor**: Code restructuring without functional change +- **docs**: Documentation updates +- **chore**: Maintenance (dependencies, tooling, config) +- **test**: Test-related updates +- **style**: Code style and formatting +- **py(deps)**: Dependencies +- **py(deps[dev])**: Dev Dependencies +- **ai(rules[LLM type])**: AI Rule Updates + +Example: +``` +doctest_docutils(feat[parse]): Add support for myst-parser code blocks + +why: Enable doctest execution in Markdown documentation files +what: +- Add detection for ```{doctest} fence syntax +- Register myst directives automatically +- Add tests for Markdown doctest parsing +``` + +## Debugging Tips + +See `.cursor/rules/avoid-debug-loops.mdc` for detailed debugging guidance. + +When stuck in debugging loops: + +1. **Pause and acknowledge the loop** +2. **Minimize to MVP**: Remove all debugging cruft and experimental code +3. **Document the issue** comprehensively for a fresh approach +4. **Format for portability** (using quadruple backticks) + +## Sphinx/Docutils-Specific Considerations + +### Directive Registration + +- Use `_ensure_directives_registered()` to auto-register required directives +- Supports myst-parser directives (`{doctest}`, `{tab}`) +- Handles both reStructuredText and Markdown syntax + +### Document Parsing + +- Uses docutils for parsing `.rst` files +- Uses myst-parser for parsing `.md` files +- Both formats support doctest blocks + +### linkify_issues Configuration + +In your Sphinx `conf.py`: +```python +extensions = ["linkify_issues"] +issue_url_tpl = 'https://github.com/git-pull/gp-libs/issues/%7Bissue_id%7D' +``` + +## References + +- Documentation: https://gp-libs.git-pull.com/ +- GitHub: https://github.com/git-pull/gp-libs +- PyPI: https://pypi.org/project/gp-libs/ diff --git a/CHANGES b/CHANGES index db3920d..1fcb111 100644 --- a/CHANGES +++ b/CHANGES @@ -8,9 +8,241 @@ To install the unreleased gp-libs version, see [developmental releases](https:// $ pip install --user --upgrade --pre gp-libs ``` -## gp-libs 0.0.6 (unreleased) +[pipx](https://pypa.github.io/pipx/docs/): -- _Add your latest changes from PRs here_ +```console +$ pipx install --suffix=@next 'gp-libs' --pip-args '\--pre' --force +``` + +[uv](https://docs.astral.sh/uv/): + +```console +$ uv add gp-libs --prerelease allow +``` + +[uvx](https://docs.astral.sh/uv/guides/tools/): + +```console +$ uvx --from 'gp-libs' --prerelease allow gp-libs +``` + +## gp-libs 0.0.18 (unreleased) + + + +## gp-libs 0.0.17 (2025-12-07) + +### CI + +- Migrate to PyPI Trusted Publisher (#57) + +## gp-libs 0.0.16 (2025-11-25) + +### Features + +#### pytest_doctest_docutils + +- Add `_unblock_doctest()` helper for programmatic re-enabling of built-in doctest plugin (#56) + + Uses the public `pluginmanager.unblock()` API introduced in pytest 8.1.0, with graceful + fallback for older versions. + +### Bug fixes + +#### pytest_doctest_docutils + +- Autouse fixtures from `conftest.py` are now properly discovered for doctest files (#56) + + Backported from pytest commit [9cd14b4ff](https://github.com/pytest-dev/pytest/commit/9cd14b4ff) (2024-02-06). + +#### doctest_docutils + +- Doctest directive comments with leading whitespace (e.g., ` # doctest: +SKIP`) are now properly matched (#56) + + Backported from Sphinx commit [ad0c343d3](https://github.com/sphinx-doc/sphinx/commit/ad0c343d3) (2025-01-04). + +### Development + +- CI: Add pytest 9.x to test matrix, with pytest 7.x/8.x compatibility testing (#56) + +## gp-libs 0.0.15 (2025-11-01) + +### Breaking changes + +- Drop Python 3.9 (#54) + + The minimum version of Python in this and future releases is Python 3.10. + + Python 3.9 reached end-of-life status on October 5th, 2025 (see PEP 596). + +### Development + +- Add Python 3.14 to test matrix (#53) + +## gp-libs 0.0.14 (2025-10-26) + +### Bug fixes + +- Ensure docutils/myst doctest directives auto-register so Arch Linux packaging tests pass without manual setup (#52, fixes #48) + +## gp-libs 0.0.13 (2025-08-17) + +### Bug fixes + +- Type annotation fixes (#49) + +## gp-libs 0.0.12 (2025-07-12) + +### Bug fixes + +- Type annotation and linting fixes (resolves #48) + +### Deveopment + +- Internal package updates to uv, py.test, mypy, ruff, etc. + +## gp-libs 0.0.11 (2025-02-22) + +### Bug fixes + +- Fix for `pytest-asyncio` compatibility (#46) + +### Development + +#### chore: Implement PEP 563 deferred annotation resolution (#44) + +- Add `from __future__ import annotations` to defer annotation resolution and reduce unnecessary runtime computations during type checking. +- Enable Ruff checks for PEP-compliant annotations: + - [non-pep585-annotation (UP006)](https://docs.astral.sh/ruff/rules/non-pep585-annotation/) + - [non-pep604-annotation (UP007)](https://docs.astral.sh/ruff/rules/non-pep604-annotation/) + +For more details on PEP 563, see: https://peps.python.org/pep-0563/ + +## gp-libs 0.0.10 (2024-12-20) + +_Maintenance release: no bug fixes or new features._ + +### Breaking changes (#36) + +- Drop Python 3.8 + + The minimum version of Python in this and future releases is Python 3.9. + + Python 3.8 reached end-of-life status on October 7th, 2024 (see PEP 569). + +### Development + +- Aggressive automated lint fixes via `ruff` (#41) + + via ruff v0.8.4, all automated lint fixes, including unsafe and previews were applied for Python 3.9: + + ```sh + ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; ruff format . + ``` + +## gp-libs 0.0.9 (2024-11-26) + +### Breaking changes + +#### Project and package management: poetry to uv (#39) + +[uv] is the new package and project manager for the project, replacing Poetry. + +[uv]: https://github.com/astral-sh/uv + +#### Build system: poetry to hatchling (#39) + +[Build system] moved from [poetry] to [hatchling]. + +[Build system]: https://packaging.python.org/en/latest/tutorials/packaging-projects/#choosing-a-build-backend +[poetry]: https://github.com/python-poetry/poetry +[hatchling]: https://hatch.pypa.io/latest/ + +## gp-libs 0.0.8 (2024-10-19) + +### Breaking changes + +- Final Python 3.8 release, as it has reached end-of-life status October 7th, + 2024, see [PEP-569](https://peps.python.org/pep-0569/). + +### Development + +- poetry: 1.8.1 -> 1.8.2 + + See also: https://github.com/python-poetry/poetry/blob/1.8.2/CHANGELOG.md + +### Documentation + +- Automatically linkify links that were previously only text. + +## gp-libs 0.0.7 (2024-03-24) + +### Breaking changes + +#### Minimum requirements + +To lift the development burden of supporting legacy APIs, as this package is +lightly used, minimum constraints have been pinned: + +- docutils: 0.20.1+ +- myst-parser: 2.0.0+ + +If you have even passing interested in supporting legacy versions, file an +issue on the tracker. + +### Development + +- Aggressive automated lint fixes via `ruff` (#33) + + via ruff v0.3.4, all automated lint fixes, including unsafe and previews were applied: + + ```sh + ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; ruff format . + ``` + + Branches were treated with: + + ```sh + git rebase \ + --strategy-option=theirs \ + --exec 'poetry run ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; poetry run ruff format .; git add src tests; git commit --amend --no-edit' \ + origin/master + ``` + +- poetry: 1.7.1 -> 1.8.1 + + See also: https://github.com/python-poetry/poetry/blob/1.8.1/CHANGELOG.md + +- ruff 0.2.2 -> 0.3.0 (#32) + + Related formattings. Update CI to use `ruff check .` instead of `ruff .`. + + See also: https://github.com/astral-sh/ruff/blob/v0.3.0/CHANGELOG.md + +- Strengthen linting (#31) + + - Add flake8-commas (COM) + + - https://docs.astral.sh/ruff/rules/#flake8-commas-com + - https://pypi.org/project/flake8-commas/ + + - Add flake8-builtins (A) + + - https://docs.astral.sh/ruff/rules/#flake8-builtins-a + - https://pypi.org/project/flake8-builtins/ + + - Add flake8-errmsg (EM) + + - https://docs.astral.sh/ruff/rules/#flake8-errmsg-em + - https://pypi.org/project/flake8-errmsg/ + +## gp-libs 0.0.6post0 (2024-02-01) + +### Packaging + +- Relax pytest version constraint from 8+ to 7+ (#30) + +## gp-libs 0.0.6 (2024-02-01) ### Breaking change @@ -18,6 +250,9 @@ $ pip install --user --upgrade --pre gp-libs - Update doctest pytest plugin for pytest 8. +### Development + +- ruff 0.2.0 ## gp-libs 0.0.5 (2023-12-03) diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 0000000..47dc3e3 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/Makefile b/Makefile index deb0130..ad79d30 100644 --- a/Makefile +++ b/Makefile @@ -13,10 +13,10 @@ entr_warn: @echo "----------------------------------------------------------" test: - poetry run py.test $(test) + uv run py.test $(test) start: - $(MAKE) test; poetry run ptw . + $(MAKE) test; uv run ptw . watch_test: if command -v entr > /dev/null; then ${ALL_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi @@ -31,16 +31,16 @@ design_docs: $(MAKE) -C docs design ruff_format: - poetry run ruff format . + uv run ruff format . ruff: - ruff . + ruff check . watch_ruff: if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) ruff; else $(MAKE) ruff entr_warn; fi mypy: - poetry run mypy `${PY_FILES}` + uv run mypy `${PY_FILES}` watch_mypy: if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) mypy; else $(MAKE) mypy entr_warn; fi @@ -49,7 +49,7 @@ format_markdown: prettier --parser=markdown -w *.md docs/*.md docs/**/*.md CHANGES monkeytype_create: - poetry run monkeytype run `poetry run which py.test` + uv run monkeytype run `uv run which py.test` monkeytype_apply: - poetry run monkeytype list-modules | xargs -n1 -I{} sh -c 'poetry run monkeytype apply {}' + uv run monkeytype list-modules | xargs -n1 -I{} sh -c 'uv run monkeytype apply {}' diff --git a/README.md b/README.md index 4c6004d..66b1bfb 100644 --- a/README.md +++ b/README.md @@ -148,9 +148,20 @@ You can test the unpublished version of g before its released. $ pip install --user --upgrade --pre gp-libs ``` +# Minimum requirements + +To lift the development burden of supporting legacy APIs, as this package is +lightly used, minimum constraints have been pinned: + +- docutils: 0.20.1+ +- myst-parser: 2.0.0+ + +If you have even passing interested in supporting legacy versions, file an +issue on the tracker. + # More information -- Python support: >= 3.8, pypy +- Python support: >= 3.10, pypy - Source: - Docs: - Changelog: diff --git a/docs/Makefile b/docs/Makefile index ef6e7e3..43d2a65 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -182,8 +182,8 @@ dev: $(MAKE) -j watch serve start: - poetry run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} $(O) + uv run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} $(O) design: # This adds additional watch directories (for _static file changes) and disable incremental builds - poetry run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} --watch "." -a $(O) + uv run sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) --port ${HTTP_PORT} --watch "." -a $(O) diff --git a/docs/_templates/sidebar/projects.html b/docs/_templates/sidebar/projects.html index 217e418..7b46e0b 100644 --- a/docs/_templates/sidebar/projects.html +++ b/docs/_templates/sidebar/projects.html @@ -1,7 +1,7 @@