-
Notifications
You must be signed in to change notification settings - Fork 657
Migrating setup.py to pyproject.toml #7375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7375 +/- ##
=======================================
Coverage 99.69% 99.69%
=======================================
Files 529 529
Lines 50610 50610
=======================================
Hits 50455 50455
Misses 155 155 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though CI is passing, it seems there are some deprecation warnings being raised by uv, we may want to address those as part of this PR.
https://github.com/PennyLaneAI/pennylane/actions/runs/14887842195/job/41812184792?pr=7375#step:9:17
/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmptnMJ7R/lib/python3.10/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated
!!
********************************************************************************
Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).
By 2026-Feb-[18](https://github.com/PennyLaneAI/pennylane/actions/runs/14887842195/job/41812184792?pr=7375#step:9:19), you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************
!!
corresp(dist, value, root_dir)
/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmptnMJ7R/lib/python3.10/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
********************************************************************************
Please consider removing the following classifiers in favor of a SPDX license expression:
License :: OSI Approved :: Apache Software License
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************
!!
dist._finalize_license_expression()
/home/runner/work/_temp/setup-uv-cache/builds-v0/.tmptnMJ7R/lib/python3.10/site-packages/setuptools/dist.py:761: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
********************************************************************************
Please consider removing the following classifiers in favor of a SPDX license expression:
License :: OSI Approved :: Apache Software License
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************
!!
Co-authored-by: Yushao Chen (Jerry) <[email protected]>
setup.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire content of this file should be:
from setuptools import setup
setup()
Everything in between is not needed
pyproject.toml
Outdated
@@ -1,3 +1,83 @@ | |||
[build-system] | |||
requires = ["setuptools>=75", "tomli"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requires = ["setuptools>=75", "tomli"] | |
requires = ["setuptools>=75.8.1", "tomli"] |
setuptools < 75.8.1 may cause build failures, hence why we explicitly pin it explicitly in CI (See #7005)
Also, does PL need tomli
as a build dependency?
Context:
The build and installation methods using
setup.py
have been deprecated;pyproject.toml
is the recommended method. Pennylane needs to be updated to usepyproject.toml
instead.Description of the Change:
Update pyproject.toml to be used to build packages
Benefits:
setup.py
is deprecated, this change ensures that packages can still be builtPossible Drawbacks:
Related GitHub Issues: