-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Conditional requirements are not checked when loaded from cache #4747
Comments
Does it work if you use |
@benoit-pierre Did you want me to uninstall both, simulate another crash and then add that flag? |
No, no need to simulate another crash. I think I can reproduce it: the problem is with the cached wheel. Try:
|
@benoit-pierre correct |
The problem is the setuptools version that was used to create the (cached) wheel. If you purge pip's cache, update setuptools to at least 36.2.7, and retry, you should get the same (correct) behavior wether or not the cache is hit. |
@benoit-pierre to clarify, is this something that the package owner should be doing, or the installee? |
setup.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git i/setup.py w/setup.py
index 2b8560a..80e5559 100644
--- i/setup.py
+++ w/setup.py
@@ -20,8 +20,12 @@ requirements = [
'requests',
'lxml',
'beautifulsoup4',
- "enum34; python_version == '2.7'"
]
+extras_requirements = {
+ ':python_version == "2.7"': [
+ 'enum34',
+ ]
+}
version = None
author = None
@@ -77,6 +81,7 @@ setup(
include_package_data=True,
packages=['fbchat'],
install_requires=requirements,
+ extras_require=extras_requirements,
url=source,
version=version,
zip_safe=True, |
Thank you, I will forward this on :) |
Thanks @benoit-pierre for looking into this! ^>^ |
@benoit-pierre
shouldn't be there right? |
The |
Oh I see. Thanks! |
Can this issue be closed? |
I think it can. |
Description:
I was trying to download a package which had a
python_version = "2.7"
requirement marker.I ran
python3.6 -m pip install fbchat --upgrade
and got
Note that enum34 was ignored.
It then failed because I forgot to specify the
--user
flag, and I didn't run the command in sudo.Then, when I ran the command again with
--user
the conditional requirement wasn't checked, so enum34 was installed anyway, when it shouldn't have.Running the second command on my other laptop worked fine.
After uninstalling both fbchat and enum34, only running the command with
--no-cache-dir
would follow the conditional requirement.I believe this is because on crash, the conditional requirements aren't extracted to the cache correctly.
I may be able to fix this problem, but I'm not sure where to look.
The text was updated successfully, but these errors were encountered: