From a59a0d0898e302c2f8fad69aa1c896967e10b36d Mon Sep 17 00:00:00 2001 From: David Meyer Date: Sat, 13 Jul 2024 01:09:42 -0400 Subject: [PATCH] Move all metadata to pyproject.toml, update setuptools-scm configuration. Also minor adjustments to dependencies --- .github/workflows/release.yml | 1 - blacs/__version__.py | 21 +++++++---- pyproject.toml | 66 ++++++++++++++++++++++++++++++++++- setup.cfg | 50 -------------------------- setup.py | 9 ----- 5 files changed, 79 insertions(+), 68 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ed5613..6d0e0de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,6 @@ on: env: PACKAGE_NAME: blacs - SCM_LOCAL_SCHEME: no-local-version ANACONDA_USER: labscript-suite # Configuration for a package with compiled extensions: diff --git a/blacs/__version__.py b/blacs/__version__.py index 15d1c35..c21f494 100644 --- a/blacs/__version__.py +++ b/blacs/__version__.py @@ -1,4 +1,3 @@ -import os from pathlib import Path try: import importlib.metadata as importlib_metadata @@ -7,12 +6,20 @@ root = Path(__file__).parent.parent if (root / '.git').is_dir(): - from setuptools_scm import get_version - __version__ = get_version( - root, - version_scheme=os.getenv("SCM_VERSION_SCHEME", "release-branch-semver"), - local_scheme=os.getenv("SCM_LOCAL_SCHEME", "node-and-date"), - ) + try: + from setuptools_scm import get_version + VERSION_SCHEME = { + "version_scheme": "release-branch-semver", + "local_scheme": "node-and-date", + } + scm_version = get_version(root, **VERSION_SCHEME) + except ImportError: + scm_version = None +else: + scm_version = None + +if scm_version is not None: + __version__ = scm_version else: try: __version__ = importlib_metadata.version(__package__) diff --git a/pyproject.toml b/pyproject.toml index 3a61336..0be9ff0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,4 +2,68 @@ requires = ["setuptools>=64", "wheel", "setuptools_scm>=8"] build-backend = "setuptools.build_meta" -[tool.setuptools_scm] \ No newline at end of file +[tool.setuptools_scm] +version_scheme = "release-branch-semver" +local_scheme = "no-local-version" + +[tool.setuptools] +zip-safe = false +include-package-data = true + +[tool.setuptools.packages] +find = {namespaces = false} + + +[project] +name = "blacs" +description = "Graphical labscript suite experiment queue and hardware interface" +authors = [ + {name = "The labscript suite community", email = "labscriptsuite@googlegroups.com"}, +] +keywords = ["experiment control", "automation"] +license = {file = 'LICENSE.txt'} +classifiers = [ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +requires-python = ">=3.6" +dependencies = [ + "desktop-app>=0.1.2", + "importlib_metadata", + "labscript_utils>=3.1.0b1", + "runmanager>=3.0.0", + "qtutils>=2.2.2", + "zprocess>=2.14.1", +] +dynamic = ["version"] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.urls] +Homepage = "http://labscriptsuite.org/" +Documentation = "https://docs.labscriptsuite.org/" +Repository = "https://github.com/labscript-suite/blacs/" +Downloads = "https://github.com/labscript-suite/blacs/releases/" +Tracker = "https://github.com/labscript-suite/blacs/issues/" + +[project.optional-dependencies] +docs = [ + "PyQt5", + "Sphinx==7.2.6", + "sphinx-rtd-theme==2.0.0", + "myst_parser==2.0.0", +] + +[project.scripts] +blacs = "desktop_app:entry_point" + +[project.gui-scripts] +blacs-gui = "desktop_app:entry_point" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ca7b884..0000000 --- a/setup.cfg +++ /dev/null @@ -1,50 +0,0 @@ -[metadata] -name = blacs -description = Graphical labscript suite experiment queue and hardware interface -long_description = file: README.md -long_description_content_type = text/markdown -author = The labscript suite community -author_email = labscriptsuite@googlegroups.com -url = http://labscriptsuite.org -project_urls = - Source Code=https://github.com/labscript-suite/blacs - Download=https://github.com/labscript-suite/blacs/releases - Tracker=https://github.com/labscript-suite/blacs/issues -keywords = experiment control automation -license = BSD -classifiers = - License :: OSI Approved :: BSD License - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - -[options] -zip_safe = False -include_package_data = True -packages = find: -python_requires = >=3.6 -install_requires = - importlib_metadata - labscript_utils>=3.1.0b1 - runmanager>=3.0.0 - qtutils>=2.3.2 - setuptools_scm>=4.1.0 - zprocess>=2.14.1 - -[options.entry_points] -console_scripts = - blacs = desktop_app:entry_point -gui_scripts = - blacs-gui = desktop_app:entry_point - -[options.extras_require] -pyqt = PyQt5 -docs = - PyQt5 - Sphinx==7.2.6 - sphinx-rtd-theme==2.0.0 - myst_parser==2.0.0 diff --git a/setup.py b/setup.py deleted file mode 100644 index 8e0afd8..0000000 --- a/setup.py +++ /dev/null @@ -1,9 +0,0 @@ -import os -from setuptools import setup - -setup( - use_scm_version={ - "version_scheme": os.getenv("SCM_VERSION_SCHEME", "release-branch-semver"), - "local_scheme": os.getenv("SCM_LOCAL_SCHEME", "node-and-date"), - } -)