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

Installing local packages with a pyproject.toml fails #6824

Closed
bpeterman opened this issue Aug 2, 2019 · 6 comments
Closed

Installing local packages with a pyproject.toml fails #6824

bpeterman opened this issue Aug 2, 2019 · 6 comments
Labels
auto-locked Outdated issues that have been locked by automation kind: crash For situations where pip crashes

Comments

@bpeterman
Copy link

Environment

  • pip version: >19.2
  • Python version: 3.7.3
  • OS: Mac 10.14

Description
When installing a package locally with a pyproject.toml a typing exception is thrown.

Expected behavior
Package is installed successfully.

How to Reproduce
Install the sampleproject(I've included the pyproject.toml file) locally.

Output

pip install sampleproject/
Processing ./sampleproject
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/bpeterman/workspace/test-project/venv/bin/python3.7 /Users/bpeterman/workspace/test-project/venv/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/hz/jztjj7k10519w6hpxdvf5wg03y7z_6/T/pip-build-env-yx_p_u8q/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
       cwd: None
  Complete output (24 lines):
  Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 193, in _run_module_as_main
      "__main__", mod_spec)
    File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
      exec(code, run_globals)
    File "/Users/bpeterman/workspace/test-project/venv/lib/python3.7/site-packages/pip/__main__.py", line 16, in <module>
      from pip._internal import main as _main  # isort:skip # noqa
    File "/Users/bpeterman/workspace/test-project/venv/lib/python3.7/site-packages/pip/_internal/__init__.py", line 40, in <module>
      from pip._internal.cli.autocompletion import autocomplete
    File "/Users/bpeterman/workspace/test-project/venv/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
      from pip._internal.cli.main_parser import create_main_parser
    File "/Users/bpeterman/workspace/test-project/venv/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
      from pip._internal.cli import cmdoptions
    File "/Users/bpeterman/workspace/test-project/venv/lib/python3.7/site-packages/pip/_internal/cli/cmdoptions.py", line 24, in <module>
      from pip._internal.models.search_scope import SearchScope
    File "/Users/bpeterman/workspace/test-project/venv/lib/python3.7/site-packages/pip/_internal/models/search_scope.py", line 11, in <module>
      from pip._internal.utils.misc import normalize_path, redact_password_from_url
    File "/Users/bpeterman/workspace/test-project/venv/lib/python3.7/site-packages/pip/_internal/utils/misc.py", line 58, in <module>
      from typing import cast, Tuple
    File "/Users/bpeterman/workspace/test-project/venv/lib/python3.7/site-packages/typing.py", line 1357, in <module>
      class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
    File "/Users/bpeterman/workspace/test-project/venv/lib/python3.7/site-packages/typing.py", line 1005, in __new__
      self._abc_registry = extra._abc_registry
  AttributeError: type object 'Callable' has no attribute '_abc_registry'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/bpeterman/workspace/test-project/venv/bin/python3.7 /Users/bpeterman/workspace/test-project/venv/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/hz/jztjj7k10519w6hpxdvf5wg03y7z_6/T/pip-build-env-yx_p_u8q/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.
WARNING: You are using pip version 19.2, however version 19.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Aug 2, 2019
@bpeterman
Copy link
Author

I'm actually thinking that this could be related to: #6375

Wondering if this should be closed.

@pradyunsg
Copy link
Member

Thanks for filing this issue!

We've stopped importing typing on master, to avoid issues like this.

This is fixed in master and you can expect it to be fixed in the next release of pip. 🙃

@bpeterman
Copy link
Author

bpeterman commented Aug 2, 2019

I'm also curious if this is supposed to be supported? We use pyproject.toml to specify configs for certain packages such as black.

@uranusjr
Copy link
Member

uranusjr commented Aug 2, 2019

I believe this is supposed to work; a pyproject.toml file in this case (missing build-system specification) is simply ignored.

@pradyunsg
Copy link
Member

pradyunsg commented Aug 3, 2019

a pyproject.toml file in this case (missing build-system specification) is simply ignored.

Nope -- we opt-in packages with pyproject.toml to build isolation, and use the PEP 517 interface to build their package.

Functionally, it doesn't matter to most packages, unless they're doing cross-compilation or linking between two C extensions in different packages.

@pradyunsg
Copy link
Member

Closing since this is fixed in master. Expect this to be fixed in the next release.

That said, I'm not sure why you're seeing a failure with the typing import, so you might want to investigate the same.

@pradyunsg pradyunsg mentioned this issue Aug 4, 2019
@pradyunsg pradyunsg added kind: crash For situations where pip crashes and removed S: needs triage Issues/PRs that need to be triaged labels Aug 4, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Sep 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 3, 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 kind: crash For situations where pip crashes
Projects
None yet
Development

No branches or pull requests

3 participants