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

AttributeError: 'Call' object has no attribute 's' #5221

Closed
YDBD opened this issue Aug 5, 2022 · 3 comments
Closed

AttributeError: 'Call' object has no attribute 's' #5221

YDBD opened this issue Aug 5, 2022 · 3 comments
Labels
Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided.

Comments

@YDBD
Copy link

YDBD commented Aug 5, 2022

Issue description

Impossible to generate the lock file.

Expected result

Generation of lock file.

Actual result

Locking [dev-packages] dependencies...
Building requirements...
✔ Success!
Locking [packages] dependencies...
✘ Locking Failed!

Traceback (most recent call last):
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 854, in <module>
    main()
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 840, in main
    _main(
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 820, in _main
    resolve_packages(
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 769, in resolve_packages
    results, resolver = resolve(
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 749, in resolve
    return resolve_deps(
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 1080, in resolve_deps
    results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 871, in actually_resolve_deps
    resolver = Resolver.create(
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 405, in create
    constraints, skipped, index_lookup, markers_lookup = cls.get_metadata(
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 206, in get_metadata
    constraint_update, lockfile_update = cls.get_deps_from_req(
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 286, in get_deps_from_req
    req_list, lockfile = get_vcs_deps(reqs=[req])
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/utils/dependencies.py", line 103, in get_vcs_deps
    with temp_path(), locked_repository(requirement) as repo:
  File "/usr/lib64/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/utils/dependencies.py", line 315, in locked_repository
    with requirement.req.locked_vcs_repo(src_dir=src_dir) as repo:
  File "/usr/lib64/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 2211, in locked_vcs_repo
    self._parsed_line.vcsrepo = vcsrepo
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 903, in vcsrepo
    setupinfo = SetupInfo.create(
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1628, in create
    created.get_initial_info()
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1440, in get_initial_info
    parsed.update(self.parse_setup_py())
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 1165, in parse_setup_py
    parsed = ast_parse_setup_py(self.setup_py.as_posix())
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 885, in ast_parse_setup_py
    return SetupReader.read_setup_py(Path(path), raising)
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 204, in read_setup_py
    "install_requires": caller(cls._find_install_requires, setup_call, body),
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 196, in caller
    return func(*args, **kwargs)
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 359, in _find_install_requires
    return [el.s for el in value.elts]
  File "/home/user/.local/lib/python3.8/site-packages/pipenv/vendor/requirementslib/models/setup_info.py", line 359, in <listcomp>
    return [el.s for el in value.elts]
AttributeError: 'Call' object has no attribute 's'

Steps to replicate

Behind a proxy.

pipenv lock --dev

Content of Pipfile :

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
ansible = "*"

Pipenv version: '2022.7.24'

Pipenv location: '/home/user/.local/lib/python3.8/site-packages/pipenv'

Python location: '/usr/bin/python3.8'

Python installations found:

  • 3.8.12: /usr/bin/python3.8
  • 3.6.8: /usr/bin/python3
  • 3.6.8: /usr/bin/python3.6
  • 3.6.8: /usr/bin/python3.6m

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.8.12',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '4.18.0-372.16.1.el8_6.x86_64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Tue Jun 28 03:02:21 EDT 2022',
 'python_full_version': '3.8.12',
 'python_version': '3.8',
 'sys_platform': 'linux'}
@matteius
Copy link
Member

matteius commented Aug 5, 2022

@YDBD What is your local version of pip? pip --version? Can you install the new pipenv that was just released 2022.8.5 -- I am curious if that works better for you or if you continue having this issue.

If you continue having this issue, I suspect it could be something unconventional in one of the setup.py that is being included as a dependency to your Pipfile.lock

@matteius matteius added the Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided. label Aug 6, 2022
@matteius
Copy link
Member

@YDBD I believe your issue is related to use of string interpolation in the install_requires of the setup.py. Its not allowed by the parser because that is arbitrary callable code which we cannot execute safely. I think I can patch requirementslib to provide a better error in this case, there is another ticket about that: sarugaku/requirementslib#328

@matteius matteius closed this as completed Sep 3, 2022
@matteius
Copy link
Member

matteius commented Sep 3, 2022

Closed in favor of: #5167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting Update ⏳ This issue requires more information before assistance can be provided.
Projects
None yet
Development

No branches or pull requests

2 participants