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:
@@ -10,6 +10,27 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
|
|||||||
|
|
||||||
- Nothing yet.
|
- Nothing yet.
|
||||||
|
|
||||||
|
## [0.13.0] - 2026-11-19
|
||||||
|
|
||||||
|
### Changed in 0.13.0
|
||||||
|
|
||||||
|
- PyPI distribution renamed to **`daedalus-tools`** (from `daedalus`):
|
||||||
|
PyPI policy-blocks the plain name - the upload of 0.12.1 was rejected
|
||||||
|
with "The name 'daedalus' isn't allowed" (near the existing
|
||||||
|
`daedalus-cli` and `pydaedalus` projects). The `daedalus` command, the
|
||||||
|
`daedalus` import package, the registry, and the repository are
|
||||||
|
unchanged; only the value of `[project] name` (and hello's installed
|
||||||
|
version lookup) moved. `pipx install daedalus-tools` puts the same
|
||||||
|
`daedalus` CLI on PATH (SPEC item 9.1).
|
||||||
|
|
||||||
|
### Fixed in 0.13.0
|
||||||
|
|
||||||
|
- `publish`'s artifact names now use the PEP 625 normalized name
|
||||||
|
(`daedalus-tools` -> `daedalus_tools-0.13.0.tar.gz`), matching what
|
||||||
|
setuptools actually writes to `dist/`; with a hyphenated project name
|
||||||
|
the constructed names would have missed the files. PyPI's version
|
||||||
|
probe keeps using the project name as written (publish spec 3.2).
|
||||||
|
|
||||||
## [0.12.1] - 2026-11-19
|
## [0.12.1] - 2026-11-19
|
||||||
|
|
||||||
### Fixed in 0.12.1
|
### Fixed in 0.12.1
|
||||||
|
|||||||
+5
-7
@@ -17,23 +17,21 @@ Back to the [script list](./README.md#available-scripts). Repository rules:
|
|||||||
|
|
||||||
### With pipx (recommended)
|
### With pipx (recommended)
|
||||||
|
|
||||||
[pipx](https://pipx.pypa.io/) installs daedalus into its own environment
|
[pipx](https://pipx.pypa.io/) installs the `daedalus-tools` distribution
|
||||||
and puts the `daedalus` command on `PATH`.
|
(from PyPI or Git) into its own environment and puts the `daedalus`
|
||||||
|
command on `PATH` — the project name and the command differ on purpose
|
||||||
|
(plain `daedalus` is policy-blocked on PyPI; see SPEC item 9.1).
|
||||||
|
|
||||||
Linux (Debian 12): paste once; open a new shell if `pipx` was just
|
Linux (Debian 12): paste once; open a new shell if `pipx` was just
|
||||||
installed. Run the same block again to refresh from Git (`main`); do **not**
|
installed. Run the same block again to refresh from Git (`main`); do **not**
|
||||||
use `pipx upgrade daedalus` for Git installs — it does not pull the repo.
|
use `pipx upgrade daedalus-tools` for Git installs — it does not pull the repo.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
daedalus_pipx_install() {
|
daedalus_pipx_install() {
|
||||||
r="${1:-git+ssh://git@example.com/your-org/daedalus.git@main}"
|
r="${1:-git+ssh://git@example.com/your-org/daedalus.git@main}"
|
||||||
command -v pipx >/dev/null || sudo apt install -y pipx
|
command -v pipx >/dev/null || sudo apt install -y pipx
|
||||||
pipx ensurepath 2>/dev/null || pipx ensurepath --force
|
pipx ensurepath 2>/dev/null || pipx ensurepath --force
|
||||||
if pipx list --short 2>/dev/null | grep -qE '^daedalus '; then
|
|
||||||
pipx install --force "$r"
|
pipx install --force "$r"
|
||||||
else
|
|
||||||
pipx install "$r"
|
|
||||||
fi
|
|
||||||
daedalus --version
|
daedalus --version
|
||||||
}; daedalus_pipx_install
|
}; daedalus_pipx_install
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -616,8 +616,11 @@ autotest results
|
|||||||
|
|
||||||
## 9. Packaging
|
## 9. Packaging
|
||||||
|
|
||||||
- **9.1** `pyproject.toml` builds one wheel (setuptools 68 or newer) named
|
- **9.1** The PyPI distribution is named `daedalus-tools` (plain
|
||||||
`daedalus` that holds the CLI and every script. It requires Python
|
`daedalus` is policy-blocked on PyPI - near the existing
|
||||||
|
`daedalus-cli`/`pydaedalus` projects; command and import names
|
||||||
|
stay `daedalus`). `pyproject.toml` builds one wheel (setuptools 68
|
||||||
|
or newer) that holds the CLI and every script. It requires Python
|
||||||
3.11 or newer.
|
3.11 or newer.
|
||||||
|
|
||||||
| Command | Use |
|
| Command | Use |
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ def test_path_with_extra_words_is_a_usage_error(fake_registry, plain, capsys):
|
|||||||
assert "usage: daedalus --path <name>" in capsys.readouterr().err
|
assert "usage: daedalus --path <name>" in capsys.readouterr().err
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("installed, expected", [(True, "daedalus 1.2.3"), (False, "daedalus 0.12.1")])
|
@pytest.mark.parametrize("installed, expected", [(True, "daedalus 1.2.3"), (False, "daedalus 0.13.0")])
|
||||||
def test_version(monkeypatch, capsys, installed, expected):
|
def test_version(monkeypatch, capsys, installed, expected):
|
||||||
"""--version uses metadata or pyproject.toml in a checkout."""
|
"""--version uses metadata or pyproject.toml in a checkout."""
|
||||||
def fake_version(_name):
|
def fake_version(_name):
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@ requires = ["setuptools>=68"]
|
|||||||
build-backend = "setuptools.build_meta"
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "daedalus"
|
name = "daedalus-tools"
|
||||||
version = "0.12.1"
|
version = "0.13.0"
|
||||||
description = "Template for daedalus: loose scripts in one repo, run with: daedalus <name> [args...]"
|
description = "Template for daedalus: loose scripts in one repo, run with: daedalus <name> [args...]"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ UNKNOWN = "unknown"
|
|||||||
def app_version() -> str:
|
def app_version() -> str:
|
||||||
"""Installed daedalus version, else the checkout pyproject, else 'unknown'."""
|
"""Installed daedalus version, else the checkout pyproject, else 'unknown'."""
|
||||||
try:
|
try:
|
||||||
return importlib.metadata.version("daedalus") # plain and editable installs
|
return importlib.metadata.version("daedalus-tools") # plain and editable installs
|
||||||
except importlib.metadata.PackageNotFoundError:
|
except importlib.metadata.PackageNotFoundError:
|
||||||
pass
|
pass
|
||||||
# A checkout that is not installed: python/src/hello/hello.py -> pyproject.toml
|
# A checkout that is not installed: python/src/hello/hello.py -> pyproject.toml
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ from __future__ import annotations
|
|||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
import pathlib
|
import pathlib
|
||||||
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tomllib
|
import tomllib
|
||||||
@@ -81,11 +82,15 @@ def pypi_status(url: str) -> int | None:
|
|||||||
def artifact_names(name: str, version: str) -> tuple[str, str]:
|
def artifact_names(name: str, version: str) -> tuple[str, str]:
|
||||||
"""The version's sdist and wheel file names (items 3.4-3.7).
|
"""The version's sdist and wheel file names (items 3.4-3.7).
|
||||||
|
|
||||||
|
File names use the PEP 625 normalized name (lowercase, runs
|
||||||
|
of `-._` collapsed to one underscore - what setuptools
|
||||||
|
writes to dist/); the PyPI JSON probe uses `name` as written.
|
||||||
The wheel is a pure-Python wheel (SPEC item 9.1), so its name
|
The wheel is a pure-Python wheel (SPEC item 9.1), so its name
|
||||||
follows ``<name>-<version>-py3-none-any.whl``.
|
follows ``<normalized>-<version>-py3-none-any.whl``.
|
||||||
"""
|
"""
|
||||||
return (f"{name}-{version}.tar.gz",
|
safe = re.sub(r"[-_.]+", "_", name).lower()
|
||||||
f"{name}-{version}-py3-none-any.whl")
|
return (f"{safe}-{version}.tar.gz",
|
||||||
|
f"{safe}-{version}-py3-none-any.whl")
|
||||||
|
|
||||||
|
|
||||||
def cmd_publish(args: argparse.Namespace, run_cmd=None,
|
def cmd_publish(args: argparse.Namespace, run_cmd=None,
|
||||||
|
|||||||
@@ -33,7 +33,10 @@ are cited as `publish spec item N.M`.
|
|||||||
exit 2.
|
exit 2.
|
||||||
- **3.2** Version: read from `[project] version` in that
|
- **3.2** Version: read from `[project] version` in that
|
||||||
`pyproject.toml` (tomllib); project name for PyPI checks from
|
`pyproject.toml` (tomllib); project name for PyPI checks from
|
||||||
`[project] name`.
|
`[project] name`. Artifact *file names* use the PEP 625
|
||||||
|
normalized name (lowercase, runs of `-._` collapsed to one
|
||||||
|
`_`, e.g. `daedalus-tools` -> `daedalus_tools-<version>.tar.gz`);
|
||||||
|
the PyPI JSON probe uses the project name as written.
|
||||||
- **3.3** Guards, in order, each stopping before anything is
|
- **3.3** Guards, in order, each stopping before anything is
|
||||||
built:
|
built:
|
||||||
- **3.3.1** Dirty working tree (`git status --porcelain` in the
|
- **3.3.1** Dirty working tree (`git status --porcelain` in the
|
||||||
@@ -111,4 +114,6 @@ are cited as `publish spec item N.M`.
|
|||||||
- **7.2** Repository rules: SPEC items 6.6 (tests), 9.8 (version
|
- **7.2** Repository rules: SPEC items 6.6 (tests), 9.8 (version
|
||||||
bump).
|
bump).
|
||||||
- **7.3** History: `CHANGELOG.md` entries 0.12.0 (script),
|
- **7.3** History: `CHANGELOG.md` entries 0.12.0 (script),
|
||||||
0.12.1 (tag-guard fix, found by the first live run).
|
0.12.1 (tag-guard fix, found by the first live run), 0.13.0
|
||||||
|
(PEP 625 artifact names; distribution renamed daedalus-tools
|
||||||
|
after PyPI refused the name daedalus).
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ def test_app_version_falls_back_to_pyproject(monkeypatch):
|
|||||||
raise hello.importlib.metadata.PackageNotFoundError(_name)
|
raise hello.importlib.metadata.PackageNotFoundError(_name)
|
||||||
|
|
||||||
monkeypatch.setattr(hello.importlib.metadata, "version", not_found)
|
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):
|
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."""
|
"""Without --upload: chained build, twine check, exit 0."""
|
||||||
name, version = publish.read_project(
|
name, version = publish.read_project(
|
||||||
publish.find_repo_root() / "pyproject.toml")
|
publish.find_repo_root() / "pyproject.toml")
|
||||||
|
sdist, wheel = publish.artifact_names(name, version)
|
||||||
calls = []
|
calls = []
|
||||||
assert publish.cmd_publish(publish.parse_args([]),
|
assert publish.cmd_publish(publish.parse_args([]),
|
||||||
clean_runner(version, calls),
|
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 len(build) == 1 # chained, not two runs
|
||||||
assert not any(cmd[3:4] == ["upload"] for cmd, _ in calls)
|
assert not any(cmd[3:4] == ["upload"] for cmd, _ in calls)
|
||||||
out = capsys.readouterr().out
|
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
|
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."""
|
"""--upload passes only this version's sdist and wheel."""
|
||||||
name, version = publish.read_project(
|
name, version = publish.read_project(
|
||||||
publish.find_repo_root() / "pyproject.toml")
|
publish.find_repo_root() / "pyproject.toml")
|
||||||
|
sdist, wheel = publish.artifact_names(name, version)
|
||||||
calls = []
|
calls = []
|
||||||
assert publish.cmd_publish(publish.parse_args(["--upload"]),
|
assert publish.cmd_publish(publish.parse_args(["--upload"]),
|
||||||
clean_runner(version, calls),
|
clean_runner(version, calls),
|
||||||
lambda _u: 404) == 0
|
lambda _u: 404) == 0
|
||||||
upload = [cmd for cmd, _ in calls if cmd[3:4] == ["upload"]][0]
|
upload = [cmd for cmd, _ in calls if cmd[3:4] == ["upload"]][0]
|
||||||
assert upload[-2] == f"dist/{name}-{version}.tar.gz"
|
assert upload[-2] == f"dist/{sdist}"
|
||||||
assert upload[-1].startswith(f"dist/{name}-{version}-")
|
assert upload[-1] == f"dist/{wheel}"
|
||||||
assert upload[-1].endswith(".whl")
|
|
||||||
|
|
||||||
|
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():
|
def test_build_failure_is_7():
|
||||||
|
|||||||
Reference in New Issue
Block a user