setuptools_scm icon indicating copy to clipboard operation
setuptools_scm copied to clipboard

Show a suggested configuration for continuous deploy

Open Julian opened this issue 7 years ago • 6 comments
trafficstars

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.

Julian avatar Oct 03 '18 11:10 Julian

please outline the use-case in more detail, something like every commit right from ci, or more something like nightly builds from ci?

RonnyPfannschmidt avatar Oct 03 '18 21:10 RonnyPfannschmidt

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.

Julian avatar Oct 04 '18 12:10 Julian

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

RonnyPfannschmidt avatar Oct 04 '18 13:10 RonnyPfannschmidt

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 avatar Oct 04 '18 21:10 Julian

@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

RonnyPfannschmidt avatar Oct 05 '18 06:10 RonnyPfannschmidt

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.

webknjaz avatar Mar 27 '23 14:03 webknjaz