[yt-svn] commit/yt: 5 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Wed Feb 27 07:47:04 PST 2013


5 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/8ed119eea298/
changeset:   8ed119eea298
branch:      yt
user:        xarthisius
date:        2013-02-21 12:44:13
summary:     [setup.py] build fKD.so when 'build' or 'install' is called, pep8. Fixes #506
affected #:  1 file

diff -r e98c2e518d1ecca3e2f9b08c1b2622e3f190ab47 -r 8ed119eea298b5561af7cecc44dc5193f1906a7d setup.py
--- a/setup.py
+++ b/setup.py
@@ -4,14 +4,52 @@
 import sys
 import time
 import subprocess
+import shutil
+import glob
 import distribute_setup
 distribute_setup.use_setuptools()
 
 from distutils.command.build_py import build_py
+from numpy.distutils.command import build as np_build
 from numpy.distutils.misc_util import appendpath
 from numpy.distutils import log
 from distutils import version
 
+from distutils.core import Command
+
+
+class BuildForthon(Command):
+
+    """Command for building Forthon modules"""
+
+    description = "Build Forthon modules"
+    user_options = tuple()
+
+    def initialize_options(self):
+
+        """init options"""
+
+        pass
+
+    def finalize_options(self):
+
+        """finalize options"""
+
+        pass
+
+    def run(self):
+
+        """runner"""
+
+        cwd = os.getcwd()
+        os.chdir(os.path.join(cwd, 'yt/utilities/kdtree'))
+        cmd = ["Forthon", "-F", "gfortran", "--compile_first", "fKD_source",
+               "--no2underscores", "--fopt", "'-O3'", "fKD",
+               "fKD_source.f90"]
+        subprocess.check_call(cmd, shell=False)
+        shutil.move(glob.glob('build/lib*/fKDpy.so')[0], os.getcwd())
+        os.chdir(cwd)
+
 REASON_FILES = []
 REASON_DIRS = [
     "",
@@ -36,7 +74,7 @@
     files = []
     for ext in ["js", "html", "css", "png", "ico", "gif"]:
         files += glob.glob("%s/*.%s" % (dir_name, ext))
-    REASON_FILES.append( (dir_name, files) )
+    REASON_FILES.append((dir_name, files))
 
 # Verify that we have Cython installed
 try:
@@ -93,10 +131,10 @@
             language=extension.language, cplus=cplus,
             output_file=target_file)
         cython_result = Cython.Compiler.Main.compile(source,
-                                                   options=options)
+                                                     options=options)
         if cython_result.num_errors != 0:
-            raise DistutilsError("%d errors while compiling %r with Cython" \
-                  % (cython_result.num_errors, source))
+            raise DistutilsError("%d errors while compiling %r with Cython"
+                                 % (cython_result.num_errors, source))
     return target_file
 
 
@@ -109,7 +147,9 @@
 
 VERSION = "2.5dev"
 
-if os.path.exists('MANIFEST'): os.remove('MANIFEST')
+if os.path.exists('MANIFEST'):
+    os.remove('MANIFEST')
+
 
 def get_mercurial_changeset_id(target_dir):
     """adapted from a script by Jason F. Harris, published at
@@ -123,11 +163,11 @@
                                      stdout=subprocess.PIPE,
                                      stderr=subprocess.PIPE,
                                      shell=True)
-        
+
     if (get_changeset.stderr.read() != ""):
         print "Error in obtaining current changeset of the Mercurial repository"
         changeset = None
-        
+
     changeset = get_changeset.stdout.read().strip()
     if (not re.search("^[0-9a-f]{12}", changeset)):
         print "Current changeset of the Mercurial repository is malformed"
@@ -135,19 +175,28 @@
 
     return changeset
 
+
+class my_build(np_build.build):
+    def run(self):
+        self.run_command("build_forthon")
+        np_build.build.run(self)
+
+
 class my_build_py(build_py):
     def run(self):
         # honor the --dry-run flag
         if not self.dry_run:
-            target_dir = os.path.join(self.build_lib,'yt')
-            src_dir =  os.getcwd() 
+            target_dir = os.path.join(self.build_lib, 'yt')
+            src_dir = os.getcwd()
             changeset = get_mercurial_changeset_id(src_dir)
             self.mkpath(target_dir)
             with open(os.path.join(target_dir, '__hg_version__.py'), 'w') as fobj:
                 fobj.write("hg_version = '%s'\n" % changeset)
 
+            self.run_command("build_forthon")
             build_py.run(self)
 
+
 def configuration(parent_package='', top_path=None):
     from numpy.distutils.misc_util import Configuration
 
@@ -158,7 +207,7 @@
                        quiet=True)
 
     config.make_config_py()
-    #config.make_svn_version_py()
+    # config.make_svn_version_py()
     config.add_subpackage('yt', 'yt')
     config.add_scripts("scripts/*")
 
@@ -176,25 +225,25 @@
                     + "simulations, focusing on Adaptive Mesh Refinement data "
                       "from Enzo, Orion, FLASH, and others.",
         classifiers=["Development Status :: 5 - Production/Stable",
-            "Environment :: Console",
-            "Intended Audience :: Science/Research",
-            "License :: OSI Approved :: GNU General Public License (GPL)",
-            "Operating System :: MacOS :: MacOS X",
-            "Operating System :: POSIX :: AIX",
-            "Operating System :: POSIX :: Linux",
-            "Programming Language :: C",
-            "Programming Language :: Python",
-            "Topic :: Scientific/Engineering :: Astronomy",
-            "Topic :: Scientific/Engineering :: Physics",
-            "Topic :: Scientific/Engineering :: Visualization"],
-        keywords='astronomy astrophysics visualization ' + \
-            'amr adaptivemeshrefinement',
+                     "Environment :: Console",
+                     "Intended Audience :: Science/Research",
+                     "License :: OSI Approved :: GNU General Public License (GPL)",
+                     "Operating System :: MacOS :: MacOS X",
+                     "Operating System :: POSIX :: AIX",
+                     "Operating System :: POSIX :: Linux",
+                     "Programming Language :: C",
+                     "Programming Language :: Python",
+                     "Topic :: Scientific/Engineering :: Astronomy",
+                     "Topic :: Scientific/Engineering :: Physics",
+                     "Topic :: Scientific/Engineering :: Visualization"],
+        keywords='astronomy astrophysics visualization ' +
+        'amr adaptivemeshrefinement',
         entry_points={'console_scripts': [
-                            'yt = yt.utilities.command_line:run_main',
-                      ],
-                      'nose.plugins.0.10': [
-                            'answer-testing = yt.utilities.answer_testing.framework:AnswerTesting'
-                      ]
+        'yt = yt.utilities.command_line:run_main',
+        ],
+            'nose.plugins.0.10': [
+                'answer-testing = yt.utilities.answer_testing.framework:AnswerTesting'
+            ]
         },
         author="Matthew J. Turk",
         author_email="matthewturk at gmail.com",
@@ -203,8 +252,9 @@
         configuration=configuration,
         zip_safe=False,
         data_files=REASON_FILES,
-        cmdclass = {'build_py': my_build_py},
-        )
+        cmdclass={'build_py': my_build_py, 'build_forthon': BuildForthon,
+                  'build': my_build},
+    )
     return
 
 if __name__ == '__main__':


https://bitbucket.org/yt_analysis/yt/commits/854c989b9301/
changeset:   854c989b9301
branch:      yt
user:        xarthisius
date:        2013-02-21 13:41:36
summary:     [install_script] manual build step for kD-tree module in no longer necessary
affected #:  1 file

diff -r 8ed119eea298b5561af7cecc44dc5193f1906a7d -r 854c989b9301dddcefc43c15570297a1646d71b9 doc/install_script.sh
--- a/doc/install_script.sh
+++ b/doc/install_script.sh
@@ -837,11 +837,6 @@
 cd $YT_DIR
 ( ${HG_EXEC} pull 2>1 && ${HG_EXEC} up -C 2>1 ${BRANCH} 2>&1 ) 1>> ${LOG_FILE}
 
-echo "Building Fortran kD-tree module."
-cd yt/utilities/kdtree
-( make 2>&1 ) 1>> ${LOG_FILE}
-cd ../../..
-
 echo "Installing yt"
 echo $HDF5_DIR > hdf5.cfg
 [ $INST_PNG -eq 1 ] && echo $PNG_DIR > png.cfg


https://bitbucket.org/yt_analysis/yt/commits/04d29ad4c959/
changeset:   04d29ad4c959
branch:      yt
user:        xarthisius
date:        2013-02-26 07:23:08
summary:     [setup.py] use empty list instead of tuple() for user_options in build_forthon phase. Thanks to Stephen Skory for pointing this out
affected #:  1 file

diff -r 854c989b9301dddcefc43c15570297a1646d71b9 -r 04d29ad4c9596dd02123c3e975069b3ff83f5f94 setup.py
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,7 @@
     """Command for building Forthon modules"""
 
     description = "Build Forthon modules"
-    user_options = tuple()
+    user_options = []
 
     def initialize_options(self):
 


https://bitbucket.org/yt_analysis/yt/commits/e129d975023d/
changeset:   e129d975023d
branch:      yt
user:        xarthisius
date:        2013-02-26 18:21:35
summary:     Add Forthon related bits to subcommands of build and install that are always called during install/develop
affected #:  2 files

diff -r 04d29ad4c9596dd02123c3e975069b3ff83f5f94 -r e129d975023d6c9f7bf73f9d09b7c633521643aa setup.py
--- a/setup.py
+++ b/setup.py
@@ -10,8 +10,8 @@
 distribute_setup.use_setuptools()
 
 from distutils.command.build_py import build_py
-from numpy.distutils.command import build as np_build
 from numpy.distutils.misc_util import appendpath
+from numpy.distutils.command import install_data as np_install_data
 from numpy.distutils import log
 from distutils import version
 
@@ -176,12 +176,19 @@
     return changeset
 
 
-class my_build(np_build.build):
+class my_build_src(build_src.build_src):
     def run(self):
         self.run_command("build_forthon")
-        np_build.build.run(self)
+        build_src.build_src.run(self)
 
 
+class my_install_data(np_install_data.install_data):
+    def run(self):
+        self.distribution.data_files.append(
+            ('yt/utilities/kdtree', ['yt/utilities/kdtree/fKDpy.so'])
+        )
+        np_install_data.install_data.run(self)
+
 class my_build_py(build_py):
     def run(self):
         # honor the --dry-run flag
@@ -193,7 +200,6 @@
             with open(os.path.join(target_dir, '__hg_version__.py'), 'w') as fobj:
                 fobj.write("hg_version = '%s'\n" % changeset)
 
-            self.run_command("build_forthon")
             build_py.run(self)
 
 
@@ -253,7 +259,7 @@
         zip_safe=False,
         data_files=REASON_FILES,
         cmdclass={'build_py': my_build_py, 'build_forthon': BuildForthon,
-                  'build': my_build},
+                  'build_src': my_build_src, 'install_data': my_install_data},
     )
     return
 

diff -r 04d29ad4c9596dd02123c3e975069b3ff83f5f94 -r e129d975023d6c9f7bf73f9d09b7c633521643aa yt/utilities/setup.py
--- a/yt/utilities/setup.py
+++ b/yt/utilities/setup.py
@@ -50,7 +50,6 @@
     config.add_subpackage("answer_testing")
     config.add_subpackage("delaunay")  # From SciPy, written by Robert Kern
     config.add_subpackage("kdtree")
-    config.add_data_files(('kdtree', ['kdtree/fKDpy.so']))
     config.add_subpackage("spatial")
     config.add_subpackage("grid_data_format")
     config.add_subpackage("parallel_tools")


https://bitbucket.org/yt_analysis/yt/commits/2d62796bc721/
changeset:   2d62796bc721
branch:      yt
user:        sskory
date:        2013-02-27 16:46:57
summary:     Merged in xarthisius/yt (pull request #441)

[setup.py] build fKD.so when 'build' or 'install' is called, pep8. Fixes #506
affected #:  3 files
Diff not available.

Repository URL: https://bitbucket.org/yt_analysis/yt/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list