-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix tox failing to find 'install.requires' under some circumstances #33
Conversation
e782729
to
c15f657
Compare
to make CI happy, can you add |
also, just out of interest, what are the "circumstances" here? I've never had a problem with this... |
I have the same problem, so I will paste what I get. I have python 3.6 installed on openSUSE Leap 15.4.
|
@perlpunk does the PR fix your case? Because for me it does not, referencing some tmpdir path |
Same as in 94b8445 we should give the absolute path to install.requires to ensure it can be found.
c15f657
to
af687f6
Compare
No, with this PR I get this instead:
|
Hm, fun. It does look like you're on pretty old tox there - 2.9.1 is from 2017. I guess pip is equally old? Maybe this is an old pip issue? |
https://stackoverflow.com/questions/50737765/what-is-pip-req-build-temp-folder-used-for-can-i-prevent-using-it seems to be people discussing a similar problem in 2018, sadly no solution... |
https://lightrun.com/answers/pypa-setuptools-pip-213-in-tree-builds-with-setuptools-do-not-clean-local-build-directories suggests this was changed in pip 21.3. seems like pip used to copy stuff out to a temporary folder and run there. I wonder how it decides what to copy? maybe that's the issue. A slightly 'odd' thing my projects do is use setuptools_scm rather than having a manifest, maybe that screwed up old pip? |
|
but is that the pip actually in use at this point? it seems to be |
ah yes: |
yeah me too, I don't know what's going on there. seems like it's using stuff from the host system at that point, maybe? |
Hum. So 21.3.1 was still capable of doing in-tree builds and out-of-tree builds, but it seems like in-tree was definitely the default at that point. I wonder if SUSE patched it or something? |
also, is it possible to figure out what is in the temp directory pip's creating? does it leave it around after the failure, or can you interrupt? |
well, I installed a Leap 15.4 VM and I can reproduce this, so I'll poke about at it a bit. One thing I can see: the reason we're getting things like
so, that's one thing (and probably a bug to file against tox in Leap 15.4). but it does fail in the py36 environment which really is Python 3.6, so we can probably ignore this for our purposes and just use the py36 env and try to figure out why it's failing there. |
Woah, that's really weird behaviour. @perlpunk care to report to the openSUSE package maintainer? |
which package would that be? |
So, back to poking into this. One interesting(?) thing: on Fedora, a tox py36 environment gets pip 18.1; on Leap 15.4, a tox py36 environment gets pip 21.3.1. Leap's tox version is much older - 2.9.1 vs. 3.26.0 on the Fedora env I'm using to compare with (Fedora 37). Installing pip is tox's job, and it seems to decide what version to install itself. I'm wondering if later versions of tox decided that it's not safe to install a newer version of pip in the tox 3.6 environment and pinned to the older 18.1, or something like that? Aha. No, it's not quite that, but close, I think: tox-dev/tox#448 . As the Changelog puts it, "Virtual environments created now no longer upgrade pip/wheel/setuptools to the latest version. Instead the start packages after virtualenv creation now is whatever virtualenv has bundled in. This allows faster virtualenv creation and builds that are easier to reproduce." That change is from 3.10.0. So, tox versions before that always updated pip, wheels and setuptools from the versions bundled by virtualenv; tox versions from 3.10.0 onwards do not do that. It seems like this results in py36 environments built with recent tox having an older pip, at least on Fedora. Assuming pip comes in via virtualenv somehow, I'm not 100% sure what virtualenv is being used, but that seems to be the upshot. All my tox envs have a
so py37 and later get pip 22.2.2, but py36 gets 18.1. Still a lot of questions here, but this at least is an explanation why things differ for the |
Ugh, so, I learned a lot, but I think this is actually much simpler. Please just try doing: Leap 15.4's tox is so old it doesn't know about openQA-python-client , like my other projects, needs setuptools_scm installed in the environment that's building an sdist for it to be built correctly. If it isn't installed, lots of things get left out of the sdist, like the I don't know if there was an ugly old way to define build dependencies before PEP-517, maybe you can do something nasty in |
oh, the old way was |
Thanks @AdamWill , I'll try it later today! |
Indeed, it works. Thanks! |
@perlpunk do you have a suggestion how I should change the PR then? |
I doubt the PR is needed or useful. As I said, we could add This should only be a problem on fairly old platforms with tox earlier than 3.3.0 (which came out in 2018), and I kinda consider that a bit of a "doctor, it hurts". I might add a note to the README to say "develop on something modern or deal with the problems yourself". The changes to how Python development works since 2017 have made things way better, and I don't really want to commit to making things work with Ye Olde Ways; if anything I'm impatient to drop |
This explains the snag we ran into here: #33 Signed-off-by: Adam Williamson <awilliam@redhat.com>
Gonna close this as the PR was definitely on the wrong track. If anyone feels strongly about putting |
Same as in 94b8445 we should give the absolute path to install.requires to ensure it can be found.
I thought I could fix the setup.py but this didn't work. I will create a draft nevertheless so that we can discuss.