From 38ffee1dd59db661cdc1f1ae223f5cd63191113f Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Sat, 21 Sep 2024 11:11:24 +0200 Subject: [PATCH] Split off the setuptools_scm versioning into a different pr https://github.com/EESSI/test-suite/pull/185 . The current PR now depends on this, as it relies on the eessi/testsuite/__init__.py file to provide a version --- eessi/testsuite/__init__.py | 16 ---------------- pyproject.toml | 10 ++-------- setup.cfg | 5 +---- setup.py | 16 +--------------- 4 files changed, 4 insertions(+), 43 deletions(-) diff --git a/eessi/testsuite/__init__.py b/eessi/testsuite/__init__.py index 8bb9e2a5..e69de29b 100644 --- a/eessi/testsuite/__init__.py +++ b/eessi/testsuite/__init__.py @@ -1,16 +0,0 @@ -# If this is an installed package, setuptools_scm should have written the file _version.py in the current directory -try: - from ._version import __version__ -except ImportError: - # Fallback for when the package is not installed, but git cloned. Note that this requires setuptools_scm to be - # available as a runtime dependency - try: - from setuptools_scm import get_version - # Using a relative path for relative_to doesn't work, because it will be relative to the current working - # directory (which could be anywhere) - # __file__ is the location of this init file (a full path), and this gives us a predictable path to the root - # (namely: two levels up) - # Note that if we ever move this __init__ file relative to the root of the git tree, we'll need to adjust this - __version__ = get_version(root='../..', relative_to=__file__) - except ImportError: - __version__ = "0.0.0" # fallback version if setuptools_scm is not available diff --git a/pyproject.toml b/pyproject.toml index 10b7c7e6..445232af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -# Setuptools_scm<7 to be compatible with Python 3.6 -requires = ["setuptools>=42", "wheel"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [project] name = "eessi-testsuite" +version = "0.3.2" description = "Test suite for the EESSI software stack" readme = "README.md" license = {file = "LICENSE"} @@ -12,7 +12,6 @@ classifiers = [ "Programming Language :: Python" ] requires-python = ">=3.6" -dynamic = ["version"] [project.urls] "Homepage" = "https://eessi.io/docs/test-suite" @@ -20,8 +19,3 @@ dynamic = ["version"] [tool.setuptools.packages.find] include = ["eessi*"] - -[tool.setuptools_scm] -version_scheme = "guess-next-dev" -local_scheme = "node-and-date" -write_to = "eessi/testsuite/_version.py" diff --git a/setup.cfg b/setup.cfg index 3ef11c6e..af7a3b6a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,6 @@ [metadata] name = eessi-testsuite +version = 0.3.2 description = Test suite for the EESSI software stack long_description = file: README.md long_description_content_type = text/markdown @@ -20,10 +21,6 @@ namespace_packages = eessi [options.packages.find] include = eessi* -[setuptools_scm] -version_scheme = guess-next-dev -local_scheme = node-and-date - [flake8] max-line-length = 120 # ignore star imports (F403, F405) diff --git a/setup.py b/setup.py index ea501b76..a4f49f92 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,2 @@ import setuptools -import sys - -python_version = sys.version_info -if python_version < (3, 8): - scm_require = ['packaging<=21.3', 'setuptools_scm<7'] - scm_arg_key = "write_to" -else: - scm_require = ['setuptools_scm>=8'] - scm_arg_key = "version_file" - - -setuptools.setup( - use_scm_version={scm_arg_key: 'eessi/testsuite/_version.py'}, - setup_requires=scm_require, -) +setuptools.setup()