Skip to content

Commit 8c1620c

Browse files
committed
Move metadata to pyproject.toml,
update setuptools-scm configs
1 parent 851f354 commit 8c1620c

File tree

5 files changed

+83
-113
lines changed

5 files changed

+83
-113
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-utils
14-
SCM_LOCAL_SCHEME: no-local-version
1514
ANACONDA_USER: labscript-suite
1615

1716
# Configuration for a package with compiled extensions:

labscript_utils/__version__.py

+15-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1-
import os
21
from pathlib import Path
3-
42
try:
53
import importlib.metadata as importlib_metadata
64
except ImportError:
75
import importlib_metadata
86

9-
VERSION_SCHEME = {
10-
"version_scheme": os.getenv("SCM_VERSION_SCHEME", "release-branch-semver"),
11-
"local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"),
12-
}
13-
147
root = Path(__file__).parent.parent
158
if (root / '.git').is_dir():
16-
from setuptools_scm import get_version
17-
__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
1823
else:
1924
try:
2025
__version__ = importlib_metadata.version(__package__)
2126
except importlib_metadata.PackageNotFoundError:
22-
__version__ = None
27+
__version__ = None

pyproject.toml

+68-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,71 @@
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+
packages = [
13+
"labscript_utils",
14+
"labscript_profile",
15+
]
16+
17+
[tool.setuptools.package-data]
18+
labscript_profile = ["../labscript-suite.pth"]
19+
20+
[project]
21+
name = "labscript-utils"
22+
description = "Shared utilities for the labscript suite"
23+
authors = [
24+
{name = "The labscript suite community", email = "[email protected]"},
25+
]
26+
keywords = ["experiment control", "automation"]
27+
license = {file = 'LICENSE.txt'}
28+
classifiers = [
29+
"License :: OSI Approved :: BSD License",
30+
"Programming Language :: Python :: 3 :: Only",
31+
"Programming Language :: Python :: 3.6",
32+
"Programming Language :: Python :: 3.7",
33+
"Programming Language :: Python :: 3.8",
34+
"Programming Language :: Python :: 3.9",
35+
"Programming Language :: Python :: 3.10",
36+
"Programming Language :: Python :: 3.11",
37+
]
38+
requires-python = ">=3.6"
39+
dependencies = [
40+
"importlib_metadata>=1.0",
41+
"h5py>=2.9",
42+
"numpy>=1.15",
43+
"packaging>=20.4",
44+
"pyqtgraph>=0.11.0rc0",
45+
"qtutils>=2.2.3",
46+
"scipy",
47+
"setuptools_scm>=4.1.0",
48+
"zprocess>=2.18.0",
49+
]
50+
dynamic = ["version"]
51+
52+
[project.readme]
53+
file = "README.md"
54+
content-type = "text/markdown"
55+
56+
[project.urls]
57+
Homepage = "http://labscriptsuite.org/"
58+
Documentation = "https://docs.labscriptsuite.org/"
59+
Repository = "https://github.com/labscript-suite/labscript-utils/"
60+
Downloads = "https://github.com/labscript-suite/labscript-utils/releases/"
61+
Tracker = "https://github.com/labscript-suite/labscript-utils/issues/"
62+
63+
[project.optional-dependencies]
64+
docs = [
65+
"PyQt5",
66+
"Sphinx==7.2.6",
67+
"sphinx-rtd-theme==2.0.0",
68+
"myst_parser==2.0.0",
69+
]
70+
71+
[project.scripts]
72+
labscript-profile-create = "labscript_profile.create:create_profile"

setup.cfg

-53
This file was deleted.

setup.py

-48
This file was deleted.

0 commit comments

Comments
 (0)