Skip to content

MAINT: add 'dev' dependency group, add uv-sync CI check - #894

Merged
dnicolodi merged 1 commit into
mesonbuild:mainfrom
mwtoews:maint-fix-docs-add-dev
Sep 13, 2026
Merged

dnicolodi merged 1 commit into
mesonbuild:mainfrom
mwtoews:maint-fix-docs-add-dev

Conversation

@mwtoews

@mwtoews mwtoews commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

This PR helps development with uv. There is an issue with uv sync in this project:

$ uv sync
Using CPython 3.14.2
Creating virtual environment at: .venv
  × No solution found when resolving dependencies for split (markers: python_full_version == '3.9.*' and sys_platform != 'ios'):
  ╰─▶ Because the requested Python version (>=3.9) does not satisfy Python>=3.10 and sphinx>=8.1.0,<=8.1.3 depends on Python>=3.10, we can conclude that
      sphinx>=8.1.0,<=8.1.3 cannot be used.
      And because only the following versions of sphinx are available:
          sphinx<=8.1.0
          sphinx==8.1.1
          sphinx==8.1.2
          sphinx==8.1.3
          sphinx>8.2.dev0
      we can conclude that sphinx>=8.1.0,<8.2.dev0 cannot be used.
      And because meson-python:docs depends on sphinx>=8.1.0,<8.2.dev0 and your project requires meson-python:docs, we can conclude that your project's requirements
      are unsatisfiable.

hint: While the active Python version is 3.14, the resolution failed for other Python versions supported by your project. Consider limiting your project's supported Python versions using `requires-python`.
hint: The `requires-python` value (>=3.9) includes Python versions that are not supported by your dependencies (e.g., sphinx>=8.1.0,<=8.1.3 only supports >=3.10). Consider using a more restrictive `requires-python` value (like >=3.10).

The incompatibility with sphinx ~= 8.1.0 is resolved by requiring this dependency to require Python >= 3.10. (An alternative fix is to drop Python 3.9 from this project, but I'm not here to suggest that right now). This means that an older version of sphinx is selected for Python 3.9 users that want to build docs (probably not anyone).

This PR also adds a "dev" dependency group, with pre-commit and including everything in the "test" group (but not "docs"). Uv automatically includes "dev", which is handy when running uv sync. Or with a venv, pip install --group dev will install all the development dependencies.

Lastly, ignore all *.lock files (e.g. uv.lock, pixi.lock, and others).

@rgommers rgommers left a comment

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.

Thanks @mwtoews. First impression: this looks good. Two thoughts:

  • We can actually drop Python 3.9 I think, the EOL date for it was October 31, 2025. And we dropped Python 3.8 about a year ago, in gh-799. @dnicolodi do you agree?
  • We may want to exercise this in CI to ensure it stays fixed. We don't have to commit the lock file, but just a job that runs uv sync would catch this.

Both could be done as follow-ups, this seems mergeable as is.

Comment thread pyproject.toml
Comment thread pyproject.toml Outdated
@dnicolodi

dnicolodi commented Sep 11, 2026

Copy link
Copy Markdown
Member
  • We can actually drop Python 3.9 I think, the EOL date for it was October 31, 2025. And we dropped Python 3.8 about a year ago, in gh-799. @dnicolodi do you agree?

Meson 1.12 requires Python 3.10. I think we can just drop support for Python 3.9. This would allow to reduce a tiny bit the number of CI jobs we need to run, and to use a more modern version of mypy. The only obstacle I see is our Cygwin CI job using Python 3.9. Until not very long ago, that was the latest Python version available on Cygwin.

@dnicolodi

Copy link
Copy Markdown
Member

Cygwin CI job using Python 3.9. Until not very long ago, that was the latest Python version available on Cygwin.

I just checked: in the time between Cygwin added Python 3.12 packages.

@mwtoews

mwtoews commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author
  • We may want to exercise this in CI to ensure it stays fixed. We don't have to commit the lock file, but just a job that runs uv sync would catch this.

This is a good idea, and would be worthwhile including in this PR while I'm at it. It would effectively do this:

$ uv sync --group test --dry-run
Using CPython 3.14.2
Would create project environment at: .venv
Resolved 49 packages in 47ms
Would create lockfile at: uv.lock
Would download 1 package
Would install 15 packages
 + build==1.6.1
 + coverage==7.16.0
 + cython==3.3.0
 + iniconfig==2.3.0
 + meson==1.12.0
 + meson-python @ file:///tmp/meson-python
 + packaging==26.3
 + pluggy==1.6.0
 + pygments==2.21.0
 + pyproject-hooks==1.2.0
 + pyproject-metadata==0.12.1
 + pytest==9.1.1
 + pytest-cov==7.1.0
 + pytest-mock==3.15.1
 + wheel==0.48.0

@mwtoews
mwtoews force-pushed the maint-fix-docs-add-dev branch from 02258ea to 1d02a05 Compare September 12, 2026 05:11

@rgommers rgommers left a comment

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.

Two requests:

  • Can you add the uv sync test at the bottom of tests.yml please? No need for a separate file here, nor a cron job.
  • Can you rewrite the commit history so it's one commit per logical change? We prefer using rebase-merging and aim to keep a clean linear history.

@mwtoews mwtoews changed the title MAINT: resolve version incompatibility with 'docs', add 'dev' group MAINT: add 'dev' dependency group, add uv-sync CI check Sep 12, 2026
@mwtoews
mwtoews force-pushed the maint-fix-docs-add-dev branch 2 times, most recently from cd317e7 to aeaa1d5 Compare September 12, 2026 10:21

@dnicolodi dnicolodi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some more comments from my side.

I am also wondering: should we switch to uv for all jobs? That would exercise the dependencies installation without having to add a dedicated job. We can do this at a later time.

Comment thread .github/workflows/tests.yml Outdated
Comment thread pyproject.toml
Comment thread pyproject.toml
Comment thread .github/workflows/tests.yml
@rgommers

Copy link
Copy Markdown
Contributor

I am also wondering: should we switch to uv for all jobs? That would exercise the dependencies installation without having to add a dedicated job. We can do this at a later time.

I'd do that later, if we do it. We can't just add uv in front of pip install, that doesn't help (it won't do locking) - so a separate uv sync check seems easier.

@mwtoews
mwtoews force-pushed the maint-fix-docs-add-dev branch from aeaa1d5 to 9ebb2b1 Compare September 12, 2026 20:09
@mwtoews

mwtoews commented Sep 12, 2026

Copy link
Copy Markdown
Contributor Author

Note that the uv-sync workflow takes 5 to 8 seconds to complete, which is pretty good. And yes, uv pip install would not catch the incompatible package/python versions as initially reported in this PR.

As for uv for all other workflows, sure go for it! But keep a few legacy pip workflows for sane coverage.

@mwtoews
mwtoews force-pushed the maint-fix-docs-add-dev branch from 9ebb2b1 to c80c363 Compare September 12, 2026 20:26
@dnicolodi

Copy link
Copy Markdown
Member

Thanks @mwtoews. Merging.

@dnicolodi
dnicolodi merged commit 1600215 into mesonbuild:main Sep 13, 2026
36 checks passed
@rgommers rgommers added this to the v0.22.0 milestone Sep 13, 2026
@rgommers rgommers added the maintenance Regular code improvements that are not new features nor end-user-visible bugs label Sep 13, 2026
@mwtoews
mwtoews deleted the maint-fix-docs-add-dev branch September 13, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Regular code improvements that are not new features nor end-user-visible bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants