Skip to content
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

Platform specific dependencies ignored when installing from a local directory #1951

Closed
philipdouglas opened this issue Jul 30, 2014 · 6 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@philipdouglas
Copy link

My setup.py contains the following:

extras_require={
    ":sys_platform=='win32'": [
        'WMI>=1.4, <1.5',
        'pywin32==217',
    ],
}

when I build a wheel from this and install it using pip, it correctly only installs WMI and pywin32 on Windows.

When I install the same package by pointing pip at the directory the setup.py is in (pip install .), it ignores the win32 packages and just installs the normal ones.

Am I doing something wrong or is this a bug?

@freakboy3742
Copy link
Contributor

I can confirm that I see this bug as well. Wheel installs will correctly pull down dependencies from PyPI; pip install --no-use-wheel and pip install . does not.

My demonstration project is toga-demo.

@mikenerone
Copy link

This might be a manifestation of #1236. pip currently can't install any extras from a local directory unless "-e" (editable mode, which is not what you want in a deployment) is specified.

@philipdouglas
Copy link
Author

This problem happens with or without -e but it does seem related.

@cournape
Copy link

cournape commented Aug 7, 2015

I can confirm the issue happens with -e in development mode for python version specifier as well:

from setuptools import setup


INSTALL_REQUIRES = ["click < 5"]
EXTRAS_REQUIRE = {
    ':python_version=="2.7"': ['pathlib']
}

setup(
    name="foo", version="1.0", install_requires=INSTALL_REQUIRES,
    extras_require=EXTRAS_REQUIRE
)

python setup.py develop will install pathlib when run under python 2.7, but pip install -e . will not.

@xavfernandez
Copy link
Member

With what versions of pip did you test ?

(b8450f7fb8090eb3)xfernandez@xfernandez-PORTEGE-R930:~/other_dev/tests⟫ pip list
pip (7.1.0)
setuptools (18.0.1)
(b8450f7fb8090eb3)xfernandez@xfernandez-PORTEGE-R930:~/other_dev/tests⟫ cat test_env/setup.py 
from setuptools import setup


INSTALL_REQUIRES = ["click < 5"]
EXTRAS_REQUIRE = {
    ':python_version=="2.7"': ['pathlib']
}

setup(
    name="foo", version="1.0", install_requires=INSTALL_REQUIRES,
    extras_require=EXTRAS_REQUIRE
)
(b8450f7fb8090eb3)xfernandez@xfernandez-PORTEGE-R930:~/other_dev/tests⟫ pip install -e test_env/
Obtaining file:///home/xfernandez/other_dev/tests/test_env
Collecting click<5 (from foo==1.0)
  Using cached https://pypi-dev//simple/click/click-4.1-py2.py3-none-any.whl
Collecting pathlib (from foo==1.0)
Installing collected packages: click, pathlib, foo
  Running setup.py develop for foo
Successfully installed click-4.1 foo pathlib-1.0.1
(b8450f7fb8090eb3)xfernandez@xfernandez-PORTEGE-R930:~/other_dev/tests⟫ pip list
click (4.1)
foo (1.0)
pathlib (1.0.1)
pip (7.1.0)
setuptools (18.0.1)

latest pip seems to work alright (same for pip install .)

@cournape
Copy link

cournape commented Aug 7, 2015

Hm, you're right, I was actually using a very old pip without realizing it. Confirmed it works as expected w/ 7.1.0.

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jul 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

5 participants