Skip to content

fix: publish as pyautoreduceautoreduce on PyPI is not ours - #72

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/autoreduce-pypi-name-collision
Aug 24, 2026
Merged

fix: publish as pyautoreduceautoreduce on PyPI is not ours#72
Jammy2211 merged 1 commit into
mainfrom
feature/autoreduce-pypi-name-collision

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Closes #71.

The finding

#71 was filed as "published autoreduce 0.9 never got the Python 3.12 floor". That premise is disproved. autoreduce on PyPI is not a PyAutoLabs package — it is github.com/ayush9pandey/AutoReduce, "Python tools for automated model reduction of nonlinear dynamical systems", with a release history running 0.1.0 (2020-10-15) through 0.9 (2026-08-12).

Corroborating evidence that we have never published it:

  • git ls-remote --tags PyAutoLabs/PyAutoReduce returns nothing, and the build is setuptools-scm + dynamic = ["version"] — an untagged tree cannot produce a 0.9.
  • PyAutoHands has zero references to autoreduce: not in release.yml's matrix, not in pre_build.sh's WORKSPACE_SPECS.
  • This repo has no release workflow of its own.

So there is no floor gap, and the <=3.14.7 cap in #71 is a third party's. requires-python = ">=3.12" from d7bd916a was already correct.

The actual defect

We claimed a distribution name owned by someone else, and told users to install it:

pip install autoreduce            # ← a stranger's package
pip install "autoreduce[hst]"     # ← [hst] doesn't exist there; pip warns, installs anyway

Second-order: autoreduce/__init__.py resolved __version__ via importlib.metadata.version("autoreduce"), and package/provenance.py writes that into every reduction.json. On a machine with the foreign package installed, our provenance recorded its version as ours.

The change

Distribution becomes pyautoreduce (free on PyPI, matches the repo name and the org prefix). The import package stays autoreduce — no source renaming. target.py, psf/starred_epsf.py, scripts/reduce_cosmos_web_ring.py and docs/design/hst_acs_pipeline.md:253 were already writing pyautoreduce[starred], so this resolves existing drift rather than creating it.

File Change
pyproject.toml name, with the reason recorded in place so nobody tidies it back
autoreduce/__init__.py _version("pyautoreduce") — load-bearing, see below
README.md the three install lines
docs/design/hst_acs_pipeline.md:479 autoreduce[frames]pyautoreduce[frames]
autoreduce/psf/stpsf_model.py ImportError install hint
autoreduce/package/cosmic_rays.py ImportError install hint

Deliberately unchanged:

  • autoreduce/package/provenance.py — its tuple is fed to __import__(package).__version__. Those are import names, and the import package is unchanged; renaming that entry would break provenance.
  • .github/workflows/main.yml's package: autoreduce — Heart's lib-tests.yml uses it as the import package (pytest --cov ${{ inputs.package }}) and as a repo-mapping key, not as a distribution name.

Verification

Built and installed on a real 3.12 venv:

Name:            pyautoreduce
Requires-Python: >=3.12
top_level.txt:   autoreduce          # import package preserved

autoreduce.__version__  -> 0.0.post1
provenance record       -> {'python': '3.12.3', 'autoreduce': '0.0.post1', ...}
302 passed, 206 warnings in 12.59s

The __init__.py edit is load-bearing, not cosmetic — in the same venv, version("autoreduce") raises PackageNotFoundError, so leaving it would have silently degraded __version__ to the "0.0.dev0" fallback.

0.0.post1 is setuptools-scm's untagged fallback; the real version arrives with the tag, which is the follow-up's job.

Follow-up

Induction into the PyAutoHands release machinery and the family's date-based versioning is filed separately as PyAutoMind/draft/release/pyautoreduce/pyautoreduce_release_induction.md, blocked until this merges. Worth noting there: date versioning needs no packaging change — this repo's [tool.setuptools_scm] block is already byte-identical to PyAutoLens's, and the family's 2026.8.23.1 versions come from the annotated tag release.yml pushes before python -m build.

Companion docs PR in autoreduce_workspace follows behind this one (library-first merge gate).

One thing noticed but not fixed here, to keep the PR minimal: the built wheel's top_level.txt lists docs and scripts alongside autoreduce. That is pre-existing ([tool.setuptools.packages.find] excludes docs but not scripts, and neither exclusion is taking effect) and unrelated to this diff — worth its own hygiene task.


Generated by Claude Code

`autoreduce` on PyPI belongs to github.com/ayush9pandey/AutoReduce, an
unrelated and actively maintained project (0.1.0 in 2020 through 0.9 on
2026-08-12). We claimed that distribution name in pyproject.toml and our
README told users to `pip install autoreduce` — which installs a stranger's
package. The `[hst]`/`[psf]` extras do not exist there, so pip warns about
unknown extras and installs it anyway.

The distribution becomes `pyautoreduce` (free on PyPI, matches the repo name
and the org prefix). The IMPORT package stays `autoreduce`, so no source
renaming: `target.py`, `psf/starred_epsf.py`, `scripts/reduce_cosmos_web_ring.py`
and `docs/design/hst_acs_pipeline.md:253` were already writing
`pyautoreduce[starred]`, so this resolves that drift rather than creating it.

- pyproject.toml: name, with the reason recorded in place
- autoreduce/__init__.py: resolve __version__ against the distribution.
  Left alone, the rename degrades __version__ to the PackageNotFoundError
  fallback "0.0.dev0" — or picks up the foreign project's version when it
  happens to be installed, and package/provenance.py writes that into every
  reduction.json as ours.
- README.md, docs/design/hst_acs_pipeline.md:479, and the two ImportError
  install hints (psf/stpsf_model.py, package/cosmic_rays.py)

Deliberately unchanged: package/provenance.py's tuple (fed to
`__import__(package).__version__` — import names, and the import package is
unchanged) and .github/workflows/main.yml's `package: autoreduce` input
(Heart's lib-tests.yml uses it as the import package for `pytest --cov` and
as a repo-mapping key, not as a distribution name).

Verified on a 3.12 venv: wheel METADATA is `Name: pyautoreduce` /
`Requires-Python: >=3.12` with `top_level.txt` still `autoreduce`;
`autoreduce.__version__` and the provenance record resolve; 302 tests pass.

Closes #71

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V19RfJbExKP4hsT5c6LttV
@Jammy2211
Jammy2211 merged commit 94a27f3 into main Aug 24, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/autoreduce-pypi-name-collision branch August 25, 2026 18:18
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

Successfully merging this pull request may close these issues.

fix: PyAutoReduce claims a PyPI name it does not own (autoreduce)

2 participants