Skip to content

Commit

Permalink
* Continue to set local scheme based on env var
Browse files Browse the repository at this point in the history
  in `__version__.py` for consistency.

* Don't require specific setuptools or [toml] extra from setuptools_scm.
  We aren't configuring setuptools_scm in pyproject.toml anyway, and
  setuptools_scm itself will specify a fairly recent version of
  setuptools (we have no special requirement ourselves)

* no longer use env var for version_scheme in setup.py, since we're now
  hard-coding release-branch-semver.
  • Loading branch information
chrisjbillington committed Apr 9, 2021
1 parent 9d689bc commit f298181
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
6 changes: 5 additions & 1 deletion labscript_devices/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
root = Path(__file__).parent.parent
if (root / '.git').is_dir():
from setuptools_scm import get_version
__version__ = get_version(root, version_scheme="release-branch-semver")
__version__ = get_version(
root,
version_scheme="release-branch-semver",
local_scheme=os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
)
else:
try:
__version__ = importlib_metadata.version(__package__)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=4.1.0"]
requires = ["setuptools", "wheel", "setuptools_scm>=4.1.0"]
build-backend = "setuptools.build_meta"
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import os
from setuptools import setup

VERSION_SCHEME = {
"version_scheme": os.getenv("SCM_VERSION_SCHEME", "release-branch-semver"),
"local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
}

setup(use_scm_version=VERSION_SCHEME)
setup(
use_scm_version={
"version_scheme": "release-branch-semver",
"local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
}
)

0 comments on commit f298181

Please sign in to comment.