Skip to content

Commit 94874ae

Browse files
authored
Merge branch 'master' into maint/variables-export
2 parents 0d04f54 + e4854a1 commit 94874ae

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
3535
`from SCons.Variables import *` which expected the variable *types*
3636
to be avaiable. While we never advertised this usage, there's no
3737
real reason it shouldn't keep working - add to `__all__`.
38+
- Switch SCons build to use setuptools' supported version fetcher from
39+
the old homegrown one.
3840

3941

4042
RELEASE 4.8.0 - Sun, 07 Jul 2024 17:22:20 -0700

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ zip-safe = false
5252
include-package-data = true
5353
license-files = ["LICENSE"]
5454

55+
[tool.setuptools.dynamic]
56+
version = {attr = "SCons.__version__"}
57+
5558
[tool.setuptools.packages.find]
5659
exclude = ["template"]
5760
namespaces = false

setup.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,16 @@ def read(rel_path):
1414
return fp.read()
1515

1616

17-
def get_version(rel_path):
18-
for line in read(rel_path).splitlines():
19-
if line.startswith('__version__'):
20-
delim = '"' if '"' in line else "'"
21-
return line.split(delim)[1]
22-
else:
23-
raise RuntimeError("Unable to find version string.")
24-
25-
2617
exclude = ['*Tests']
2718

2819

2920
class build_py(build_py_orig):
3021

3122
def find_package_modules(self, package, package_dir):
32-
"""
33-
Custom module to find package modules.
34-
It will strip out any modules which match the glob patters in exclude above
23+
"""Custom module to find package modules.
24+
25+
Will strip out any modules which match the glob patters in
26+
*exclude* above
3527
"""
3628
modules = super().find_package_modules(package, package_dir)
3729
return [(pkg, mod, file, ) for (pkg, mod, file, ) in modules
@@ -42,5 +34,4 @@ def find_package_modules(self, package, package_dir):
4234
cmdclass={
4335
'build_py': build_py,
4436
},
45-
version=get_version('SCons/__init__.py'),
46-
)
37+
)

0 commit comments

Comments
 (0)