Scons in Python3

Scons in Python3

Make scons available in Python3 as well. Many libraries have been compatible with Python3, but scons is not yet compatible, so we will use the unofficial version.

Get source code

The [official version] of scons (http://www.scons.org/) is not yet compatible with Python3, so the source code that was forked and ported to Python3 (here org / userzimmermann / scons / branch / python3-port)) is used.

hg clone https://bitbucket.org/userzimmermann/scons
cd scons
hg pull && hg update python3-port

Source code modification

There is a slight problem with src / setup.py and an error occurs during the build, so fix it.

diff.patch


diff -r 6679e468ada7 src/setup.py
--- a/src/setup.py	Sun Apr 06 10:50:33 2014 -0400
+++ b/src/setup.py	Wed Sep 03 16:00:20 2014 +0900
@@ -368,19 +368,19 @@ class install_data(_install_data):
 description = "Open Source next-generation build tool."
 
 long_description = """Open Source next-generation build tool.
 Improved, cross-platform substitute for the classic Make
 utility.  In short, SCons is an easier, more reliable
 and faster way to build software."""
 
 scripts = [
-    'script/scons',
-    'script/sconsign',
-    'script/scons-time',
+    'script/scons.py',
+    'script/sconsign.py',
+    'script/scons-time.py',
 
     # We include scons.bat in the list of scripts, even on UNIX systems,
     # because we provide an option to allow it be installed explicitly,
     # for example if you're installing from UNIX on a share that's
     # accessible to Windows and you want the scons.bat.
     'script/scons.bat',
 ]
 
@@ -402,78 +402,87 @@ arguments = {
                           "SCons.Tool",
                           "SCons.Tool.docbook",
                           "SCons.Tool.MSCommon",
                           "SCons.Tool.packaging",
                           "SCons.Variables",
                          ],
     'package_dir'      : {'' : 'engine',
                           'SCons.Tool.docbook' : 'engine/SCons/Tool/docbook'},
-    'package_data'     : {'SCons.Tool.docbook' : ['docbook-xsl-1.76.1/*',
+    'package_data'     : {'SCons.Tool.docbook' : ['docbook-xsl-1.76.1/*.*',
+                                                  'docbook-xsl-1.76.1/AUTHORS',
+                                                  'docbook-xsl-1.76.1/BUGS',
+                                                  'docbook-xsl-1.76.1/COPYING',
+                                                  'docbook-xsl-1.76.1/INSTALL',
+                                                  'docbook-xsl-1.76.1/Makefile',
+                                                  'docbook-xsl-1.76.1/NEWS',
+                                                  'docbook-xsl-1.76.1/README',
+                                                  'docbook-xsl-1.76.1/TODO',
+                                                  'docbook-xsl-1.76.1/VERSION',
                                                   'docbook-xsl-1.76.1/common/*',
                                                   'docbook-xsl-1.76.1/docsrc/*',
                                                   'docbook-xsl-1.76.1/eclipse/*',
-                                                  'docbook-xsl-1.76.1/epub/*',
-                                                  'docbook-xsl-1.76.1/epub/bin/*',
+                                                  'docbook-xsl-1.76.1/epub/docbook.xsl',
+                                                  'docbook-xsl-1.76.1/epub/README',
+                                                  'docbook-xsl-1.76.1/epub/bin/dbtoepub',
                                                   'docbook-xsl-1.76.1/epub/bin/lib/*',
                                                   'docbook-xsl-1.76.1/epub/bin/xslt/*',
                                                   'docbook-xsl-1.76.1/extensions/*',
                                                   'docbook-xsl-1.76.1/fo/*',
                                                   'docbook-xsl-1.76.1/highlighting/*',
                                                   'docbook-xsl-1.76.1/html/*',
                                                   'docbook-xsl-1.76.1/htmlhelp/*',
-                                                  'docbook-xsl-1.76.1/images/*',
+                                                  'docbook-xsl-1.76.1/images/*.svg',
                                                   'docbook-xsl-1.76.1/images/callouts/*',
                                                   'docbook-xsl-1.76.1/images/colorsvg/*',
                                                   'docbook-xsl-1.76.1/javahelp/*',
                                                   'docbook-xsl-1.76.1/lib/*',
                                                   'docbook-xsl-1.76.1/manpages/*',
                                                   'docbook-xsl-1.76.1/params/*',
                                                   'docbook-xsl-1.76.1/profiling/*',
                                                   'docbook-xsl-1.76.1/roundtrip/*',
                                                   'docbook-xsl-1.76.1/slides/browser/*',
                                                   'docbook-xsl-1.76.1/slides/fo/*',
                                                   'docbook-xsl-1.76.1/slides/graphics/*',
                                                   'docbook-xsl-1.76.1/slides/graphics/active/*',
                                                   'docbook-xsl-1.76.1/slides/graphics/inactive/*',
                                                   'docbook-xsl-1.76.1/slides/graphics/toc/*',
                                                   'docbook-xsl-1.76.1/slides/html/*',
                                                   'docbook-xsl-1.76.1/slides/htmlhelp/*',
-                                                  'docbook-xsl-1.76.1/slides/keynote/*',
+                                                  'docbook-xsl-1.76.1/slides/keynote/default.xsl',
                                                   'docbook-xsl-1.76.1/slides/keynote/xsltsl/*',
                                                   'docbook-xsl-1.76.1/slides/svg/*',
                                                   'docbook-xsl-1.76.1/slides/xhtml/*',
                                                   'docbook-xsl-1.76.1/template/*',
                                                   'docbook-xsl-1.76.1/tests/*',
                                                   'docbook-xsl-1.76.1/tools/bin/*',
                                                   'docbook-xsl-1.76.1/tools/make/*',
-                                                  'docbook-xsl-1.76.1/webhelp/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/common/*',
+                                                  'docbook-xsl-1.76.1/webhelp/LICENSE',
+                                                  'docbook-xsl-1.76.1/webhelp/docs/index.html',
+                                                  'docbook-xsl-1.76.1/webhelp/docs/common/main.js',
                                                   'docbook-xsl-1.76.1/webhelp/docs/common/css/*',
                                                   'docbook-xsl-1.76.1/webhelp/docs/common/images/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/common/jquery/*',
+                                                  'docbook-xsl-1.76.1/webhelp/docs/common/jquery/*.js',
                                                   'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/*',
                                                   'docbook-xsl-1.76.1/webhelp/docs/common/jquery/theme-redmond/images/*',
                                                   'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/*',
                                                   'docbook-xsl-1.76.1/webhelp/docs/common/jquery/treeview/images/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/content/*',
-                                                  'docbook-xsl-1.76.1/webhelp/docs/content/search/*',
+                                                  'docbook-xsl-1.76.1/webhelp/docs/content/*.html',
+                                                  'docbook-xsl-1.76.1/webhelp/docs/content/search/*.js',
                                                   'docbook-xsl-1.76.1/webhelp/docs/content/search/stemmers/*',
                                                   'docbook-xsl-1.76.1/webhelp/docsrc/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/common/*',
+                                                  'docbook-xsl-1.76.1/webhelp/template/common/main.js',
                                                   'docbook-xsl-1.76.1/webhelp/template/common/css/*',
                                                   'docbook-xsl-1.76.1/webhelp/template/common/images/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/common/jquery/*',
+                                                  'docbook-xsl-1.76.1/webhelp/template/common/jquery/*.js',
                                                   'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/*',
                                                   'docbook-xsl-1.76.1/webhelp/template/common/jquery/theme-redmond/images/*',
                                                   'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/*',
                                                   'docbook-xsl-1.76.1/webhelp/template/common/jquery/treeview/images/*',
-                                                  'docbook-xsl-1.76.1/webhelp/template/content/search/*',
+                                                  'docbook-xsl-1.76.1/webhelp/template/content/search/*.*',
                                                   'docbook-xsl-1.76.1/webhelp/template/content/search/stemmers/*',
                                                   'docbook-xsl-1.76.1/webhelp/xsl/*',
                                                   'docbook-xsl-1.76.1/website/*',
                                                   'docbook-xsl-1.76.1/xhtml/*',
                                                   'docbook-xsl-1.76.1/xhtml-1_1/*',
                                                   'utils/*']},
     'data_files'       : [('man/man1', man_pages)],
     'scripts'          : scripts,

Build & install

All you have to do is move to the src directory and build and install

cd src
python setup.py build
python setup.py install

Finally

When I actually use the ported version of scons, I don't know if it's a bad use or a bug, but there is only one time that the part that should be skipped is not skipped because the file has not been changed. did. This problem was solved by changing the way SConstruct was written. There are no other problems, so I think it can be put to practical use.

Then, please fully enjoy scons in a Japanese environment.

Recommended Posts

Scons in Python3
Quadtree in Python --2
Python in optimization
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
SendKeys in Python
Meta-analysis in Python
Unittest in python
Epoch in Python
Sudoku in Python
DCI in Python
quicksort in python
nCr in python
N-Gram in Python
Programming in python
Plink in Python
Constant in python
Lifegame in Python.
FizzBuzz in Python
Sqlite in python
StepAIC in Python
N-gram in python
LINE-Bot [0] in Python
Csv in python
Disassemble in Python
Reflection in Python
Constant in python
nCr in Python.
format in python
Puyo Puyo in python
python in virtualenv
PPAP in Python
Quad-tree in Python
Reflection in Python
Chemistry in Python
Hashable in python
DirectLiNGAM in Python
LiNGAM in Python
Flatten in python
flatten in python
Sorted list in Python
Daily AtCoder # 36 in Python
Clustering text in Python
Daily AtCoder # 2 in Python
Implement Enigma in python
Daily AtCoder # 32 in Python
Daily AtCoder # 6 in Python
Daily AtCoder # 18 in Python
Edit fonts in Python
File operations in Python
Read DXF in python
Daily AtCoder # 53 in Python
Key input in Python
Use config.ini in Python
Daily AtCoder # 33 in Python
Solve ABC168D in Python
Logistic distribution in Python
Daily AtCoder # 7 in Python
LU decomposition in Python