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
Remove setuptools as runtime dependency #8366
Conversation
Thanks for the PR! We'll look at assigning a reviewer during the next triage meeting (triage meetings occur weekly on Tuesdays) |
Estimated review time: 4 minutes. |
@flying-sheep @gmarkall I will pre-empt this and assign myself as reviewer. Judging from #8356 the reference to setup tools will have to be removed in more places than just |
Ah, in that case I’m sorry I was so brash with my 5 minute estimate. You definitely don’t need setuptools at runtime anymore since you don’t import But of course I’m not familiar with the code base to know which of all these files are dependencies for runtime or build time. I made a guess, but I’m not sure about e.g. the docs/environment.yml |
Yeah, this may be a bit of a "chisel" to get right. We have multiple ways of building. Though we have enough CI to be reasonably confident. |
Are the test timeouts flukes or likely to have something to do with this PR? I’d assume that tests aren’t supposed to time out if a dependency is missing … |
the latest test of |
I can’t interpret what’s going wrong. I see
I can of course experimentally re-add the |
OK, that did the trick I guess? |
Yeah, looks like the tests pass now. But, does this mean we are not quite ready to drop the |
Ah, you still import it in tests. So you are ready to drop it from runtime dependencies, but not from build and test dependencies. Nushell code: curl -sL https://pypi.io/packages/cp310/n/numba/numba-0.56.0-cp310-cp310-win32.whl -o /tmp/n.whl
bsdtar -tf /tmp/n.whl
| lines
| where $it =~ '\.py$'
| each { |fn| { name: $fn, content: (bsdtar -xOf /tmp/n.whl $fn | lines | where $it =~ 'setuptools') } }
| where ($it.content | length) > 0
| flatten
| to md Output:
|
@flying-sheep thank you for submitting this and shedding some light on this matter. I am not sure how useful it will be to remove setuptools from Numba at this time. I am not sure what sense it makes to remove it from the runtime dependencies but keep it for test and build time? I think it will make sense to remove |
@flying-sheep I just had an OOB conversation with someone about this. It seems like the module |
Here is the relevant PEP: https://peps.python.org/pep-0632/ |
If you don’t use setuptools at runtime, it’s just a build tool. A rust application doesn’t need rustc at runtime, a C++ application doesn’t need gcc at runtime. I want to be able to
/edit: oops, wrong PR
I think that’s the main question here: do you consider setup(
...
extras_require=dict(
pycc=['setuptools<60'],
),
) If I understand correctly, users who use |
I guess there's two separate concerns here:
I think @esc is alluding to the potential necessity of a To answer the questions above:
IIRC there's no requirement for this to be the use case, the functionality noted is provided to make integration with
I agree with the sentiment, but am curious as to a use case where this is high impact (with view of needing a |
IIUC, we include the test suite with installs of Numba, with the expectation that you can run the tests on any installed Numba version - so if the tests require setuptools, then we would need it to be installed with Numba. |
Thanks for raising this @gmarkall, it's a good point, the test suite does indeed ship with Numba and is expected to be able to run from any installation. The test suite does need |
Oh, whoops, I have done too many PRs where I both removed the
It’s not, I just don’t want to have setuptools installed if it’s not needed, and because of its patching of
To make this explicit you should probably spell it out anyway, something like: setup(
...
extras_require=dict(
pycc=['setuptools<60'],
tests=['scipy', 'numba[pycc]'],
),
) The |
I have given this issue some more thought and have the following considerations: We will need to replace |
Chiming in that the presence rarely has an impact (for me), but pinning down to an out-of-date version does have an impact. In particular, it is confusing my students who are writing packages with pyproject.toml, which needs IMO, upper bounds of just about anything in |
I'm currently looking at a bug that can be fixed with setuptools > 60 but the runtime dependency on an older setuptools prevents me from doing that. (Additional impact, I've spent a couple of hours chasing down why the wrong version of setuptools was ending up in this environment) |
@minrk @llimeht thanks for the input. I'll raise this at the Numba triage meeting today (and at the public meeting if there's no resolution found by the maintainers during triage). The reason for the pinning lies in the explanation given in #8355 (comment), though I think since the time of writing the breaking change in |
Thanks @stuartarchibald; removing the run-time dependency on setuptools for the build-tool still seems like something to investigate regardless. |
From a relatively long discussion about this at both the maintainers' triage meeting and the Numba public meeting, the conclusions are as follows: Numba is going to attempt the following:
|
FWIW: #8474 may be an interesting patch to include here |
Point 2. in #8366 (comment) is implemented (WIP) in #8476, I had to guess quite a bit at equivalent functionality, early reviews/comments are welcomed. |
Point 3. in #8366 (comment) was implemented in #8475 and will be in a 0.56.3 patch release. |
Closing. suggested changes were implemented in PRs noted above. |
It was added in #4794, as you imported
pkg_resources
at the time.Since #5209 you no longer import it and therefore no longer have a runtime dependency on setuptools.