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

Passing --use-pep517 doesn't apply to build requirements #10739

Open
1 task done
jaraco opened this issue Dec 21, 2021 · 2 comments
Open
1 task done

Passing --use-pep517 doesn't apply to build requirements #10739

jaraco opened this issue Dec 21, 2021 · 2 comments
Labels
C: build logic Stuff related to metadata generation / wheel generation S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior

Comments

@jaraco
Copy link
Member

jaraco commented Dec 21, 2021

Description

Attempting to install a package that has unbuilt dependencies with an implicit dependency on setuptools fails when installing under PEP 517.

Because semver<2.7.3,>=2.2.1 has an implicit dependency on Setuptools but because Setuptools isn't installed, the build fails. In other situations, passing --use-pep517 allows for pip to install setuptools as a fallback dependency for packages that don't declare it.

Expected behavior

If the install is indicating --use-pep517, then perhaps that option should be used when installing the build dependencies as well. Or alternatively maybe there should be another option that indicates to use pep517 to install dependencies for pep518 build dependencies.

pip version

21.3.1

Python version

3.10.0

OS

macOS 12

How to Reproduce

example $ ls
pyproject.toml
example $ cat *
[build-system]
requires = ["setuptools>=36.2.4", "pkutils>=1.0.0,<2.0.0"]
build-backend = "setuptools.build_meta"
example $ pip cache remove semver
WARNING: No matching packages for pattern "semver"
Files removed: 0
example $ pip install --use-pep517 .

Output

