Skip to content

Commit d51f8be

Browse files
committed
Move all metadata to pyproject.toml,
update setuptools-scm config options
1 parent 8674016 commit d51f8be

File tree

5 files changed

+64
-52
lines changed

5 files changed

+64
-52
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111

1212
env:
1313
PACKAGE_NAME: labscript-c-extensions
14-
SCM_LOCAL_SCHEME: no-local-version
1514
ANACONDA_USER: labscript-suite
1615

1716
# Configuration for a package with compiled extensions:

labscript_c_extensions/__version__.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,28 @@
1010
# root of the project for the full license. #
1111
# #
1212
#####################################################################
13-
import os
1413
from pathlib import Path
1514
try:
1615
import importlib.metadata as importlib_metadata
1716
except ImportError:
1817
import importlib_metadata
1918

20-
VERSION_SCHEME = {
21-
"version_scheme": os.getenv("SCM_VERSION_SCHEME", "guess-next-dev"),
22-
"local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
23-
}
24-
2519
root = Path(__file__).parent.parent
2620
if (root / '.git').is_dir():
27-
from setuptools_scm import get_version
28-
__version__ = get_version(root, **VERSION_SCHEME)
21+
try:
22+
from setuptools_scm import get_version
23+
VERSION_SCHEME = {
24+
"version_scheme": "release-branch-semver",
25+
"local_scheme": "node-and-date",
26+
}
27+
scm_version = get_version(root, **VERSION_SCHEME)
28+
except ImportError:
29+
scm_version = None
30+
else:
31+
scm_version = None
32+
33+
if scm_version is not None:
34+
__version__ = scm_version
2935
else:
3036
try:
3137
__version__ = importlib_metadata.version(__package__)

pyproject.toml

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
11
[build-system]
2-
requires = ["setuptools", "wheel", "setuptools_scm", "cython"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["setuptools>=64", "wheel", "setuptools_scm>=8", "cython"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools_scm]
6+
version_scheme = "release-branch-semver"
7+
local_scheme = "no-local-version"
8+
9+
[tool.setuptools]
10+
zip-safe = false
11+
include-package-data = true
12+
13+
[tool.setuptools.packages]
14+
find = {namespaces = false}
15+
16+
17+
[project]
18+
name = "labscript-c-extensions"
19+
description = "A module containing C-extensions for the labscript suite"
20+
authors = [
21+
{name = "The labscript suite community", email = "labscriptsuite@googlegroups.com"},
22+
]
23+
keywords = ["experiment control", "automation", "visualization"]
24+
license = {file = 'LICENSE.txt'}
25+
classifiers = [
26+
"License :: OSI Approved :: BSD License",
27+
"Programming Language :: Python :: 3 :: Only",
28+
"Programming Language :: Python :: 3.6",
29+
"Programming Language :: Python :: 3.7",
30+
"Programming Language :: Python :: 3.8",
31+
"Programming Language :: Python :: 3.9",
32+
"Programming Language :: Python :: 3.10",
33+
"Programming Language :: Python :: 3.11",
34+
]
35+
requires-python = ">=3.6"
36+
dependencies = [
37+
"importlib_metadata",
38+
"numpy>=1.15",
39+
]
40+
dynamic = ["version"]
41+
42+
[project.readme]
43+
file = "README.md"
44+
content-type = "text/markdown"
45+
46+
[project.urls]
47+
Homepage = "http://labscriptsuite.org/"
48+
Documentation = "https://docs.labscriptsuite.org/"
49+
Repository = "https://github.com/labscript-suite/labscript-c-extension/"
50+
Downloads = "https://github.com/labscript-suite/labscript-c-extension/releases/"
51+
Tracker = "https://github.com/labscript-suite/labscript-c-extension/issues/"

setup.cfg

Lines changed: 0 additions & 33 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66

77
CMDCLASS = {"build_ext": build_ext}
88

9-
10-
VERSION_SCHEME = {
11-
"version_scheme": os.getenv("SCM_VERSION_SCHEME", "guess-next-dev"),
12-
"local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
13-
}
14-
15-
169
EXT_MODULES = [
1710
Extension(
1811
"labscript_c_extensions.runviewer.resample",
@@ -21,7 +14,6 @@
2114
]
2215

2316
setup(
24-
use_scm_version=VERSION_SCHEME,
2517
cmdclass=CMDCLASS,
2618
ext_modules=EXT_MODULES,
2719
)

0 commit comments

Comments
 (0)