Move build configuration to static configuration files#10958
Conversation
|
One or more of the the following people are requested to review this:
|
59f4185 to
74d9013
Compare
c4d0ea8 to
9e976ce
Compare
Pull Request Test Coverage Report for Build 7037526759
💛 - Coveralls |
9e976ce to
8b1b651
Compare
This removes the vast majority of the dynamic code from our `setup.py` files, and instead uses static configuration to specify them. As part of this, we also use a single `VERSION.txt` as a single source of truth for both the `qiskit-terra` main package and the `qiskit` "metapackage". This should avoid a situation where we let the two get out of sync during a release, which can cause us severe problems for fixing the problem with respect to git tags.
8b1b651 to
651e51b
Compare
mtreinish
left a comment
There was a problem hiding this comment.
Overall this LGTM, it's am much simpler state for managing the package. Using static config files for package metadata makes a lot more sense. Just a few small inline comments. Also do you know if this changes the minimum pip version we can use?
| "quantum circuit", | ||
| "quantum computing", | ||
| "quantum programming language", |
There was a problem hiding this comment.
These are good additions. While we're modifying the metadata, did you want anything compiler related here?
There was a problem hiding this comment.
Oh, I think I just made sure it was synchronised with the tags on the GitHub repo, rather than going out my way to add things. We can add "quantum compiler" to both if you thing it'd be good?
There was a problem hiding this comment.
Nah it's fine, we can always tweak these later if needed.
| # This will make the resolution work for installers from PyPI, but `pip install .[all]` will be | ||
| # unreliable because `qiskit-terra` will resolve to the PyPI version, so local changes in the | ||
| # optionals won't be reflected. | ||
| all = ["qiskit[qasm3-import,visualization,crosstalk-pass,csp-layout-pass]"] |
There was a problem hiding this comment.
This seems less than ideal, but in practice I guess people aren't using the all extra very frequently. I can't think of a better way to do this besides copy and pasting the component lists for all too. I'm guessing we can't use dynamic for optional dependencies because that's my only other thought.
There was a problem hiding this comment.
Yeah, it's not super ideal, though I was assuming .[all] isn't being used at all.
| dependencies = {file = "requirements.txt" } | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| include = ["qiskit", "qiskit.*"] |
There was a problem hiding this comment.
Wouldn't exclude = [""test*"] be more consistent with what we were doing before?
There was a problem hiding this comment.
It would be more consistent and I can switch it over to that if you prefer. I think the include-list form is maybe a bit less liable to silently break than an exclude list, though.
There was a problem hiding this comment.
That's fine with me, this works.
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
mtreinish
left a comment
There was a problem hiding this comment.
This LGTM now just one quick question inline, but I don't think it makes a big difference either way.
| name = "qiskit" | ||
| description = "An open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives." | ||
| requires-python = ">=3.8" | ||
| license = { file = "LICENSE.txt" } |
There was a problem hiding this comment.
Should we add?
| license = { file = "LICENSE.txt" } | |
| license = { file = "LICENSE.txt", text = "Apache 2.0" } |
I'm not sure if this is valid syntax or not though. I was doing one final pass through comparing the old setup.py with the metadata in the pyproject.toml and noticed we had the license string set before (and the file was pulled in implicitly I think) but now we just point to the file. But I also need to read PEP 639 to see if this matters at all either.
There was a problem hiding this comment.
The current PyPA guidelines say it's either-or (though maybe others interpret that text differently), so maybe it's best to just revisit when PEP 639 is accepted?
There was a problem hiding this comment.
Yeah, we can look at it again if/when pep 639 is accepted.
|
For the top question, which I didn't answer: I don't think this changes anything about the |
Summary
This removes the vast majority of the dynamic code from our
setup.pyfiles, and instead uses static configuration to specify them. As part of this, we also use a singleVERSION.txtas a single source of truth for both theqiskit-terramain package and theqiskit"metapackage". This should avoid a situation where we let the two get out of sync during a release, which can cause us severe problems for fixing the problem with respect to git tags.Summary
Details and comments