Skip to content

Commit 346ee1d

Browse files
authored
Merge pull request #110 from dihm/setuptools_scm_fix2
Add setuptools_scm build arguments to pyproject.toml
2 parents 24f2d6a + b3358c9 commit 346ee1d

File tree

5 files changed

+72
-61
lines changed

5 files changed

+72
-61
lines changed

.github/workflows/release.yml

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ on:
1111

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

1716
# Configuration for a package with compiled extensions:

labscript/__version__.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
import os
21
from pathlib import Path
32
try:
43
import importlib.metadata as importlib_metadata
54
except ImportError:
65
import importlib_metadata
76

8-
VERSION_SCHEME = {
9-
"version_scheme": os.getenv("SCM_VERSION_SCHEME", "release-branch-semver"),
10-
"local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
11-
}
12-
137
root = Path(__file__).parent.parent
148
if (root / '.git').is_dir():
15-
from setuptools_scm import get_version
16-
__version__ = get_version(root, **VERSION_SCHEME)
9+
try:
10+
from setuptools_scm import get_version
11+
VERSION_SCHEME = {
12+
"version_scheme": "release-branch-semver",
13+
"local_scheme": "node-and-date",
14+
}
15+
scm_version = get_version(root, **VERSION_SCHEME)
16+
except ImportError:
17+
scm_version = None
18+
else:
19+
scm_version = None
20+
21+
if scm_version is not None:
22+
__version__ = scm_version
1723
else:
1824
try:
1925
__version__ = importlib_metadata.version(__package__)

pyproject.toml

+58-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,61 @@
22
requires = ["setuptools>=64", "wheel", "setuptools_scm>=8"]
33
build-backend = "setuptools.build_meta"
44

5-
[tool.setuptools_scm]
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"
19+
description = "The labscript compiler — expressive control of harware-timed experiments"
20+
authors = [
21+
{name = "The labscript suite community", email = "labscriptsuite@googlegroups.com"},
22+
]
23+
keywords = ["experiment control", "automation"]
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+
"labscript_utils>=3.0.0",
39+
"numpy>=1.15",
40+
"scipy",
41+
"matplotlib",
42+
]
43+
dynamic = ["version"]
44+
45+
[project.readme]
46+
file = "README.md"
47+
content-type = "text/markdown"
48+
49+
[project.urls]
50+
Homepage = "http://labscriptsuite.org/"
51+
Documentation = "https://docs.labscriptsuite.org/"
52+
Repository = "https://github.com/labscript-suite/labscript/"
53+
Downloads = "https://github.com/labscript-suite/labscript/releases/"
54+
Tracker = "https://github.com/labscript-suite/labscript/issues/"
55+
56+
[project.optional-dependencies]
57+
docs = [
58+
"PyQt5",
59+
"Sphinx==7.2.6",
60+
"sphinx-rtd-theme==2.0.0",
61+
"myst_parser==2.0.0",
62+
]

setup.cfg

-42
This file was deleted.

setup.py

-9
This file was deleted.

0 commit comments

Comments
 (0)