Guard unpublished package versions - #335
Conversation
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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I think you're required to add a news fragment with the new package.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
We can allow that if that's the behavior we want
There was a problem hiding this comment.
It seems like a nice-to-have. Avoids accidentally publishing something that isn't working yet. But definitely not a blocker.
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.