Skip to content

Guard unpublished package versions - #335

Open
elprans wants to merge 1 commit into
mainfrom
elprans/guard-new-packages-from-pypi
Open

Guard unpublished package versions#335
elprans wants to merge 1 commit into
mainfrom
elprans/guard-new-packages-from-pypi

Conversation

@elprans

@elprans elprans commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Treat 0.0.0 as the sentinel for packages that have not been published to
PyPI yet (aka new packages). Skip sentinel packages during publishing
and require newly added packages to use it so merging package code
cannot publish to PyPI unintentionally.

Treat 0.0.0 as the sentinel for packages that have not been published to
PyPI yet (aka new packages).  Skip sentinel packages during publishing
and require newly added packages to use it so merging package code
cannot publish to PyPI unintentionally.
changes = tmp_path / "changes"
fragment_dir = changes / "pkg"
fragment_dir.mkdir(parents=True)
(fragment_dir / "initial.feature.md").write_text("Add package.\n", encoding="utf-8")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean that the mechanism to get your new package to be picked up and released at 0.1.0 is to add a news fragment? If so, we want to avoid adding news fragments until we're ready for the first release of the package, is that right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you're required to add a news fragment with the new package.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I'm trying to figure out is: are we trying to allow development without publishing for a while, keeping the version at 0.0.0 and then triggering the first published version which will bump it to 0.1.0? Or is the workflow that you introduce a new package at 0.0.0 (even if it's broken or partial) and it is immediately published as 0.1.0 during the next release?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can allow that if that's the behavior we want

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like a nice-to-have. Avoids accidentally publishing something that isn't working yet. But definitely not a blocker.

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.

2 participants