Skip to content

Build project with pyproject.toml - #8011

Merged
ricardoV94 merged 1 commit into
pymc-devs:mainfrom
Armavica:pyproject.toml
Oct 7, 2026
Merged

ricardoV94 merged 1 commit into
pymc-devs:mainfrom
Armavica:pyproject.toml

Conversation

@Armavica

Copy link
Copy Markdown
Member

Description

Related Issue

  • Closes #
  • Related to #

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

@codecov

codecov Bot commented Dec 18, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.95%. Comparing base (db4020b) to head (12ddac2).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #8011   +/-   ##
=======================================
  Coverage   91.95%   91.95%           
=======================================
  Files         128      128           
  Lines       21275    21276    +1     
=======================================
+ Hits        19563    19564    +1     
  Misses       1712     1712           

see 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.

@ricardoV94
ricardoV94 requested a review from maresb January 26, 2026 11:51
@ricardoV94

Copy link
Copy Markdown
Member

@maresb can you review this and @Armavica can you fix the conflicts. Sorry this slipped through the cracks

@tomicapretto

Copy link
Copy Markdown
Contributor

To which extent do we want to embrace Pixi here? Bambi's dev workflow is built on top of Pixi and I like how clean it looks like and I think I could help. But I guess here we don't want to force people to have Pixi installed in order to contribute to PyMC?

@maresb

maresb commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Sorry, I'm really slammed at the moment, but I have a slightly different approach that I took in PyTensor in pymc-devs/pytensor#1542

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@Armavica Armavica changed the title Build project with pyproject.toml and add pixi support Build project with pyproject.toml Aug 4, 2026
@Armavica
Armavica changed the base branch from v5 to main August 4, 2026 14:24
@Armavica

Armavica commented Aug 4, 2026 •

Copy link
Copy Markdown
Member Author

I'm changing the scope of this PR to ignore the pixi stuff for now and focus on ditching setup.py in favor of the declarative pyproject.toml

@Armavica
Armavica marked this pull request as draft August 4, 2026 14:28
@read-the-docs-community

read-the-docs-community Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

@Armavica
Armavica marked this pull request as ready for review August 4, 2026 15:07
@Armavica

Armavica commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

I checked that both the sdist and the wheel contain the same files before and after this change

Comment thread setup.py
Comment thread pyproject.toml
"bayesian-inference",
"science",
]
dependencies = [

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.

one more place to update dependencies :)

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.

One different place rather, because this removes requirements.txt!

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.

I don't see it excluded? nor the -devs one? Happy if they can go

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.

Damn, sorry, bad rebase. Now it is.
The requirements-devs.txt is another problem because it is auto-generated from the conda env. I think it can be tackled in its own time

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.

seems to only be used for binder... would be nice to get rid of it next yeah

@Armavica
Armavica force-pushed the pyproject.toml branch 2 times, most recently from e6d747a to 34c5600 Compare October 1, 2026 21:14

@ricardoV94 ricardoV94 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.

@maresb anything we need to do on pypi or conda side after this?

@maresb maresb 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.

This is so amazing, great work @Armavica!!! 🤩

This shouldn't require any changes on the conda-forge side apart from updating the setuptools and python constraints.

(BTW, any particular reason to pin python<3.15? Python is so stable that I question if it's actually necessary?)

It looks like versioneer is failing to set the version in the wheel/sdist, falling back to 0.0.0. In order to restore the correct version, I think we still need a mini setup.py with something like the following:

import versioneer
from setuptools import setup

setup(
    version=versioneer.get_version(),
    cmdclass=versioneer.get_cmdclass(),
)

@Armavica

Armavica commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

Thank you @maresb !

(BTW, any particular reason to pin python<3.15? Python is so stable that I question if it's actually necessary?)

I was thinking that if we don't explicitly test it in the CI, it might be wise to pin it?
Anyway I am planning to increment the pin tomorrow when Python 3.15 drops and we can include it in the CI :)

It looks like versioneer is failing to set the version in the wheel/sdist, falling back to 0.0.0. In order to restore the correct version, I think we still need a mini setup.py with something like the following

Ah yes indeed, thank you. I am wondering if it might be worth at some point moving to setuptools-scm, maintained by the PyPA and described as "the blessed package to manage your versions by scm tags"

@maresb maresb 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.

Looks great now!

Ah yes indeed, thank you. I am wondering if it might be worth at some point moving to setuptools-scm, maintained by the PyPA and described as "the blessed package to manage your versions by scm tags"

Yes, I was thinking the exact same thing! I'd prefer to tackle setuptools-scm in a separate PR because that also changes which files get included in the sdist, and would require a careful audit of the wheel/sdist included files and metadata.

I was thinking that if we don't explicitly test it in the CI, it might be wise to pin it?

My thinking on the matter has changed drastically over the years. If you happen to have a day to spare for reading about version constraints, I find this argument quite compelling, but I wouldn't block this PR on it.

@ricardoV94 ricardoV94 added the major Include in major changes release notes section label Oct 7, 2026
@ricardoV94

Copy link
Copy Markdown
Member

I'm cautiously marking this PR as "major"

@ricardoV94
ricardoV94 merged commit c2cb98d into pymc-devs:main Oct 7, 2026
42 checks passed
@williambdean

Copy link
Copy Markdown
Contributor

exciting!

@maresb

maresb commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

@ricardoV94, I think this is safe to tag as "maintenance" since I've validated the sdist and wheel artifacts. But the improvement itself is "major" 😉

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

Labels

maintenance major Include in major changes release notes section release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants