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

twine check fails to prevent Invalid value for requires_dist. Error: Can't have direct dependency #726

Closed
ssbarnea opened this issue Jan 7, 2021 · 4 comments

Comments

@ssbarnea
Copy link

ssbarnea commented Jan 7, 2021

It seams that running twine check does not prevent upload errors like below:

HTTPError: 400 Bad Request from https://test.pypi.org/legacy/
Invalid value for requires_dist. Error: Can't have direct dependency: "ansible-core @ git+https://github.com/ansible/ansible.git ; extra == 'devel'"

This was caused by a package using the pep517 and a special extra that was used to install from git like below:

# setup.cfg
[options.extras_require]
devel =
  ansible-core @ git+https://github.com/ansible/ansible.git  # GPLv3+

This worked well with pip and with tox and passed the packaging testing, but failed when the tagged release was uploading.

This seams related to pypa/pip#6301 but it is not clear from it who is really to be blame.

Because this currently fails it would be very useful to improve the check feature in twine to detect this issue before we make a release.

ssbarnea added a commit to ansible/ansible-lint that referenced this issue Jan 7, 2021
Uploading packages that use extras pointing to git is not currently
possible for pypi, so we use a different approach to test devel
branch of Ansible.

Related: pypa/twine#726
ssbarnea added a commit to ansible/ansible-lint that referenced this issue Jan 7, 2021
Uploading packages that use extras pointing to git is not currently
possible for pypi, so we use a different approach to test devel
branch of Ansible.

Related: pypa/twine#726
@di
Copy link
Member

di commented Jan 7, 2021

Duplicate of #430 I think.

@sigmavirus24
Copy link
Member

@di on the nose

@abitrolly
Copy link

I've got the same error. Does that mean PyPI doesn't support URLs in dependencies at all? I could not find anything in documentation. https://pypi.org/help/

@abitrolly
Copy link

Found the reference in PEP-0440.

Public index servers SHOULD NOT allow the use of direct references in uploaded distributions. Direct references are intended as a tool for software integrators rather than publishers.

@pypa pypa locked as resolved and limited conversation to collaborators Apr 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants