Adopt the py-canon fleet standard - #1
Conversation
CI, docs and release now run from py-canon's reusable workflows; the old hand-rolled ci.yml/docs.yml and python-publish.yml are gone. - Move the package from a flat fairlex/ layout to src/fairlex/. - Adopt the canon ruff rule set. `A` (the membership matrix) and `A_ub` (scipy.optimize.linprog's own parameter) are exempted by name via pep8-naming rather than by dropping the N rules; max-args is raised to 8 for the two LP entry points; tutorial notebooks may print. - Rewrite every docstring in Google style, the convention ruff pydocstyle and pydoclint are both configured for. - Replace nbsphinx with myst-nb so the docs build no longer needs a system pandoc binary, which the reusable docs workflow does not install. - Drop mypy (pre-commit hook, Makefile target) and deptry; retire the `# type: ignore` annotation hack in _solve_lp by importing OptimizeResult. - Fix an inverted metric in the example notebook: it counted margins still off target and reported them as "biases corrected". - Coverage floor lives in ci.yml (94, measured 95); pytest addopts no longer force --cov, which would have skewed the wheel job. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CI statusEverything passes except
This is a repository setting, not a code problem. I enabled Dependabot security updates via the API, which normally implies the graph, and it did not take. The dependency graph has no supported REST field for public repos, so it needs a click: https://github.com/finite-sample/fairlex/settings/security_analysis → Dependency graph → Enable Then re-run the failed jobs and |
Brings fairlex onto py-canon v1.1.1. CI, docs and release now run from the
fleet's reusable workflows; the hand-rolled
ci.yml,docs.ymlandpython-publish.ymlare replaced.What changed
Layout.
fairlex/->src/fairlex/, the layout the standard assumes.Lint. Adopted the canon ruff rule set (43 rule groups, up from 13). 141
findings on the first pass, all resolved rather than silenced except:
pep8-naming.extend-ignore-names = ["A", "A_ub"]Ais the membership matrix in the calibration literature this implements;A_ubisscipy.optimize.linprog's own parameter name. Scoped to those two names, not a blanketNdrop.pylint.max-args = 8"docs/**/*.ipynb" = ["T201"]No
E501ignore: the long lines incalibration.pyand the example notebookwere wrapped. The repo's previous config ignored
E501,T201,B008,PLR0913andUP037globally; only the two above survive.Docstrings. Every docstring was numpy-style while both ruff pydocstyle and
pydoclint were configured for Google. Converted them, which cleared 11
D416and 6 pydoclint violations.
Docs.
docs/conf.pynow delegates topy_canon.sphinx.configure, withthree repo-specific additions kept: myst-nb, the numpy/scipy/pandas
intersphinx targets, and the furo source links. nbsphinx was replaced by
myst-nb because nbsphinx shells out to a
pandocbinary that the reusabledocs workflow does not install — the build would have failed on the first
run.
sphinx-build -Wis clean, including the executed notebook.Retired. mypy (pre-commit hook, Makefile target) and deptry; the
# type: ignore[name-defined]string annotation in_solve_lpis now a realOptimizeResultimport.Bug fix. The example notebook's "Survey Representativeness" line counted
margins still off target and reported them as biases corrected — it printed
0 demographic biases correctedfor a calibration that hit every margin. Itnow reports
18 of 18 biased margins brought on target.Verification
ruff check/ruff format --check: cleanpyright: 0 errorspydoclint src/: no violationspreen check --strict: all 22 checks passpytest --cov: 27 passed, 95% coverage;coverage-floorset to 94twine checkpasses, tests run againstthe installed wheel
sphinx-build -W -b htmland the doctest builder: both succeedzizmor --min-severity high: no findingsuv lock --upgradewas run to clear 10 known vulnerabilities preen's auditcheck found in dev/docs transitive dependencies.
Manual steps for you
fairlexpublisher frompython-publish.ymltorelease.yml, environmentpypi.gatecontextfrom the reusable CI. Create or repoint it.
🤖 Generated with Claude Code