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

Error with upload URL on hatch publish #562

Open
salotz opened this issue Oct 20, 2022 · 10 comments
Open

Error with upload URL on hatch publish #562

salotz opened this issue Oct 20, 2022 · 10 comments

Comments

@salotz
Copy link

salotz commented Oct 20, 2022

I keep getting this error when trying to upload to PyPI:

$ hatch publish
dist/sln-0.0.tar.gz ... failed
Client error '400 Invalid value for project_urls. Error: Use an URL.' for url 'https://upload.pypi.org/legacy/'
For more information check: https://httpstatuses.com/400

Any ideas?

@ofek
Copy link
Collaborator

ofek commented Oct 20, 2022

@salotz
Copy link
Author

salotz commented Oct 20, 2022

[project.urls]
Documentation = "https://github.com/salotz/python-sln"
Issues = "https://github.com/salotz/python-sln/issues"
Source = "https://github.com/salotz/python-sln"

@ofek
Copy link
Collaborator

ofek commented Oct 20, 2022

Works for me. Builds with Hatch too?

@salotz
Copy link
Author

salotz commented Oct 20, 2022

Yep I used hatch build. I'm confused by what the error means though. Its saying that my project URLs give 400s. Does that mean hatch is checking that the URLs work? And if so why is it saying that the URL that failed is the pypi upload URL?

@ofek
Copy link
Collaborator

ofek commented Oct 20, 2022

PyPI is saying that the payload key Hatch sends based on the contents of the PKG-INFO file in the sln-0.0.tar.gz is invalid. Can you show that?

Logic: https://github.com/pypa/hatch/blob/master/src/hatch/index/publish.py

@ofek
Copy link
Collaborator

ofek commented Oct 23, 2022

bump 🙂

@salotz
Copy link
Author

salotz commented Oct 25, 2022

Here it is:

Metadata-Version: 2.1
Name: sln
Version: 0.3
Summary: Scopes List Notation (SLN) Parser
Project-URL: Documentation, https://github.com/salotz/python-sln
Project-URL: Issues, https://github.com/salotz/python-sln/issues
Project-URL: Source, https://github.com/salotz/python-sln
Author: Leonard Ritter
Author-email: Samuel Lotz <salotz@salotz.info>
Maintainer-email: Samuel Lotz <salotz@salotz.info>
License-File: LICENSE.txt
Keywords: parsing,scopes,scopes-list-notation,sln
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.7
Description-Content-Type: text/markdown
[...]

full pyproject.toml:

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "sln"
description = 'Scopes List Notation (SLN) Parser'
readme = "README.md"
requires-python = ">=3.7"
license = "MIT"
keywords = [
    'scopes',
    'parsing',
    'sln',
    'scopes-list-notation'
]
authors = [
  { name = "Samuel Lotz", email = "salotz@salotz.info" },
  { name = "Leonard Ritter" },
]
maintainers = [
  { name = "Samuel Lotz", email = "salotz@salotz.info" },
]
classifiers = [
  "Programming Language :: Python",
  "Programming Language :: Python :: 3.7",
  "Programming Language :: Python :: 3.8",
  "Programming Language :: Python :: 3.9",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: Implementation :: CPython",
  "Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = []
dynamic = ["version"]

[project.scripts]
sln-to-json = "sln.json:cli"

[project.urls]
Documentation = "https://github.com/salotz/python-sln"
Issues = "https://github.com/salotz/python-sln/issues"
Source = "https://github.com/salotz/python-sln"

[tool.hatch.version]
path = "src/sln/__about__.py"

[tool.hatch.build.targets.sdist]
exclude = [
  "*~",
]

[tool.hatch.envs.default]
dependencies = [
  "pytest",
  "pytest-cov",
  "ipython",
]

python = "3.9"

[tool.hatch.envs.default.scripts]
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=src/sln --cov=tests {args}"
no-cov = "cov --no-cov {args}"

[[tool.hatch.envs.test.matrix]]
python = ["37", "38", "39", "310", "311"]

[tool.coverage.run]
branch = true
parallel = true
omit = [
  "src/sln/__about__.py",
]

[tool.coverage.report]
exclude_lines = [
  "no cov",
  "if __name__ == .__main__.:",
  "if TYPE_CHECKING:",
]

@ofek
Copy link
Collaborator

ofek commented Oct 26, 2022

Works for me, hmm 🤔

@salotz
Copy link
Author

salotz commented Oct 26, 2022

Anything else to check? I haven't touched my config.toml file

@ofek
Copy link
Collaborator

ofek commented Nov 26, 2022

Still affected?

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

No branches or pull requests

2 participants