setuptools_scm
setuptools_scm copied to clipboard
Show a suggested configuration for continuous deploy
Hey, thanks for setuptools_scm.
It'd be super useful if the docs showed a suggested (or at least possible) configuration for the use case where someone wanted to continuously deploy a package out of CI.
In particular, since PyPI doesn't allow uploading versions with local parts, one needs to axe those, but in theory still preserve as much connection to the git commit sha as possible, or to the date or something.
please outline the use-case in more detail, something like every commit right from ci, or more something like nightly builds from ci?
Closer to the former yeah -- imagine every merge to master gets an immediate release to PyPI.
So you want to automatic version a development release each time there in a way that still is uploadable.
so a custom version scheme is needed in some sense (like the post-release one)
we recently added branch support so a mechanism based on master/branch differences is thinkable
right now there is nothing detailed
In some sense there's not a direct need for branch support within setuptools_scm, because e.g. the typical way I'd enable this would be in say a .travis.yml, where there's already branch support for saying "only run this command on master", if that makes sense.
@Julian one would get incorrect reporting in local feature branches however while developing locally
it would be rather problematic of for example a new member of a team with upload permissions accidentally did a diverged release
In particular, since PyPI doesn't allow uploading versions with local parts, one needs to axe those, but in theory still preserve as much connection to the git commit sha as possible, or to the date or something.
@Julian FYI I came up with modifying local_scheme in CI and convincing Git that the config file hasn't actually changed: https://github.com/pypa/setuptools_scm/issues/455#issuecomment-642095224.
Here's a more complete/advanced example: https://github.com/cherrypy/cheroot/blob/56d7b49/.github/workflows/ci-cd.yml#L464-L521 — it also showcases assertions for the expected dist filenames as a part of the workflow.