feat: PyPI distribution renamed daedalus-tools; PEP 625 artifact names (v0.13.0)
PyPI policy-blocks the plain name: the 0.12.1 upload was rejected with "The name 'daedalus' isn't allowed" (near the existing daedalus-cli and pydaedalus projects). The distribution is now daedalus-tools; command, imports, registry, and the repository name stay daedalus. hello's installed-version lookup follows. publish now derives artifact file names from the PEP 625 normalized name (daedalus_tools-<version>.tar.gz) - with a hyphenated project name the previously constructed names would have missed what setuptools writes to dist/ (publish spec 3.2, new regression test). Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -34,7 +34,7 @@ def test_app_version_falls_back_to_pyproject(monkeypatch):
|
||||
raise hello.importlib.metadata.PackageNotFoundError(_name)
|
||||
|
||||
monkeypatch.setattr(hello.importlib.metadata, "version", not_found)
|
||||
assert hello.app_version() == "0.12.1"
|
||||
assert hello.app_version() == "0.13.0"
|
||||
|
||||
|
||||
def test_help_exits_zero(capsys):
|
||||
|
||||
@@ -166,6 +166,7 @@ def test_check_only_flow_builds_and_stops(tmp_path, capsys):
|
||||
"""Without --upload: chained build, twine check, exit 0."""
|
||||
name, version = publish.read_project(
|
||||
publish.find_repo_root() / "pyproject.toml")
|
||||
sdist, wheel = publish.artifact_names(name, version)
|
||||
calls = []
|
||||
assert publish.cmd_publish(publish.parse_args([]),
|
||||
clean_runner(version, calls),
|
||||
@@ -175,7 +176,7 @@ def test_check_only_flow_builds_and_stops(tmp_path, capsys):
|
||||
assert len(build) == 1 # chained, not two runs
|
||||
assert not any(cmd[3:4] == ["upload"] for cmd, _ in calls)
|
||||
out = capsys.readouterr().out
|
||||
assert f"{name}-{version}.tar.gz" in out
|
||||
assert f"{sdist}" in out
|
||||
assert "--upload" in out # the next-step hint
|
||||
|
||||
|
||||
@@ -183,14 +184,23 @@ def test_upload_sends_exactly_this_version():
|
||||
"""--upload passes only this version's sdist and wheel."""
|
||||
name, version = publish.read_project(
|
||||
publish.find_repo_root() / "pyproject.toml")
|
||||
sdist, wheel = publish.artifact_names(name, version)
|
||||
calls = []
|
||||
assert publish.cmd_publish(publish.parse_args(["--upload"]),
|
||||
clean_runner(version, calls),
|
||||
lambda _u: 404) == 0
|
||||
upload = [cmd for cmd, _ in calls if cmd[3:4] == ["upload"]][0]
|
||||
assert upload[-2] == f"dist/{name}-{version}.tar.gz"
|
||||
assert upload[-1].startswith(f"dist/{name}-{version}-")
|
||||
assert upload[-1].endswith(".whl")
|
||||
assert upload[-2] == f"dist/{sdist}"
|
||||
assert upload[-1] == f"dist/{wheel}"
|
||||
|
||||
|
||||
def test_artifact_names_normalize_pep625():
|
||||
"""Filenames use the normalized name, not the project name."""
|
||||
sdist, wheel = publish.artifact_names("daedalus-tools", "0.13.0")
|
||||
assert sdist == "daedalus_tools-0.13.0.tar.gz"
|
||||
assert wheel == "daedalus_tools-0.13.0-py3-none-any.whl"
|
||||
assert publish.artifact_names("daedalus", "1.0") == \
|
||||
("daedalus-1.0.tar.gz", "daedalus-1.0-py3-none-any.whl")
|
||||
|
||||
|
||||
def test_build_failure_is_7():
|
||||
|
||||
Reference in New Issue
Block a user