| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
`sys.base_prefix` was introduced in Python 3.3, so it will always be
available in supported versions of Python >= 3.3:
https://docs.python.org/3/library/sys.html#sys.base_prefix
As a result, `sys.real_prefix` will never be used in supported versions
of Python >= 3.3. Besides, it has been removed from recent versions of
virtualenv:
https://github.com/pypa/virtualenv/issues/1622
|
| |
|
| |
|
|
|
|
|
|
|
| |
The last GCC 3.x release before 4.0 was 3.4 which was released 2004,
so 17 years ago.
Removes all code only used with those old toolchains.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The comment in the original code came about because of the bug fixed in
gh-20155. The fixed subsequent clause should now give the correct
assembly version for the given Python.
In fact, the original clause matches the MSVC for Python 3.7.1:
```
PS C:\> .\Python37\python.exe .\io\check_versions.py
sys.version 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:57:15) [MSC v.1915 64 bit (AMD64)]
distutils build version 14.1
msvcrt.CRT_ASSEMBLY_VERSION 14.15.26726.0
```
|
|
|
|
|
| |
Original algorithm appended both character of minor version > 9, but the
string against which it is being matched, only uses the first character.
|
|
|
|
|
| |
The float representation of e.g. 14.2 is not exact, leading to a minor
version number of int(1.999999) == 1 in the original code.
|
|
|
|
| |
File may not be closed if an exception is raised.
|
| |
|
| |
|
|
|
|
|
|
| |
* MAINT: use list-based APIs to call subprocesses
* TST, MAINT: add a test for mingw32ccompiler.build_import, clean up lib2def
Co-authored-by: Matti Picus <matti.picus@gmail.com>
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
|
|
|
|
|
|
|
| |
* Cleanup unused imports (F401) of mostly standard Python modules,
or some internal but unlikely referenced modules
* Where internal imports are potentially used, mark with noqa
* Avoid redefinition of imports (F811)
|
| |
|
|
|
|
|
| |
As numpy is Python 3 only, these import statements are now unnecessary
and don't alter runtime behavior.
|
|
|
|
|
|
| |
This makes it easier to visually jump between functions.
A couple places have changed to not emit leading whitespace where they previously did. Since this is C code and not fortran, that doesn't matter.
|
|
|
|
| |
Both of these functions are better exposed through `distutils.ccompiler`, but neither are used anyway
|
| |
|
| |
|
|
|
|
|
| |
Closes gh-9839. Note that the second part of the patch there
was already fixed in commit 7a05f44ec.
|
|
|
|
|
|
| |
Issue was introduced in gh-8454.
Thanks to @jennirinker for pointing out the issue and fix. Closes gh-9553.
|
|
|
|
|
|
|
|
|
|
|
| |
If we are using the virtualenv module in Python 2.7 (as opposed to venv
in Python 3.3+), then the location of the base distribution is stored in
the real_prefix attribute instead of the base_prefix attribute.
This changeset adds the content of this attribute to the search paths if
it exist (i.e. in practice, if we are running Python 2.7), so that the
runtime libraries do not have to be duplicated in the virtualenv
directory.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original changeset 1c8ecc7 to make extensions compilable with MinGW
used the base_prefix attribute unconditionally. However, this is not
available in versions before Python 3.3.
This changeset introduces a check for whether the attribute is available
so that the code will work without errors also on Python 2.7. However,
this may lead to surprising results when compiling in a virtualenv.
Hat tip to Diorcet Yann (@diorcety) for pointing out this problem.
|
|
|
|
|
|
|
|
|
|
| |
If Python has been built using a different runtime, for example using
the GNU compiler in MSYS, the version string will of course not contain
a reference to the MSVC runtime. Instead of attempting to build an
import library for yet another runtime, we assume that the compiler
used to build the extension is now the same as was used to build Python,
and that it will pass the right runtime to the linker without any
further command-line options.
|
|
|
| |
MAINT: Fix building extensions with MinGW in WinPython 3.4
|
|
|
|
|
|
|
| |
In Python 3.6 a number of escape sequences that were previously accepted
-- for instance "\(" that was translated to "\\(" -- are deprecated. To
retain the previous behavior either raw strings must be used or the
backslash must be properly escaped itself.
|
|\
| |
| | |
Allow extensions to be built with MinGW in a virtualenv
|
| |
| |
| |
| |
| |
| |
| | |
The log class (derived from distutils.log) does string formatting with
extra arguments passed, if (and only if) the log level is above the set
threshold. That way, the cost of string formatting only incurs if the
message is actually going to be displayed.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If an extension is built in a virtualenv, the compiler adapter for the
MinGW distribution will search for the libs/ directory containing the
import libraries for the Python runtime, in the virtualenv. However,
these files are not copied when the virtualenv is created (using the
venv module), so the build fails.
This patch searches the base distribution directory for the libraries
in addition to the virtualenv, allowing extensions to be built without
manually copying the libs/ directory first.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The MinGW compiler adapter assumes that the C runtime library that
Python was built with has the name msvcrXXX. This is incorrect for
Python 3.5 and later. (The name of the runtime is now vcruntimeXXX).
This patch removes parsing of the hardcoded pattern and replaces it
with calls to new functions in misc_util that returns the desired
values directly, isolating the hardcoding to that module.
|
|/
|
|
|
|
|
|
|
| |
CygwinCCompiler has its own test for the C runtime library which raises
an error if the version extracted from the version string does not match
a pre-defined list. The runtime for Visual Studio 14 (aka 2015) which is
used to build Python 3.5 is not on this list. As this call is made in
the constructor of the base class, it must be monkey-patched to get
around.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Revert mingwpy modifications to distutils. They are causing problems
for non-windows builds and it is better to wait until mingypy is
further along.
This reverts commit 96abd32de241864ee97f30357234cbc9a96c43ae, reversing
changes made to 06af9918f6bf03b8d818ec834f9fb48db57d1489.
|
|
|
|
|
|
|
|
|
| |
Revert mingwpy modifications to distutils. They are causing problems
for non-windows builds and it is better to wait until mingypy is
further along.
This reverts commit cda64938eb150b1af6677db4754da3be5fd7e483, reversing
changes made to 8cb3ec6ab804f594daf553e53e7cf7478656bebd.
|
| |
|
|
|
|
|
|
| |
Break long lines.
Spaces around operators.
Remove dead code.
|
| |
|
|
|
|
|
|
|
| |
Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long
and will need to be broken at some point. OTOH, some lines were already
too long and need to be broken at some point. Now seems as good a time
as any to do this with open PRs at a minimum.
|
|
|
|
|
|
|
| |
Add `print_function` to all `from __future__ import ...` statements
and use the python3 print function syntax everywhere.
Closes #3078.
|
|\
| |
| | |
2to3: Apply `imports` fixer.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| |/
|/| |
DOC: Formatting fixes using regex
|
| |
| |
| |
| | |
also other spacing or formatting mistakes
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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: Put `from __future__ import division` in every python file.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
| |
Replaces old style `f.im_func` and `f.im_class` method attributes
with `f.__func__` and `f.__class__`. Closes #3070.
|
|
|
|
|
| |
This replaces the `b.func_xxxx` with newer `__xxxx__` attribute names
For example, `f.__name__` replaces `f.func_name`
|