summaryrefslogtreecommitdiff
path: root/numpy/distutils/misc_util.py
Commit message (Collapse)AuthorAgeFilesLines
...
| * 2to3: Apply `imports` fixer.Charles Harris2013-04-021-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `imports` fixer deals with the standard packages that have been renamed, removed, or methods that have moved. cPickle -- removed, use pickle commands -- removed, getoutput, getstatusoutput moved to subprocess urlparse -- removed, urlparse moved to urllib.parse cStringIO -- removed, use StringIO or io.StringIO copy_reg -- renamed copyreg _winreg -- renamed winreg ConfigParser -- renamed configparser __builtin__ -- renamed builtins In the case of `cPickle`, it is imported as `pickle` when python < 3 and performance may be a consideration, but otherwise plain old `pickle` is used. Dealing with `StringIO` is a bit tricky. There is an `io.StringIO` function in the `io` module, available since Python 2.6, but it expects unicode whereas `StringIO.StringIO` expects ascii. The Python 3 equivalent is then `io.BytesIO`. What I have done here is used BytesIO for anything that is emulating a file for testing purposes. That is more explicit than using a redefined StringIO as was done before we dropped support for Python 2.4 and 2.5. Closes #3180.
* | Merge pull request #460 from endolith/regex_formattingCharles Harris2013-04-031-30/+30
|\ \ | |/ |/| DOC: Formatting fixes using regex
| * DOC: Used regex to find colons missing spaces which render wrong online, ↵endolith2013-03-191-30/+30
| | | | | | | | also other spacing or formatting mistakes
* | 2to3: Use absolute imports.Charles Harris2013-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new import `absolute_import` is added the `from __future__ import` statement and The 2to3 `import` fixer is run to make the imports compatible. There are several things that need to be dealt with to make this work. 1) Files meant to be run as scripts run in a different environment than files imported as part of a package, and so changes to those files need to be skipped. The affected script files are: * all setup.py files * numpy/core/code_generators/generate_umath.py * numpy/core/code_generators/generate_numpy_api.py * numpy/core/code_generators/generate_ufunc_api.py 2) Some imported modules are not available as they are created during the build process and consequently 2to3 is unable to handle them correctly. Files that import those modules need a bit of extra work. The affected files are: * core/__init__.py, * core/numeric.py, * core/_internal.py, * core/arrayprint.py, * core/fromnumeric.py, * numpy/__init__.py, * lib/npyio.py, * lib/function_base.py, * fft/fftpack.py, * random/__init__.py Closes #3172
* | 2to3: Replace xrange by range and use list(range(...)) where neededCharles Harris2013-03-271-1/+1
|/ | | | | | | | | | | | | | | In python3 range is an iterator and `xrange` has been removed. This has two consequence for code: 1) Where a list is needed `list(range(...))` must be used. 2) `xrange` must be replaced by `range` Both of these changes also work in python2 and this patch makes both. There are three places fixed that do not need it, but I left them in so that the result would be `xrange` clean. Closes #3092
* 2to3: Remove xreadlines and replace f.readlines() by f where valid.Charles Harris2013-03-051-3/+2
| | | | | | | | | | An open file `f` has been an iterator since python2.3 and `f.xreadlines()` is no longer needed, so replace it with `f`. Also replace `f.readlines()` with `f` where an iterator will do. The replacement of `f.readlines()` is not critical because it is a list in both python2 and python3, but the code is a bit cleaner. Closes #3093
* 2to3: Put `from __future__ import division in every python file.Charles Harris2013-03-011-0/+2
| | | | | | | | This should be harmless, as we already are division clean. However, placement of this import takes some care. In the future a script can be used to append new features without worry, at least until such time as it exceeds a single line. Having that ability will make it easier to deal with absolute imports and printing updates.
* Merge pull request #3056 from charris/2to3-filterCharles Harris2013-03-011-4/+4
|\ | | | | 2to3: Apply `filter` fixes. Closes #3053.
| * REF: Replace filters with list comprehensions.Charles Harris2013-02-281-4/+4
| | | | | | | | | | | | 2to3 does a lot of list(filter(...)) sort of thing which can be avoided by using list comprehensions instead of filters. This also seems to clarify the code to a considerable degree.
| * 2to3: Apply `filter` fixes. Closes #3053.Charles Harris2013-02-281-4/+4
| | | | | | | | | | Generally, this involves using list comprehension, or explicit list construction as `filter` is an iterator in Python 3.
* | 2to3: Apply `funcattrs` fixer. Closes #3058.Charles Harris2013-02-281-1/+1
|/ | | | | This replaces the `b.func_xxxx` with newer `__xxxx__` attribute names For example, `f.__name__` replaces `f.func_name`
* DEP: Remove scons related files and code.Charles Harris2013-01-131-151/+1
| | | | | | | | | This removes files and code supporting scons builds. After this change numpy will only support builds using distutils or bento. The removal of scons has been discussed on the list several times and a decision has been made that scons support is no longer needed. This was originally discussed for numpy 1.7 and because the distutils and bento methods are still available we are skipping the usual deprecation period.
* Include msvcr100 (MSVC v10 aka 2010) in msvc_runtime_library()peterjc2012-11-121-0/+1
|
* FIX: remove log line causing warning from disutilsMatthew Brett2012-10-061-2/+0
| | | | | | | | | | | | | Using numpy.distutils through easy_install caused a RuntimeWarning because of a failed import of numpy.distutils. Discussion here: http://thread.gmane.org/gmane.comp.python.numeric.general/51719 The conclusion seemed to be that the safest fix is to remove the one line of logging in the relevant callback. Thanks to Ralf Gommers for the suggestion.
* ENH: Introduce new options extra_f77_compile_args and extra_f90_compile_args toPearu Peterson2011-08-201-0/+6
| | | | | | Configuration.add_extension. Configuration.add_library, and Extension. These options allow specifying extra compile options for compiling Fortran sources within a setup.py file.
* BUG: Revert commit that causes many tests not to run.Charles Harris2011-08-201-6/+0
| | | | | | Revert "Introduce new options extra_f77_compiler_args and extra_f90_compiler_args to Configuration.add_extension. Configuration.add_library, and Extension. These options allow specifying extra compile options for compiling Fortran sources within a setup.py file." This reverts commit 43862759384a86cb4a95e8adb4d39fa1522acb28.
* Introduce new options extra_f77_compiler_args and extra_f90_compiler_args to ↵Pearu Peterson2011-08-161-0/+6
| | | | Configuration.add_extension. Configuration.add_library, and Extension. These options allow specifying extra compile options for compiling Fortran sources within a setup.py file.
* BUG: deal with shared lib extension in a single place. Fix ctypes.load_library.rgommers2011-06-231-12/+42
| | | | | This is related to PEP 3149, tags in shared library extensions. Only applies to Linux (for now). See also #1749.
* STY: Replace remaining old style classes with classes subclassing object.Charles Harris2011-04-051-1/+1
|
* numpy.distutils: Fixed bug in Configuration._get_svn_revision. Introduced ↵Pearu Peterson2010-07-271-3/+95
| | | | make_hg_version_py method, get_version supports hg revision.
* BUG: distutils: clean up temporary files more aggressivelyPauli Virtanen2010-03-061-1/+2
|
* updated docstrings from pydoc website (thanks to everyone who contributed!)Jarrod Millman2010-02-171-5/+7
|
* BUG: Add more protection against uninitialized lists on the Distribution object.Robert Kern2010-01-291-0/+6
|
* BUG: guard against having an uninitialized list of scripts.Robert Kern2010-01-291-0/+2
|
* fixed a whole bunch of doctestsPaul Ivanov2009-12-281-8/+8
|
* 3K: distutils: produce a 3K-compatible __config__.pyPauli Virtanen2009-12-061-7/+6
|
* Do no use has_key in misc_utils.David Cournapeau2009-12-031-2/+2
|
* Fix callable in misc_utils.David Cournapeau2009-12-031-2/+2
|
* python3 changes function object attributes names.David Cournapeau2009-12-031-2/+12
|
* Py3k fix for misc_util.David Cournapeau2009-12-031-24/+27
|
* BUG: (#1221) special case mac os x in numpyconfig.hDavid Cournapeau2009-11-271-3/+3
| | | | | | | | | | Universal builds break the configure stage: we have to harcode the arch-specific values in the case of mac os x, as we have only one configuration stage per compile, but several arch per compile with the braindead -arch machinery. We rename the old numpyconfig.h to a private header, and numpyconfig.h itself post-fix the values in the case of mac os x.
* BUG: import DistutilsError.David Cournapeau2009-11-271-0/+2
|
* DOC: fix wrong Example section.David Cournapeau2009-11-201-2/+2
|
* first set of checkins from the doc editorJarrod Millman2009-11-131-71/+172
|
* Add a pkg_path option to add_sconcript.David Cournapeau2009-10-011-3/+10
| | | | | This is necessary to handle some cases where scons scripts and packages are not in the same directory.
* Put scons data into its own class.David Cournapeau2009-10-011-10/+14
|
* Fix imports in get_pkg_info/get_info.David Cournapeau2009-07-261-2/+2
|
* Split up get_info so that we get a function which returns the LibraryInfo ↵David Cournapeau2009-07-261-10/+34
| | | | directly - we can feed that to scons easily.
* BUG: Fix missing return stmt in get_npy_pkg_dir.David Cournapeau2009-07-261-0/+1
|
* 'Merge' docstring and reference guide for Distribution methods documentation.David Cournapeau2009-07-261-44/+297
|
* Use automethod for the functions we added to numpy.distutils.David Cournapeau2009-07-261-32/+50
|
* Add a dirs argument to get_info to look for npy-pkg-config files in ↵David Cournapeau2009-07-261-6/+24
| | | | additional directories.
* Fix add_installed_library so that install_dir is actually relatively to the ↵David Cournapeau2009-07-261-0/+2
| | | | current package.
* Add doc for add_installed_library and add_npy_pkg_config.David Cournapeau2009-07-261-6/+75
|
* Fix returned dict by get_info so that it works with add_extension.David Cournapeau2009-07-261-0/+6
|
* Fix get_config.David Cournapeau2009-07-261-4/+5
|
* Add add_installed_pkg_config function, for automatic pkg-config-like ↵David Cournapeau2009-07-261-1/+12
| | | | generation/handling.
* Raise a PkgNotFound exception in get_info if the package is not found.David Cournapeau2009-07-261-2/+9
|
* Add a function get_info to replace get_npymath_info, in a more generic way.David Cournapeau2009-07-261-10/+15
|
* Fix typo in add_library.David Cournapeau2009-07-261-1/+1
|