Skip to content

moving ci to uv + docs - #1872

Open
andrewkern wants to merge 4 commits into
popsim-consortium:mainfrom
andrewkern:feature/uv-ci
Open

andrewkern wants to merge 4 commits into
popsim-consortium:mainfrom
andrewkern:feature/uv-ci

Conversation

@andrewkern

Copy link
Copy Markdown
Member

closes #1865

this PR aims to move the CI infra over to uv following the example of tskit:

  • pyproject.toml now holds all metadata
  • The requirements/ directory is gone. Dev tools live in dependency groups: test, docs, lint, maintenance, and dev (all of them). Plain uv sync installs dev.
  • uv.lock pins every version
  • docs/development.rst now describes the uv workflow

Note: I haven't tried the windows SLiM build or the macOS runner. This PR should test them.

@andrewkern

Copy link
Copy Markdown
Member Author

tests are failing... working on it

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.84%. Comparing base (2faf6c2) to head (f49e81f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1872      +/-   ##
==========================================
+ Coverage   99.82%   99.84%   +0.01%     
==========================================
  Files         143      143              
  Lines        5039     5039              
  Branches      518      518              
==========================================
+ Hits         5030     5031       +1     
+ Misses          6        5       -1     
  Partials        3        3              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@popsim-consortium popsim-consortium deleted a comment from mergify Bot Sep 15, 2026
# Install the local package so that stdpopsim is in the path,
# which is needed for generating docs `command-output`.
python -m pip install .
- name: Install docs deps

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

my understanding of how uv works would be that this isn't necessary? but that's a poor understanding, so maybe it is?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh I see: is this letting us see failures in installation separate from running things?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right, uv run would do it on demand. The separate step keeps install failures out of the docs build log and checks the lockfile. Added a comment.

- name: Install lint deps
run: uv sync --locked --only-group lint

- name: Cache pre-commit hook environments

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

but uv is also cached?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yep but different caches. setup-uv caches Python packages. pre-commit builds its own environment per hook (blech), and that is what this caches. Added a comment.

Comment thread .github/workflows/tests.yml Outdated
Comment on lines +43 to +44
# SLiM is not a Python package, so it is built from source below.
# Only the binary is cached, keyed on the runner and SLIM_CACHE_NUM.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is a python package, on conda; but we need to build it from github head for now. (So we plan to comment this out at the next SLiM release.)

I don't see how only the binary is cached? but I don't know at all how the cacheing works.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch. I meant that SLiM is not on PyPI, so it cannot come from uv.lock.

for the cache: the path for the cache step is SLiM/Release/slim*, so only the built binary is saved and restored, not the whole build tree.

Rather than commenting the build step out at the next SLiM release, this is built as a switch. There is a SLIM_VERSION variable at the top of the workflow. Empty means build from github. Set it to a released version, e.g. "5.2", and the workflow installs that release from conda-forge with micromamba instead of building. I tested both paths across the the different OSs and it passes with either.

Comment thread docs/development.rst Outdated
Setuptools_scm will detect the version appopriately.
4. Upload to PyPI: `twine upload dist/{version just tagged}.tar.gz`
Then check out `upstream/main` and build the release sdist and wheel
with `uv build`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should add the instructions for testing things out on TestPyPI here - see the tskit dev docs on this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added. I followed the tskit-dev release language/process. take a look

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.

update CI

2 participants