Skip to content

Switch to uv and ruff; remove setup.py and pytest.ini#1093

Open
jdebacker wants to merge 11 commits intoPSLmodels:masterfrom
jdebacker:uv
Open

Switch to uv and ruff; remove setup.py and pytest.ini#1093
jdebacker wants to merge 11 commits intoPSLmodels:masterfrom
jdebacker:uv

Conversation

@jdebacker
Copy link
Member

This PR does the following

  • Replace setup.py with full [project] metadata in pyproject.toml
  • Move pytest.ini config into [tool.pytest.ini_options] in pyproject.toml
  • Replace [tool.black] with [tool.ruff] (line-length = 79) in pyproject.toml
  • Add [project.optional-dependencies] dev and docs groups
  • Rename check_black.yml -> check_ruff.yml; use uvx ruff format/check
  • Update build_and_test.yml to use astral-sh/setup-uv instead of conda
  • Update deploy_docs.yml and docs_check.yml to use uv
  • Update publish_to_pypi.yml to use uv build
  • Update Makefile format target (ruff) and pip-package target (uv build)
  • Update environment.yml: replace black/pylint with ruff, drop setuptools
  • Update README.md: replace black badge with ruff, update install instructions

- Replace setup.py with full [project] metadata in pyproject.toml
- Move pytest.ini config into [tool.pytest.ini_options] in pyproject.toml
- Replace [tool.black] with [tool.ruff] (line-length = 79) in pyproject.toml
- Add [project.optional-dependencies] dev and docs groups
- Rename check_black.yml -> check_ruff.yml; use uvx ruff format/check
- Update build_and_test.yml to use astral-sh/setup-uv instead of conda
- Update deploy_docs.yml and docs_check.yml to use uv
- Update publish_to_pypi.yml to use uv build
- Update Makefile format target (ruff) and pip-package target (uv build)
- Update environment.yml: replace black/pylint with ruff, drop setuptools
- Update README.md: replace black badge with ruff, update install instructions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Modernizes the project’s Python packaging and CI tooling by moving metadata/configuration into pyproject.toml, switching formatting/linting to Ruff, and updating GitHub Actions workflows to use uv instead of conda/setup.py-driven builds.

Changes:

  • Migrate package metadata and pytest config from setup.py/pytest.ini into pyproject.toml.
  • Replace Black-based formatting checks with Ruff formatting/linting; update Makefile targets accordingly.
  • Update CI/docs/publish GitHub Actions workflows to install/build with uv and publish via uv build.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
setup.py Removed legacy setuptools configuration in favor of pyproject.toml.
pytest.ini Removed; pytest config moved into pyproject.toml.
pyproject.toml Adds [project] metadata, optional dev/docs deps, Ruff + pytest configuration.
environment.yml Updates dev environment deps (drops black/pylint/setuptools; adds ruff).
README.md Updates badges and installation instructions to reflect Ruff + uv usage.
Makefile Switches format to Ruff; switches package build to uv build.
.github/workflows/build_and_test.yml Uses astral-sh/setup-uv and uv pip install for tests.
.github/workflows/docs_check.yml Uses uv to install dev+docs extras and build docs.
.github/workflows/deploy_docs.yml Uses uv to install dev+docs extras and build/deploy docs.
.github/workflows/publish_to_pypi.yml Builds distributions with uv build before publishing.
.github/workflows/check_ruff.yml Adds Ruff format/lint checks via uvx.
.github/workflows/check_black.yml Removed Black formatting workflow.
Comments suppressed due to low confidence (1)

Makefile:80

  • The pip-package target now runs uv build, so the target name is misleading (and may confuse future callers, especially since CI no longer calls make pip-package). Consider renaming this target to something like build-package (and updating any references) to reflect the new behavior.
pip-package:
	uv build


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

jdebacker and others added 7 commits March 19, 2026 17:56
The --system flag conflicts with active virtual environments on GitHub
Actions runners. Switch to uv sync (which manages its own .venv) and
prefix commands with uv run so they execute in that environment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 73.80952% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.95%. Comparing base (dbe0b9f) to head (d03cc7e).

Files with missing lines Patch % Lines
ogcore/txfunc.py 37.50% 5 Missing ⚠️
ogcore/TPI.py 0.00% 3 Missing ⚠️
ogcore/SS.py 0.00% 2 Missing ⚠️
ogcore/utils.py 80.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1093      +/-   ##
==========================================
- Coverage   73.20%   72.95%   -0.25%     
==========================================
  Files          21       21              
  Lines        5180     5170      -10     
==========================================
- Hits         3792     3772      -20     
- Misses       1388     1398      +10     
Flag Coverage Δ
unittests 72.95% <73.80%> (-0.25%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ogcore/__init__.py 100.00% <100.00%> (ø)
ogcore/constants.py 100.00% <ø> (ø)
ogcore/demographics.py 53.63% <ø> (ø)
ogcore/firm.py 96.29% <100.00%> (ø)
ogcore/fiscal.py 97.97% <ø> (ø)
ogcore/household.py 90.53% <100.00%> (-0.04%) ⬇️
ogcore/output_plots.py 88.23% <100.00%> (-0.03%) ⬇️
ogcore/parameter_plots.py 78.26% <100.00%> (ø)
ogcore/parameter_tables.py 86.07% <ø> (ø)
ogcore/pensions.py 68.23% <ø> (ø)
... and 5 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants