From dc440519e44a61eee38f591f1b8b6704f6cb2099 Mon Sep 17 00:00:00 2001 From: Alex Kerney Date: Fri, 19 Jun 2026 12:00:47 -0400 Subject: [PATCH 1/3] Further cleanup with repo-review Not the happiest with python being in a subdirectory, but we figured it out. - Some formatting updates - Updated pytest - Colors in CI New hooks - Validate pyproject - Blacken docs - MDformat - Repo Review itself --- .github/copilot-instructions.md | 44 +++++++++++++++++++++++++----- .github/dependabot.yml | 4 --- .github/workflows/javascript.yml | 3 ++ .github/workflows/python.yml | 3 ++ .pre-commit-config.yaml | 43 +++++++++++++++++++++++++++++ README.md | 4 ++- py/Readme.md | 2 ++ py/pyproject.toml | 31 ++++++++++++++++++++- py/tests/test_standards_library.py | 2 -- py/uv.lock | 30 +++++++++++--------- ruff.toml | 15 ++++++++++ utils/update_standards.py | 3 +- 12 files changed, 155 insertions(+), 29 deletions(-) create mode 100644 ruff.toml diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 89cc909..a51b46f 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -7,18 +7,24 @@ Standard Knowledge is a multi-language library for programmatically augmenting C ## Working Effectively ### Bootstrap, build, and test the repository + - `cargo build --verbose` -- builds all Rust components. Takes ~55 seconds. NEVER CANCEL. Set timeout to 120+ seconds. - `cargo test --verbose` -- runs all Rust tests. Takes ~25 seconds. NEVER CANCEL. Set timeout to 60+ seconds. - `cd py && uv run pytest` -- runs Python tests. Takes ~25 seconds. NEVER CANCEL. Set timeout to 60+ seconds. ### Install CLI tool + - `cargo install --path cli` -- installs the standard_knowledge CLI tool. Takes ~32 seconds. NEVER CANCEL. Set timeout to 90+ seconds. ### Run applications + Python library (interactive testing): + - `cd py && uv run python` + ```python import standard_knowledge + library = standard_knowledge.StandardsLibrary() library.load_cf_standards() library.load_knowledge() @@ -27,6 +33,7 @@ print(standard.attrs()) # Note: use standard.unit, not standard.units ``` CLI usage: + - `standard_knowledge --help` -- show CLI help - `standard_knowledge get air_pressure_at_mean_sea_level` -- get standard details - `standard_knowledge get -f xarray air_pressure_at_mean_sea_level` -- get xarray format @@ -34,6 +41,7 @@ CLI usage: - `standard_knowledge filter --ioos-category Meteorology` -- filter by category ### Linting and formatting + - `cargo fmt --check` -- check Rust formatting (~0.6 seconds) - `cargo fmt --all` -- apply Rust formatting - `cargo clippy --all-targets --all-features` -- run Rust linting. Takes ~12 seconds. NEVER CANCEL. Set timeout to 30+ seconds. @@ -42,16 +50,19 @@ CLI usage: ## Validation Always manually validate changes by: + 1. **Build and test**: Run both Rust and Python test suites after making changes -2. **CLI functionality**: Test CLI commands with real examples from the README -3. **Python library**: Test Python library functionality interactively -4. **Standards data**: Verify standards can be loaded and queried correctly +1. **CLI functionality**: Test CLI commands with real examples from the README +1. **Python library**: Test Python library functionality interactively +1. **Standards data**: Verify standards can be loaded and queried correctly ### Test CLI changes + - Update CLI tests: `TRYCMD=overwrite cargo test --package standard_knowledge_cli --test cmd` -- Takes ~11 seconds. NEVER CANCEL. Set timeout to 30+ seconds. - For new CLI features, copy existing test files in `cli/tests/cmd/` and run the TRYCMD command ### Update standards + - Run `uv run --script utils/update_standards.py` to refresh CF Standards from official sources. Takes ~10 seconds. ## Repository Structure @@ -62,6 +73,7 @@ Always manually validate changes by: - **utils/**: Python utility scripts for maintaining standards data ### Key files and directories + - `core/standards/`: YAML files containing community knowledge for each standard - `core/src/lib.rs`: Main Rust library entry point - `cli/src/main.rs`: CLI application entry point @@ -69,7 +81,9 @@ Always manually validate changes by: - `.pre-commit-config.yaml`: Pre-commit hooks configuration ### Standards Knowledge Structure + Each standard has a YAML file in `core/standards/.yaml` with: + - `ioos_category`: IOOS measurement category - `long_name`: Human readable name - `common_variable_names`: Alternative column/variable names @@ -82,6 +96,7 @@ Each standard has a YAML file in `core/standards/.yaml` with: ## Common Tasks ### Build times (with 50% buffer for timeout recommendations) + - Rust build: ~55 seconds → Use 120+ second timeout - Rust tests: ~25 seconds → Use 60+ second timeout - CLI install: ~32 seconds → Use 90+ second timeout @@ -90,18 +105,22 @@ Each standard has a YAML file in `core/standards/.yaml` with: - CLI test updates: ~11 seconds → Use 30+ second timeout ### Project Workspace Structure + This is a Cargo workspace with three members: + - `core` (standard_knowledge): Core Rust library - `cli` (standard_knowledge_cli): CLI application - `py` (standard_knowledge_py): Python bindings ### Common CI/CD commands that must pass + - All pre-commit hooks (rustfmt, clippy, ruff, codespell, actionlint) - `cargo build --verbose` - `cargo test --verbose` - `cd py && uv run pytest` ### Example repository root listing + ``` . ├── .github/ @@ -117,7 +136,9 @@ This is a Cargo workspace with three members: ``` ### Standards Library Usage Patterns + **Rust:** + ```rust use standard_knowledge::StandardsLibrary; let mut library = StandardsLibrary::new(); @@ -126,14 +147,17 @@ library.load_knowledge(); ``` **Python:** + ```python import standard_knowledge + library = standard_knowledge.StandardsLibrary() library.load_cf_standards() library.load_knowledge() ``` **CLI:** + ```bash standard_knowledge get standard_knowledge filter --var @@ -141,13 +165,16 @@ standard_knowledge qc config ``` ### Adding new standards knowledge + 1. Create or edit YAML file in `core/standards/.yaml` -2. Run tests to validate: `cargo test` -3. Update CLI tests if needed: `TRYCMD=overwrite cargo test --package standard_knowledge_cli --test cmd` -4. Always run linting before committing: `cargo fmt --all && cargo clippy` +1. Run tests to validate: `cargo test` +1. Update CLI tests if needed: `TRYCMD=overwrite cargo test --package standard_knowledge_cli --test cmd` +1. Always run linting before committing: `cargo fmt --all && cargo clippy` ### Building Pyodide/WASM wheels locally + Pyodide wheels require specific Rust and Pyodide versions due to Emscripten compatibility: + ```bash # Install the compatible Rust version rustup install nightly-2025-01-20 @@ -156,11 +183,14 @@ rustup target add wasm32-unknown-emscripten --toolchain nightly-2025-01-20 # Build pyodide wheels with pinned Rust toolchain and Pyodide 0.27.7 RUSTUP_TOOLCHAIN=nightly-2025-01-20 CIBW_PYODIDE_VERSION=0.27.7 uvx cibuildwheel --platform pyodide py ``` + **Why these version pins?** + 1. **Rust nightly-2025-01-20**: Rust 1.87+ generates WASM code requiring `--enable-bulk-memory-opt` which older wasm-opt (bundled with Emscripten 3.1.58) doesn't support. See: https://github.com/PyO3/maturin/issues/2549 -2. **Pyodide 0.27.7**: Pyodide 0.28+ uses Emscripten 4.0.9 which has a bug with Rust-mangled symbol exports. The fix is in Emscripten 4.0.22+ but Pyodide hasn't updated yet. See: https://github.com/emscripten-core/emscripten/issues/24825 +1. **Pyodide 0.27.7**: Pyodide 0.28+ uses Emscripten 4.0.9 which has a bug with Rust-mangled symbol exports. The fix is in Emscripten 4.0.22+ but Pyodide hasn't updated yet. See: https://github.com/emscripten-core/emscripten/issues/24825 ### Important Notes + - Python bindings automatically rebuild when Rust code changes - CLI tests use trycmd for snapshot testing - update with `TRYCMD=overwrite` - Standards data is embedded into binaries at compile time via `build.rs` diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5928071..488d987 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,10 +11,6 @@ updates: - "/py" schedule: interval: "weekly" - groups: - cargo: - patterns: - - "*" cooldown: default-days: 7 diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index e9d3fb6..50a646c 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -9,6 +9,9 @@ on: branches: [ main ] workflow_dispatch: +env: + FORCE_COLOR: 3 + permissions: contents: read diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index d6fd0a0..a87e4d6 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -14,6 +14,9 @@ on: pull_request: workflow_dispatch: +env: + FORCE_COLOR: 3 + permissions: contents: read diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1cfb8fc..98f576a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,6 +8,21 @@ repos: exclude: docs/mkdocs.yml - id: debug-statements - id: mixed-line-ending + + - repo: https://github.com/abravalheri/validate-pyproject + rev: 4b2e70d08cb2ccd26d1fba73588de41c7a5d50b7 # frozen: v0.25 + hooks: + - id: validate-pyproject + # The package lives in py/, not at the repo root + files: 'pyproject\.toml$' + additional_dependencies: ["validate-pyproject-schema-store[all]"] + + - repo: https://github.com/python-jsonschema/check-jsonschema + rev: f805888065fdb6162e1f800e50bb9460cbd223d6 # frozen: 0.37.2 + hooks: + - id: check-dependabot + - id: check-github-workflows + - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. rev: '3b3f7c3f57fe9925356faf5fe6230835138be230' # frozen: v0.15.17 @@ -15,23 +30,27 @@ repos: - id: ruff-format - id: ruff-check args: ["--fix", "--show-fixes"] + - repo: https://github.com/rhysd/actionlint rev: 914e7df21a07ef503a81201c76d2b11c789d3fca # frozen: v1.7.12 hooks: - id: actionlint files: ".github/workflows/" args: ["-ignore", "SC1090", "-ignore", "SC2046", "-ignore", "SC2086", "-ignore", "SC2129", "-ignore", "SC2155"] + - repo: https://github.com/zizmorcore/zizmor-pre-commit rev: 9257c6050c0261b8c57e712f632dc4a8010109a9 # frozen: v1.25.2 hooks: - id: zizmor files: "^\\.github" args: [--persona=pedantic] + - repo: https://github.com/codespell-project/codespell # Configuration for codespell is in .codespellrc rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a # frozen: v2.4.2 hooks: - id: codespell + - repo: local hooks: - id: rustfmt @@ -47,8 +66,32 @@ repos: language: system pass_filenames: false + - repo: https://github.com/adamchainz/blacken-docs + rev: "fda77690955e9b63c6687d8806bafd56a526e45f" # frozen: 1.20.0 + hooks: + - id: blacken-docs + additional_dependencies: [black==24.*] + + - repo: https://github.com/hukkin/mdformat + rev: 82912cdaea4fb830f751504486a7879c70526547 # frozen: 1.0.0 + hooks: + - id: mdformat + - repo: https://github.com/biomejs/pre-commit rev: "5e270eb5db26a98324ef2f4b96135fc342c5d197" # frozen: v2.4.16 hooks: - id: biome-check additional_dependencies: ["@biomejs/biome@2.1.1"] + + - repo: https://github.com/scientific-python/cookie + rev: "8f0581cc50b14023b14a9c77e9b358738ba637e7" # frozen: 2026.06.18 + hooks: + - id: sp-repo-review + name: repo-review (root) + entry: repo-review --ignore PY001,PY005,PP301,GH212,PC140,PC170 + - id: sp-repo-review + name: repo-review (py) + entry: repo-review py + +auto_update: + cooldown_days: 7 diff --git a/README.md b/README.md index 6fd8783..fd7d5d7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # standard_knowledge + Programmatically augmenting CF Standards with IOOS operational knowledge. ```py @@ -237,9 +238,10 @@ Best run with `./noxfile -s test_js`, but individual tests are listed in the [Ja Unless a session is specified, Nox will run all but `update_standards`, `install_cli`, `release`, and `test_wasm_env` sessions. Sessions (use `-s`): + - `update_standards` - Updates the CF standards. - `install_cli` - Install the Rust CLI. -- `release` -- - Bumps the version of the all the packages for a release. +- `release` -- \ - Bumps the version of the all the packages for a release. - `py_test-` - Test a Python version as specified in the Github actions matrix. - `py_wheel` - Build Linux wheels for currently supported Python versions. - `py_wheel_wasm` - Build 3.14 WASM wheel. diff --git a/py/Readme.md b/py/Readme.md index 2b59c33..d4ea8d1 100644 --- a/py/Readme.md +++ b/py/Readme.md @@ -44,7 +44,9 @@ Note: [cibuildwheel only uses official builds](https://github.com/pypa/cibuildwh `../noxfile.py -s wheel` should run that as well. ### Building Pyodide/WASM wheels locally + Pyodide wheels require specific Rust and Pyodide versions due to Emscripten compatibility: + ```bash # Install the compatible Rust version rustup install nightly-2025-01-20 diff --git a/py/pyproject.toml b/py/pyproject.toml index 2508164..fb48296 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -17,7 +17,7 @@ license = "Apache-2.0" [dependency-groups] dev = [ - "pytest>=8.3.5", + "pytest>9", ] [tool.maturin] @@ -35,7 +35,17 @@ cache-keys = [{file = "pyproject.toml"}, {file = "Cargo.toml"}, {file = "src/**/ # Uncomment to build rust code in development mode # config-settings = { build-args = '--profile=dev' } +[tool.pytest] +minversion = "9.0" +addopts = ["-v", "-ra", "--strict-markers", "--strict-config"] +testpaths = ["tests"] +xfail_strict = true +filterwarnings = ["error"] +log_level = "INFO" + [tool.cibuildwheel] +# Use the faster uv-backed build frontend +build-frontend = "build[uv]" # Run the package tests using `pytest` after building wheels test-groups = ["dev"] test-command = "python -m pytest {project}/py/tests -xv" @@ -46,3 +56,22 @@ skip = [ [tool.cibuildwheel.pyodide] pyodide-version = "314.0.0" environment = {"RUSTUP_TOOLCHAIN" = "1.93.0"} + +[tool.repo-review] +ignore = [ + "MY100", # Mypy + "PY004", # Docs folder + + # Missed due to package not in the root + "PY003", # License file + "PY006", # Pre-commit + "PY007", # Nox + "GH100", # Github Actions +] + +[tool.ruff] +lint.extend-select = [ + "B", # flake8-bugbear + "I", # isort + "UP", # pyupgrade +] diff --git a/py/tests/test_standards_library.py b/py/tests/test_standards_library.py index a406a6d..f754b3c 100644 --- a/py/tests/test_standards_library.py +++ b/py/tests/test_standards_library.py @@ -1,8 +1,6 @@ import pytest - import standard_knowledge - KNOWLEDGE = { "name": "air_pressure_at_mean_sea_level", "long_name": "Air Pressure at Sea Level", diff --git a/py/uv.lock b/py/uv.lock index 54dfa52..f75b150 100644 --- a/py/uv.lock +++ b/py/uv.lock @@ -2,6 +2,10 @@ version = 1 revision = 3 requires-python = ">=3.12" +[options] +exclude-newer = "2026-06-12T15:54:02.166875Z" +exclude-newer-span = "P7D" + [[package]] name = "colorama" version = "0.4.6" @@ -13,20 +17,20 @@ wheels = [ [[package]] name = "iniconfig" -version = "2.1.0" +version = "2.3.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f2/97/ebf4da567aa6827c909642694d71c9fcf53e5b504f2d96afea02718862f3/iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", size = 4793, upload-time = "2025-03-19T20:09:59.721Z" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050, upload-time = "2025-03-19T20:10:01.071Z" }, + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, ] [[package]] name = "packaging" -version = "25.0" +version = "26.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, + { url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" }, ] [[package]] @@ -40,16 +44,16 @@ wheels = [ [[package]] name = "pygments" -version = "2.19.2" +version = "2.20.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, + { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, ] [[package]] name = "pytest" -version = "8.4.1" +version = "9.0.3" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama", marker = "sys_platform == 'win32'" }, @@ -58,9 +62,9 @@ dependencies = [ { name = "pluggy" }, { name = "pygments" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/08/ba/45911d754e8eba3d5a841a5ce61a65a685ff1798421ac054f85aa8747dfb/pytest-8.4.1.tar.gz", hash = "sha256:7c67fd69174877359ed9371ec3af8a3d2b04741818c51e5e99cc1742251fa93c", size = 1517714, upload-time = "2025-06-18T05:48:06.109Z" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/0d/549bd94f1a0a402dc8cf64563a117c0f3765662e2e668477624baeec44d5/pytest-9.0.3.tar.gz", hash = "sha256:b86ada508af81d19edeb213c681b1d48246c1a91d304c6c81a427674c17eb91c", size = 1572165, upload-time = "2026-04-07T17:16:18.027Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/29/16/c8a903f4c4dffe7a12843191437d7cd8e32751d5de349d45d3fe69544e87/pytest-8.4.1-py3-none-any.whl", hash = "sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7", size = 365474, upload-time = "2025-06-18T05:48:03.955Z" }, + { url = "https://files.pythonhosted.org/packages/d4/24/a372aaf5c9b7208e7112038812994107bc65a84cd00e0354a88c2c77a617/pytest-9.0.3-py3-none-any.whl", hash = "sha256:2c5efc453d45394fdd706ade797c0a81091eccd1d6e4bccfcd476e2b8e0ab5d9", size = 375249, upload-time = "2026-04-07T17:16:16.13Z" }, ] [[package]] @@ -75,4 +79,4 @@ dev = [ [package.metadata] [package.metadata.requires-dev] -dev = [{ name = "pytest", specifier = ">=8.3.5" }] +dev = [{ name = "pytest", specifier = ">9" }] diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..1f8b874 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,15 @@ +target-version = "py312" + +[lint] +extend-select = [ + "B", # flake8-bugbear + "I", # isort + "C4", # flake8-comprehensions + "PGH", # pygrep-hooks + "PIE", # flake8-pie + "PT", # flake8-pytest-style + "RUF", # Ruff-specific rules + "SIM", # flake8-simplify + "UP", # pyupgrade + "YTT", # flake8-2020 +] diff --git a/utils/update_standards.py b/utils/update_standards.py index ad4e514..126af90 100644 --- a/utils/update_standards.py +++ b/utils/update_standards.py @@ -10,9 +10,10 @@ # exclude-newer = "2025-07-17T00:00:00Z" # /// from pathlib import Path + import requests -from bs4 import BeautifulSoup import yaml +from bs4 import BeautifulSoup commit = "2e7dbf1f335277bb979997c01f513a22056cdfaf" version = "94" From 4a32fedae5d42ad045e869af0ead485cdf382098 Mon Sep 17 00:00:00 2001 From: Alex Kerney Date: Fri, 19 Jun 2026 12:09:19 -0400 Subject: [PATCH 2/3] Install UV for CiBuildWheel and update py/README.md And fun with `git mv -f py/Readme.md py/README.md` due to case insensitivity. --- .github/workflows/python.yml | 5 +++++ .pre-commit-config.yaml | 2 +- py/Cargo.toml | 2 +- py/{Readme.md => README.md} | 0 py/pyproject.toml | 4 ++-- 5 files changed, 9 insertions(+), 4 deletions(-) rename py/{Readme.md => README.md} (100%) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index a87e4d6..8f736b0 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -117,6 +117,11 @@ jobs: if: matrix.os == 'windows-intel' run: rustup target add i686-pc-windows-msvc + - name: Install uv + uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 + with: + enable-cache: true + - name: Build wheels uses: pypa/cibuildwheel@a0a973acdc9e7b7f8b04ac5c80e6883a5a102615 # v4.1.0 env: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 98f576a..3e0ec46 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -88,7 +88,7 @@ repos: hooks: - id: sp-repo-review name: repo-review (root) - entry: repo-review --ignore PY001,PY005,PP301,GH212,PC140,PC170 + entry: repo-review --ignore PY001,PY004,PY005,PP301,GH212,PC140,PC170 - id: sp-repo-review name: repo-review (py) entry: repo-review py diff --git a/py/Cargo.toml b/py/Cargo.toml index 6551fc1..89e466d 100644 --- a/py/Cargo.toml +++ b/py/Cargo.toml @@ -3,7 +3,7 @@ name = "standard_knowledge_py" version.workspace = true license.workspace = true repository.workspace = true -readme = "Readme.md" +readme = "README.md" description.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/py/Readme.md b/py/README.md similarity index 100% rename from py/Readme.md rename to py/README.md diff --git a/py/pyproject.toml b/py/pyproject.toml index fb48296..cbff1db 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -11,7 +11,7 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] dynamic = ["version"] -readme = "Readme.md" +readme = "README.md" description = "Programmatically augmenting CF Standards with operational knowledge." license = "Apache-2.0" @@ -24,7 +24,7 @@ dev = [ features = ["pyo3/extension-module"] module-name = "standard_knowledge._standard_knowledge_py" python-source = "python" -exclude = ["Readme.md"] +exclude = ["README.md"] [tool.uv] From 6a449fc21700ea5a6de457c98199cea2b3573d83 Mon Sep 17 00:00:00 2001 From: Alex Kerney Date: Fri, 19 Jun 2026 12:24:29 -0400 Subject: [PATCH 3/3] Ignore free-threaded warnings --- py/pyproject.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/py/pyproject.toml b/py/pyproject.toml index cbff1db..d153f45 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -40,7 +40,14 @@ minversion = "9.0" addopts = ["-v", "-ra", "--strict-markers", "--strict-config"] testpaths = ["tests"] xfail_strict = true -filterwarnings = ["error"] +filterwarnings = [ + "error", + # The compiled extension does not yet declare free-threaded support, so on + # free-threaded builds (e.g. 3.14t) CPython re-enables the GIL and warns at + # import time. Ignore it until the PyO3 module opts in via Py_mod_gil. + # https://pyo3.rs/v0.29.0/free-threading.html + "ignore:The global interpreter lock:RuntimeWarning", +] log_level = "INFO" [tool.cibuildwheel]