diff options
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | SConstruct | 36 | ||||
-rw-r--r-- | requirements.txt | 2 | ||||
-rw-r--r-- | scripts/scons.bat | 1 | ||||
-rw-r--r-- | setup.cfg | 5 | ||||
-rw-r--r-- | site_scons/scons_local_package.py | 41 | ||||
-rw-r--r-- | site_scons/site_init.py | 3 | ||||
-rw-r--r-- | site_scons/zip_utils.py | 2 |
8 files changed, 64 insertions, 28 deletions
diff --git a/MANIFEST.in b/MANIFEST.in index b5fa177..e509c38 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,3 @@ -global-exclude **Tests.py - recursive-include SCons/Tool/docbook * # For license file @@ -2,11 +2,15 @@ # SConstruct file to build scons packages during development. # # See the README.rst file for an overview of how SCons is built and tested. +import os.path +import sys +import textwrap +from time import strftime -copyright_years = '2001 - 2019' +copyright_years = strftime('2001 - %Y') # This gets inserted into the man pages to reflect the month of release. -month_year = 'December 2019' +month_year = strftime('%B %Y') # # __COPYRIGHT__ @@ -31,10 +35,6 @@ month_year = 'December 2019' # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -import os.path -import sys -import textwrap - project = 'scons' default_version = '3.9.9' @@ -46,10 +46,10 @@ copyright = "Copyright (c) %s The SCons Foundation" % copyright_years # people to still do SCons packaging work even if they don't have all # of the utilities installed # -print("git :%s"%git) -print("gzip :%s"%gzip) -print("unzip :%s"%unzip) -print("zip :%s"%zip_path) +print("git :%s" % git) +print("gzip :%s" % gzip) +print("unzip :%s" % unzip) +print("zip :%s" % zip_path) # # Adding some paths to sys.path, this is mainly needed @@ -65,12 +65,10 @@ for a in addpaths: command_line = BuildCommandLine(default_version) command_line.process_command_line_vars() - Default('.', command_line.build_dir) # Just make copies, don't symlink them. SetOption('duplicate', 'copy') - packaging_flavors = [ ('tar-gz', "The normal .tar.gz file for end-user installation."), ('local-tar-gz', "A .tar.gz file for dropping into other software " + @@ -96,12 +94,12 @@ unpack_zip_dir = os.path.join(command_line.build_dir, "unpack-zip") if is_windows(): tar_hflag = '' - python_project_subinst_dir = os.path.join("Lib", "site-packages", project) - project_script_subinst_dir = 'Scripts' +# python_project_subinst_dir = os.path.join("Lib", "site-packages", project) +# project_script_subinst_dir = 'Scripts' else: tar_hflag = 'h' - python_project_subinst_dir = os.path.join("lib", project) - project_script_subinst_dir = 'bin' +# python_project_subinst_dir = os.path.join("lib", project) +# project_script_subinst_dir = 'bin' indent_fmt = ' %-26s ' @@ -139,7 +137,6 @@ revaction = SCons_revision revbuilder = Builder(action=Action(SCons_revision, varlist=['COPYRIGHT', 'VERSION'])) - env = Environment( ENV=command_line.ENV, @@ -163,7 +160,8 @@ env = Environment( UNZIP=unzip, UNZIPFLAGS='-o -d $UNPACK_ZIP_DIR', - ZCAT=zcat, + # ZCAT=zcat, + # ZIPID=zipit, TEST_SRC_TAR_GZ_DIR=test_src_tar_gz_dir, TEST_SRC_ZIP_DIR=test_src_zip_dir, @@ -182,6 +180,7 @@ env = Environment( Version_values = [Value(command_line.version), Value(command_line.build_id)] +installed_local_files = create_local_packages(env) # # @@ -192,4 +191,3 @@ Version_values = [Value(command_line.version), Value(command_line.build_id)] Export('command_line', 'env', 'whereis', 'revaction') SConscript('doc/SConscript') - diff --git a/requirements.txt b/requirements.txt index 5608edf..a7b1248 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,5 @@ # Can be used with twinecheck # See: https://github.com/pypa/readme_renderer readme-renderer +sphinx +sphinx_rtd_theme
\ No newline at end of file diff --git a/scripts/scons.bat b/scripts/scons.bat index 10b8637..65c919e 100644 --- a/scripts/scons.bat +++ b/scripts/scons.bat @@ -1,5 +1,4 @@ @REM __COPYRIGHT__
-@REM __FILE__ __REVISION__ __DATE__ __DEVELOPER__
@echo off
set SCONS_ERRORLEVEL=
if "%OS%" == "Windows_NT" goto WinNT
@@ -8,7 +8,7 @@ long_description = file: README.rst long_description_content_type = text/x-rst description = Open Source next-generation build tool. group = Development/Tools -license_files = LICENSE +license_file = LICENSE url = http://www.scons.org/ @@ -62,6 +62,9 @@ console_scripts = * = *.txt, *.rst SCons.Tool.docbook = *.* +[sdist] + dist-dir=build/dist [bdist_wheel] universal=true +dist-dir=build/dist
\ No newline at end of file diff --git a/site_scons/scons_local_package.py b/site_scons/scons_local_package.py index d3d9046..c5ae234 100644 --- a/site_scons/scons_local_package.py +++ b/site_scons/scons_local_package.py @@ -21,7 +21,7 @@ from glob import glob import os.path - +from zip_utils import zipit def get_local_package_file_list(): """ @@ -37,7 +37,6 @@ def get_local_package_file_list(): filtered_list = [f for f in filtered_list if '__pycache__' not in f ] filtered_list = [f for f in filtered_list if not os.path.isdir(f)] - # TODO: add scripts return filtered_list @@ -51,11 +50,47 @@ def install_local_package_files(env): all_local_installed.extend(env.Install(os.path.join(target_dir, os.path.dirname(f)), f)) + basedir_files = ['scripts/scons.bat', + 'scripts/scons.py', + 'scripts/scons-configure-cache.py', + 'scripts/sconsign.py', + 'bin/scons-time.py'] + all_local_installed.extend(env.Install('#/build/scons-local', basedir_files)) + + rename_files = [('scons-${VERSION}.bat', 'scripts/scons.bat'), + ('scons-README', 'README-local'), + ('scons-LICENSE', 'LICENSE-local')] + subst_dict = {'__COPYRIGHT__':env['COPYRIGHT']} + for t, f in rename_files: + # all_local_installed.extend(env.Substfile('#/build/scons-local/%s'%t, f, SUBST_DICT=subst_dict)) + pass + return all_local_installed def create_local_packages(env): - + # Add SubstFile builder + env.Tool('textfile') + [env.Tool(x) for x in ['packaging', 'filesystem', 'zip']] installed_files = install_local_package_files(env) + package = env.Command('#build/dist/scons-local-${VERSION}.zip', + installed_files, + zipit, + CD='build/scons-local', + PSV='.', + ) + # package = env.Package(PACKAGETYPE='zip', + # NAME='scons-local', + # VERSION='$VERSION', + # target='#build/dist/scons-local-${VERSION}.zip', + # # PACKAGEROOT='#build/scons-local', + # source=installed_files) + + print("Package:%s"%package) + + # zip_package = env.Package('build/dist/scons-local-${VERSION}.zip', + # source=installed_files, + # PACKAGETYPE='zip') + diff --git a/site_scons/site_init.py b/site_scons/site_init.py index 81c4753..2205781 100644 --- a/site_scons/site_init.py +++ b/site_scons/site_init.py @@ -2,10 +2,11 @@ import os.path from SConsRevision import SCons_revision from Utilities import is_windows, whereis, platform, deb_date -from zip_utils import unzipit, zipit, zcat +# from zip_utils import unzipit, zipit, zcat from soe_utils import soelim, soscan, soelimbuilder # from epydoc import epydoc_cli, epydoc_commands from BuildCommandLine import BuildCommandLine +from scons_local_package import install_local_package_files, create_local_packages gzip = whereis('gzip') git = os.path.exists('.git') and whereis('git') diff --git a/site_scons/zip_utils.py b/site_scons/zip_utils.py index 3d5821e..1a0f843 100644 --- a/site_scons/zip_utils.py +++ b/site_scons/zip_utils.py @@ -21,7 +21,7 @@ try: # default ZipFile compression is ZIP_STORED zf = zipfile.ZipFile(str(target[0]), 'w', compression=zipfile.ZIP_DEFLATED) olddir = os.getcwd() - os.chdir(env['CD']) + os.chdir(env.Dir(env['CD']).abspath) try: for dirname, dirnames, filenames in os.walk(env['PSV']): visit(zf, dirname, filenames) |