Processing /Users/jaraco/draft/example
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-standalone-pip-vi5we1oe/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-f1as9f7e/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=36.2.4' 'pkutils>=1.0.0,<2.0.0'
       cwd: None
  Complete output (203 lines):
  Collecting setuptools>=36.2.4
    Using cached setuptools-60.0.3-py3-none-any.whl (952 kB)
  Collecting pkutils<2.0.0,>=1.0.0
    Using cached pkutils-1.2.1-py2.py3-none-any.whl (9.9 kB)
  Collecting semver<2.7.3,>=2.2.1
    Using cached semver-2.7.2.tar.gz (4.8 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_37b84fa9b2b2406896df9ebb9b55a7cd/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_37b84fa9b2b2406896df9ebb9b55a7cd/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-pip-egg-info-kc757de4
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_37b84fa9b2b2406896df9ebb9b55a7cd/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_37b84fa9b2b2406896df9ebb9b55a7cd/setup.py", line 6, in <module>
        from setuptools import setup
    ImportError: cannot import name 'setup' from 'setuptools' (unknown location)
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/f5/53/e54d47643e69c14260e89713e04e028b08d0a1a867b1e0bc818f0ca0d63a/semver-2.7.2.tar.gz#sha256=305ec78e564557d506db6489b87a7b1a14ab1436feeeb8062b53c055455fae8f (from https://pypi.org/simple/semver/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    Using cached semver-2.7.1.tar.gz (4.8 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_2f24dca12ea14d96a50b5f2d96ff96a7/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_2f24dca12ea14d96a50b5f2d96ff96a7/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-pip-egg-info-ffplvt53
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_2f24dca12ea14d96a50b5f2d96ff96a7/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_2f24dca12ea14d96a50b5f2d96ff96a7/setup.py", line 6, in <module>
        from setuptools import setup
    ImportError: cannot import name 'setup' from 'setuptools' (unknown location)
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/0a/ac/d8f4cb81b44381555dc2cc449a1af1606a4a526be2849c8fa134d5a31c32/semver-2.7.1.tar.gz#sha256=f6ace2dd25ac435d8a0133c4a6d12972129d9d574563569a48dd073ba23f1bef (from https://pypi.org/simple/semver/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    Using cached semver-2.7.0.tar.gz (4.8 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_edff00f601a24698a93ce1dcf9794830/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_edff00f601a24698a93ce1dcf9794830/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-pip-egg-info-r82eq0x3
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_edff00f601a24698a93ce1dcf9794830/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_edff00f601a24698a93ce1dcf9794830/setup.py", line 6, in <module>
        from setuptools import setup
    ImportError: cannot import name 'setup' from 'setuptools' (unknown location)
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/6a/31/70f8aaa54b8a66d7d7a7cdba1d6a98e6e48184d7d24b4093b8dbb85969cb/semver-2.7.0.tar.gz#sha256=a7b3a219ff99a3f3842baa75a2e012d2adbdc7d00ffb4017d797e5d63d1ee5ca (from https://pypi.org/simple/semver/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    Using cached semver-2.6.0.tar.gz (4.5 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_5b292c074d474663bd4b8f3545e11abc/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_5b292c074d474663bd4b8f3545e11abc/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-pip-egg-info-4rwfhmeg
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_5b292c074d474663bd4b8f3545e11abc/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_5b292c074d474663bd4b8f3545e11abc/setup.py", line 6, in <module>
        from setuptools import setup
    ImportError: cannot import name 'setup' from 'setuptools' (unknown location)
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/c6/47/54611c019d3fb1b31aee502c4893f56c4a329fb614f785c2af7f5846939a/semver-2.6.0.tar.gz#sha256=75d0a314aef5473435c517795d6cb9478810585dd3315c4eebc071201d54d14b (from https://pypi.org/simple/semver/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    Using cached semver-2.5.0.tar.gz (4.5 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_2e8708df751447a8835275189eb62b07/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_2e8708df751447a8835275189eb62b07/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-pip-egg-info-wtnb1bbc
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_2e8708df751447a8835275189eb62b07/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_2e8708df751447a8835275189eb62b07/setup.py", line 6, in <module>
        from setuptools import setup
    ImportError: cannot import name 'setup' from 'setuptools' (unknown location)
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/6a/b4/d901be05d4d7a6537b61d8d1839a8a60d2102e80e315168433d3c0bb42b1/semver-2.5.0.tar.gz#sha256=ff7d193d9df702a8e71a311e808a4e85a1f44e4a9c379361d5d354baaeebbe02 (from https://pypi.org/simple/semver/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    Using cached semver-2.4.2.tar.gz (4.5 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_81df46b9824c4cd5a87688ae0101425b/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_81df46b9824c4cd5a87688ae0101425b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-pip-egg-info-v4foq65f
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_81df46b9824c4cd5a87688ae0101425b/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_81df46b9824c4cd5a87688ae0101425b/setup.py", line 6, in <module>
        from setuptools import setup
    ImportError: cannot import name 'setup' from 'setuptools' (unknown location)
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/1e/80/075a7683e49867cfbbc29697ebfce43eb660a00701166f778d47361c1b11/semver-2.4.2.tar.gz#sha256=1330a7fad7e7eabf921c4b0755127f7413c0c4a226ab2805ef4ecd71ed02d481 (from https://pypi.org/simple/semver/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    Using cached semver-2.4.1.tar.gz (2.8 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_a1de725ea0d840d29bfd18d3d94d4b09/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_a1de725ea0d840d29bfd18d3d94d4b09/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-pip-egg-info-80j_cqcx
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_a1de725ea0d840d29bfd18d3d94d4b09/
    Complete output (10 lines):
    /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_a1de725ea0d840d29bfd18d3d94d4b09/setup.py:3: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
      from distutils.core import setup
    /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'include_package_data'
      warnings.warn(msg)
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help
  
    error: invalid command 'egg_info'
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/bd/46/86ebc497ece1ab47732197ac6a3c8189a80cdd1079aa2dda43865598428a/semver-2.4.1.tar.gz#sha256=4b407ad9516204e737438d2ee62e1d109674803f3fd48f0a7273f3ba353cf6fe (from https://pypi.org/simple/semver/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    Using cached semver-2.4.0.tar.gz (2.8 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_c2f80235fd4449db9a925981164853fd/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_c2f80235fd4449db9a925981164853fd/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-pip-egg-info-60f232gp
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_c2f80235fd4449db9a925981164853fd/
    Complete output (10 lines):
    /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_c2f80235fd4449db9a925981164853fd/setup.py:3: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
      from distutils.core import setup
    /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'include_package_data'
      warnings.warn(msg)
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help
  
    error: invalid command 'egg_info'
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/4a/cc/b2fe8fe0023474c77d6eca0c92205bce46632ffda8487f14c7d67276023d/semver-2.4.0.tar.gz#sha256=8cd2fca77da1d219f81c50ce8bacf940a3b42d84662dfde78aac0b8a3c109548 (from https://pypi.org/simple/semver/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    Using cached semver-2.3.1.tar.gz (2.8 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_3a8637d0f65540bd88737dfe07767c15/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_3a8637d0f65540bd88737dfe07767c15/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-pip-egg-info-dr2td1lx
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_3a8637d0f65540bd88737dfe07767c15/
    Complete output (10 lines):
    /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_3a8637d0f65540bd88737dfe07767c15/setup.py:3: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
      from distutils.core import setup
    /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'include_package_data'
      warnings.warn(msg)
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help
  
    error: invalid command 'egg_info'
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/32/44/5a878276fb81dedf2a74ff3c75e663d7d3c2cd2b0f01ea77acf3b32bfb25/semver-2.3.1.tar.gz#sha256=8917eecf1d45dabf93fc982cac626b223f53a759ce612c7ce4158e8873cef019 (from https://pypi.org/simple/semver/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    Using cached semver-2.3.0.tar.gz (2.8 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_7ba459fa934145629f71ec5a6ac96742/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_7ba459fa934145629f71ec5a6ac96742/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-pip-egg-info-8r8x4q7k
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_7ba459fa934145629f71ec5a6ac96742/
    Complete output (10 lines):
    /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_7ba459fa934145629f71ec5a6ac96742/setup.py:3: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
      from distutils.core import setup
    /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'include_package_data'
      warnings.warn(msg)
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help
  
    error: invalid command 'egg_info'
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/7d/c6/6dec51e718eecd896ffad7f0c773829bdc7a0f32fdce96fb68f549ff7019/semver-2.3.0.tar.gz#sha256=e9bf0d41cbfc3136b009cf01c7ba060eb6d6e73d24e038b65888f6f8e3267d7a (from https://pypi.org/simple/semver/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
    Using cached semver-2.2.1.tar.gz (2.5 kB)
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_7a6a99ae930e4db0b63ad379d94ca4d9/setup.py'"'"'; __file__='"'"'/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_7a6a99ae930e4db0b63ad379d94ca4d9/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-pip-egg-info-tgqdifob
         cwd: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_7a6a99ae930e4db0b63ad379d94ca4d9/
    Complete output (10 lines):
    /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-r4mpyoay/semver_7a6a99ae930e4db0b63ad379d94ca4d9/setup.py:3: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
      from distutils.core import setup
    /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'include_package_data'
      warnings.warn(msg)
    usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: setup.py --help [cmd1 cmd2 ...]
       or: setup.py --help-commands
       or: setup.py cmd --help
  
    error: invalid command 'egg_info'
    ----------------------------------------
  WARNING: Discarding https://files.pythonhosted.org/packages/29/58/fc4b1e887fbb2b1a4d972c8eccd94782607b5dc706c3245b6b435cdb013f/semver-2.2.1.tar.gz#sha256=95d8c002e3d9584089f2f722c6c0b1c8a58518de39851d9ca588027e9dde2f98 (from https://pypi.org/simple/semver/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Collecting pkutils<2.0.0,>=1.0.0
    Using cached pkutils-1.2.0-py2.py3-none-any.whl (9.9 kB)
    Using cached pkutils-1.1.1-py2.py3-none-any.whl (7.3 kB)
    Using cached pkutils-1.1.0-py2.py3-none-any.whl (10 kB)
    Using cached pkutils-1.0.0-py2.py3-none-any.whl (9.3 kB)
  ERROR: Cannot install pkutils==1.0.0, pkutils==1.1.0, pkutils==1.1.1, pkutils==1.2.0 and pkutils==1.2.1 because these package versions have conflicting dependencies.
  
  The conflict is caused by:
      pkutils 1.2.1 depends on semver<2.7.3 and >=2.2.1
      pkutils 1.2.0 depends on semver<2.7.3 and >=2.2.1
      pkutils 1.1.1 depends on semver<2.7.3 and >=2.2.1
      pkutils 1.1.0 depends on semver<2.7.3 and >=2.2.1
      pkutils 1.0.0 depends on semver<2.7.3 and >=2.2.1
  
  To fix this you could try to:
  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict
  
  ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
  ----------------------------------------
WARNING: Discarding file:///Users/jaraco/draft/example. Command errored out with exit status 1: /usr/local/bin/python /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-standalone-pip-vi5we1oe/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-f1as9f7e/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=36.2.4' 'pkutils>=1.0.0,<2.0.0' Check the logs for full command output.
ERROR: Command errored out with exit status 1: /usr/local/bin/python /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-standalone-pip-vi5we1oe/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-f1as9f7e/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=36.2.4' 'pkutils>=1.0.0,<2.0.0' Check the logs for full command output.

Code of Conduct

@jaraco jaraco added type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Dec 21, 2021
@jaraco
Copy link
Member Author

jaraco commented Dec 21, 2021

Oh! It is possible to cause PEP 517 to be used by using the environment variable:

example $ $PIP_USE_PEP517=1 pip-run . -- -c pass
Processing /Users/jaraco/draft/example
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: UNKNOWN
  Building wheel for UNKNOWN (pyproject.toml) ... done
  Created wheel for UNKNOWN: filename=UNKNOWN-0.0.0-py3-none-any.whl size=964 sha256=29f941f9947fb12ba8fa55cccdc0ba7459e0cbdcc17e901e47e78ad37e57ec40
  Stored in directory: /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-ephem-wheel-cache-oenp6zr1/wheels/36/aa/a5/8ffe00af566c8d7bc73d81daf7002ed6057c01aa4b43fae9fc
Successfully built UNKNOWN
Installing collected packages: UNKNOWN
Successfully installed UNKNOWN-0.0.0

@pradyunsg pradyunsg added the C: build logic Stuff related to metadata generation / wheel generation label Dec 23, 2021
@junqfisica
Copy link
Contributor

@pradyunsg and @jaraco

I'm having a related problem to use pip with pyproject.toml. In my case I need to run:
pip install . --proxy ip:port

The problem happens because pip runs build-system via subprocess.

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

Therefore, any of the options passed to pip CLI are unknown by the subprocess at this point.

with open_spinner(f"Installing {kind}") as spinner:
call_subprocess(
args,
command_desc=f"pip subprocess to install {kind}",
spinner=spinner,
extra_environ=extra_environ,
)

I would suggest including some environment-related option to extra_environ:

extra_environ = {"_PIP_STANDALONE_CERT": where()}

The only problem though. It seems there is no clean way to access options at this point. I found that proxies could be accessed here via protected reference:
finder._link_collector.session.proxies.

I'm not sure what would be the best way to proceed here. Another possible solution is to use os.environ to set some environ-related option at the resolve passing options

requirement_set = resolver.resolve(
reqs, check_supported_wheels=not options.target_dir
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: build logic Stuff related to metadata generation / wheel generation S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants