Skip to content

Commit 7a32c41

Browse files
authored
Merge pull request #3812 from bdbaddog/fix_manpage_in_packages
Fix manpage in packages - Fixes issue #3759
2 parents 77dd793 + 428382d commit 7a32c41

File tree

11 files changed

+82
-13
lines changed

11 files changed

+82
-13
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@ htmlcov
5252

5353
# Mac junk
5454
**/.DS_Store
55+
56+
57+
# SCons specific
58+
*.1

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,4 @@ jobs:
9292
- python scripts/scons.py
9393
- ls -l build/dist
9494
- python build/scons-local/scons.py --version
95+
- ./.travis/verify_packages.sh

.travis/verify_packages.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
set -x
4+
5+
retval=0
6+
expected_man_file_count=3
7+
echo "Checking wheel file"
8+
wheel_man_files=$(unzip -l build/dist/SCons-*-py3-none-any.whl | grep -e '[a-z].1$' | wc -l | xargs)
9+
echo "Number of manpage files: $wheel_man_files"
10+
11+
echo "Checking tgz sdist package"
12+
tgz_man_files=$(tar tvfz build/dist/SCons-*.tar.gz | grep -e '[a-z].1$' | wc -l |xargs)
13+
14+
echo "Checking zip sdist package"
15+
zip_man_files=$(unzip -l build/dist/SCons-*.zip | grep -e '[a-z].1$' | wc -l |xargs)
16+
17+
if [[ $wheel_man_files != $expected_man_file_count ]]; then
18+
echo "Manpages not in wheel"
19+
retval=1
20+
fi
21+
22+
if [[ $tgz_man_files != $expected_man_file_count ]]; then
23+
echo "Manpages not in tgz sdist package"
24+
retval=2
25+
fi
26+
27+
if [[ $zip_man_files != $expected_man_file_count ]]; then
28+
echo "Manpages not in zip sdist package"
29+
retval=3
30+
fi
31+
32+
exit $retval

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
2323
- Remove pywin32 usage from SCons.Util where it was used for accessing the registry. Python native winreg
2424
library already includes this functionality.
2525
- Remove using pywin32 to retrieve peak memory usage on Win32 for `--debug=memory`
26+
- Fix Issue #3759 - include scons.1, sconsign.1, scons-time.1 manpages in sdist and wheel packages.
27+
- Change SCons's build so the generated `SCons/__init__.py` is no longer removed by `scons -c`
28+
2629

2730
From Michał Górny:
2831
- Fix dvipdf test failure due to passing incorrect flag to dvipdf.

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ recursive-include SCons/Tool/docbook *
33
# For license file
44
include LICENSE
55

6+
include scons.1 sconsign.1 scons-time.1
7+
recursive-include build/doc/man *.1
68

79

810

SCons/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
__version__="4.0.1"
1+
__version__="4.0.1.9998"
22
__copyright__="Copyright (c) 2001 - 2020 The SCons Foundation"
33
__developer__="bdbaddog"
4-
__date__="2020-07-17 01:50:03"
4+
__date__="2020-10-09 19:00:35"
55
__buildsys__="ProDog2020"
6-
__revision__="c289977f8b34786ab6c334311e232886da7e8df1"
7-
__build__="c289977f8b34786ab6c334311e232886da7e8df1"
6+
__revision__="93525bed88d19a00f5de400086c0046011d3b833"
7+
__build__="93525bed88d19a00f5de400086c0046011d3b833"
88
# make sure compatibility is always in place
99
import SCons.compat # noqa

SConstruct

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ copyright_years = strftime('2001 - %Y')
1212
# This gets inserted into the man pages to reflect the month of release.
1313
month_year = strftime('%B %Y')
1414
#
15-
# __COPYRIGHT__
15+
# MIT License
16+
#
17+
# Copyright The SCons Foundation
1618
#
1719
# Permission is hereby granted, free of charge, to any person obtaining
1820
# a copy of this software and associated documentation files (the
@@ -36,7 +38,7 @@ month_year = strftime('%B %Y')
3638

3739

3840
project = 'scons'
39-
default_version = '4.0.1'
41+
default_version = '4.0.1.9998'
4042
copyright = "Copyright (c) %s The SCons Foundation" % copyright_years
4143

4244
#
@@ -193,14 +195,21 @@ Export('command_line', 'env', 'whereis', 'revaction')
193195
SConscript('doc/SConscript')
194196

195197

198+
# Copy manpage's into base dir for inclusign in pypi packages
199+
man_pages = env.Install("#/", Glob("#/build/doc/man/*.1"))
200+
196201
# Build packages for pypi
197-
env.Command('$DISTDIR/SCons-${VERSION}-py3-none-any.whl', ['setup.cfg', 'setup.py', 'SCons/__init__.py'],
202+
wheel = env.Command('$DISTDIR/SCons-${VERSION}-py3-none-any.whl', ['setup.cfg', 'setup.py', 'SCons/__init__.py']+man_pages,
198203
'$PYTHON setup.py bdist_wheel')
199204

200-
env.Command('$DISTDIR/SCons-${VERSION}.zip', ['setup.cfg', 'setup.py', 'SCons/__init__.py'],
205+
zip_file = env.Command('$DISTDIR/SCons-${VERSION}.zip', ['setup.cfg', 'setup.py', 'SCons/__init__.py']+man_pages,
201206
'$PYTHON setup.py sdist --format=zip')
202-
env.Command('$DISTDIR/SCons-${VERSION}.tar.gz', ['setup.cfg', 'setup.py', 'SCons/__init__.py'],
207+
tgz_file = env.Command('$DISTDIR/SCons-${VERSION}.tar.gz', ['setup.cfg', 'setup.py', 'SCons/__init__.py']+man_pages,
203208
'$PYTHON setup.py sdist --format=gztar')
204209

210+
# Now set depends so the above run in a particular order
211+
env.Depends(tgz_file, [zip_file, wheel])
212+
env.AddPostAction(tgz_file, Delete(man_pages))
213+
205214
# TODO add auto copyright date to README.rst, LICENSE
206215
# TODO build API DOCS

setup.cfg

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ classifiers =
2828
Programming Language :: Python :: 3.6
2929
Programming Language :: Python :: 3.7
3030
Programming Language :: Python :: 3.8
31+
Programming Language :: Python :: 3.9
3132
Environment :: Console
3233
Intended Audience :: Developers
3334
License :: OSI Approved :: MIT License
@@ -60,13 +61,20 @@ console_scripts =
6061

6162

6263
[options.package_data]
63-
* = *.txt, *.rst
64+
* = *.txt, *.rst, *.1
6465
SCons.Tool.docbook = *.*
6566

67+
68+
[options.data_files]
69+
. = build/doc/man/scons.1
70+
build/doc/man/scons-time.1
71+
build/doc/man/sconsign.1
72+
6673
[sdist]
6774
dist-dir=build/dist
6875

6976
[bdist_wheel]
7077
; We're now py3 only
7178
;universal=true
72-
dist-dir=build/dist
79+
dist-dir=build/dist
80+

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
import codecs
88
import os.path
99

10+
1011
def read(rel_path):
1112
here = os.path.abspath(os.path.dirname(__file__))
1213
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
1314
return fp.read()
1415

16+
1517
def get_version(rel_path):
1618
for line in read(rel_path).splitlines():
1719
if line.startswith('__version__'):
@@ -21,7 +23,6 @@ def get_version(rel_path):
2123
raise RuntimeError("Unable to find version string.")
2224

2325

24-
2526
exclude = ['*Tests']
2627

2728

site_scons/scons_local_package.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# __COPYRIGHT__
1+
# MIT License
2+
#
3+
# Copyright The SCons Foundation
24
#
35
# Permission is hereby granted, free of charge, to any person obtaining
46
# a copy of this software and associated documentation files (the
@@ -60,6 +62,12 @@ def install_local_package_files(env):
6062
fn = os.path.basename(bf)
6163
all_local_installed.append(env.SCons_revision('#/build/scons-local/%s'%fn, bf))
6264

65+
# Now copy manpages into scons-local package
66+
built_manpage_files = env.Glob('build/doc/man/*.1')
67+
for bmp in built_manpage_files:
68+
fn = os.path.basename(str(bmp))
69+
all_local_installed.append(env.SCons_revision('#/build/scons-local/%s'%fn, bmp))
70+
6371
rename_files = [('scons-${VERSION}.bat', 'scripts/scons.bat'),
6472
('scons-README', 'README-local'),
6573
('scons-LICENSE', 'LICENSE-local')]

0 commit comments

Comments
 (0)