Skip to content

Instantly share code, notes, and snippets.

@Tblue
Created January 8, 2016 07:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tblue/8e86177d8c89cf2754f3 to your computer and use it in GitHub Desktop.
Save Tblue/8e86177d8c89cf2754f3 to your computer and use it in GitHub Desktop.
setuptools_scm: Include not only the date, but also the time in the "local" part of the version.
from setuptools import setup
setup(
# ...
use_scm_version={
# Include not only the date, but also the time in the "local" part of the version.
# Based on: https://git.io/vuPTX
"local_scheme": lambda version: \
version.format_choice("", "+d{time:%Y%m%d.h%H%M%S}") if version.exact else \
version.format_choice("+n{node}", "+n{node}.d{time:%Y%m%d.h%H%M%S}")
},
setup_requires=[
"setuptools_scm",
],
# ...
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment