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

check: Error message No METADATA in archive when it's there #1100

Closed
1 task done
jaraco opened this issue May 2, 2024 · 3 comments · Fixed by #1106
Closed
1 task done

check: Error message No METADATA in archive when it's there #1100

jaraco opened this issue May 2, 2024 · 3 comments · Fixed by #1106
Labels

Comments

@jaraco
Copy link
Member

jaraco commented May 2, 2024

Is there an existing issue for this?

  • I have searched the existing issues (open and closed), and could not find an existing issue

What keywords did you use to search existing issues?

No Metadata in archive

What operating system are you using?

macOS

If you selected 'Other', describe your Operating System here

No response

What version of Python are you running?

3.12.3

How did you install twine? Did you use your operating system's package manager or pip or something else?

pipx install twine

What version of twine do you have installed (include the complete output)

5.0.0

Which package repository are you using?

pypi.org

Please describe the issue that you are experiencing

When running twine check on the attached wheel, it reports No METADATA in archive, even though it does have a METADATA file. Probably the issue is that the METADATA file is missing the requisite Metadata-Version field.

coherent_build-0.0.1.dev0-py3-none-any.whl.zip

Better would be to report an error message that indicates the true cause of the problem.

Please list the steps required to reproduce this behaviour

Build an invalid wheel without minimal metadata. Run twine check on it.

Anything else you'd like to mention?

No response

@jaraco jaraco added the bug label May 2, 2024
@jaraco
Copy link
Member Author

jaraco commented May 2, 2024

pkginfo has the same issue.

@sigmavirus24
Copy link
Member

This needs to be fixed in pkginfo. I don't believe we can fix it ourselves

@jaraco
Copy link
Member Author

jaraco commented May 2, 2024

The logic also exists in twine:

twine/twine/wheel.py

Lines 76 to 85 in 5d17a43

try:
for path in self.find_candidate_metadata_files(names):
candidate = "/".join(path)
data = read_file(candidate)
if b"Metadata-Version" in data:
return data
finally:
archive.close()
raise exceptions.InvalidDistribution("No METADATA in archive: %s" % fqn)

sigmavirus24 added a commit that referenced this issue May 10, 2024
When showing users an error, explain that we couldn't find a file with
Metadata-Version in it and list the names of files we searched in the
archive.

Closes #1100
sigmavirus24 added a commit that referenced this issue May 11, 2024
When showing users an error, explain that we couldn't find a file with
Metadata-Version in it and list the names of files we searched in the
archive.

Closes #1100
sigmavirus24 added a commit that referenced this issue May 11, 2024
When showing users an error, explain that we couldn't find a file with
Metadata-Version in it and list the names of files we searched in the
archive.

Closes #1100
sigmavirus24 added a commit that referenced this issue May 11, 2024
When showing users an error, explain that we couldn't find a file with
Metadata-Version in it and list the names of files we searched in the
archive.

Closes #1100
sigmavirus24 added a commit that referenced this issue May 12, 2024
When showing users an error, explain that we couldn't find a file with
Metadata-Version in it and list the names of files we searched in the
archive.

Closes #1100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants