-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split off the setuptools_scm versioning into a different pr #185 . Th…
…e current PR now depends on this, as it relies on the eessi/testsuite/__init__.py file to provide a version
- Loading branch information
Caspar van Leeuwen
committed
Sep 21, 2024
1 parent
446e4c8
commit 38ffee1
Showing
4 changed files
with
4 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
[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"} | ||
classifiers = [ | ||
"Programming Language :: Python" | ||
] | ||
requires-python = ">=3.6" | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
"Homepage" = "https://eessi.io/docs/test-suite" | ||
"Bug Tracker" = "https://github.com/EESSI/test-suite/issues" | ||
|
||
[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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |