Skip to content

Commit

Permalink
TST, MAINT: adjustments for pytest 5.0
Browse files Browse the repository at this point in the history
* prefer importlib over imp to avoid deprecation warnings
since master branch no longer has a support burden for Python 2

* pytest-faulthandler can be removed from infrastructure and
docs because it has been merged into pytest core now
  • Loading branch information
tylerjereddy committed Jun 30, 2019
1 parent 5e2b435 commit ecdd489
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ before_install:
- travis_retry pip install --upgrade pip setuptools wheel
- travis_retry pip install cython
- if [ -n "$NUMPYSPEC" ]; then travis_retry pip install $NUMPYSPEC; fi
- travis_retry pip install --upgrade pytest pytest-xdist pytest-faulthandler mpmath argparse Pillow codecov
- travis_retry pip install --upgrade pytest pytest-xdist mpmath argparse Pillow codecov
- travis_retry pip install gmpy2 # speeds up mpmath (scipy.special tests)
- travis_retry pip install pybind11
- |
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.6 get-pip.py && \
pip3 --version && \
pip3 install setuptools wheel numpy cython==0.29.2 pybind11 pytest pytest-timeout pytest-xdist pytest-env pytest-faulthandler pytest-cov Pillow mpmath matplotlib --user && \
pip3 install setuptools wheel numpy cython==0.29.2 pybind11 pytest pytest-timeout pytest-xdist pytest-env pytest-cov Pillow mpmath matplotlib --user && \
apt-get -y install gfortran-5 wget && \
cd .. && \
mkdir openblas && cd openblas && \
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
choco install -y mingw --force --version=6.4.0
displayName: 'Install 64-bit mingw for 64-bit builds'
condition: eq(variables['BITS'], 64)
- script: python -m pip install numpy cython==0.29.2 pybind11 pytest pytest-timeout pytest-xdist pytest-env pytest-faulthandler pytest-cov Pillow mpmath matplotlib
- script: python -m pip install numpy cython==0.29.2 pybind11 pytest pytest-timeout pytest-xdist pytest-env pytest-cov Pillow mpmath matplotlib
displayName: 'Install dependencies'
- powershell: |
If ($(BITS) -eq 32) {
Expand Down
2 changes: 1 addition & 1 deletion doc/source/building/windows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ not be used. Attempting to build with the MSYS2 Python will not work correctly.*
.. code:: shell
/c/Users/<user name>/AppData/Local/Programs/Python/Python36/python.exe \
-m pip install numpy>=1.14.0 cython pytest pytest-xdist pytest-faulthandler
-m pip install numpy>=1.14.0 cython pytest pytest-xdist
Please note that this is a simpler procedure than what is used for the official binaries.
**Your binaries will only work with the latest NumPy (v1.14.0dev and higher)**. For
Expand Down
11 changes: 9 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,15 @@ def get_version_info():
elif os.path.exists('scipy/version.py'):
# must be a source distribution, use existing version file
# load it as a separate module to not load scipy/__init__.py
import imp
version = imp.load_source('scipy.version', 'scipy/version.py')
# based on approach described in python-ideas
# https://mail.python.org/pipermail/python-ideas/2014-December/030265.html
import importlib
module_name = 'scipy.version'
path = 'scipy/version.py'
loader = importlib.machinery.SourceFileLoader(module_name, path)
spec = importlib.machinery.ModuleSpec(module_name, loader, origin=path)
module = importlib.util.module_from_spec(spec)
version = loader.exec_module(module)
GIT_REVISION = version.git_revision
else:
GIT_REVISION = "Unknown"
Expand Down
1 change: 0 additions & 1 deletion tools/ci/appveyor/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ pytest
pytest-timeout
pytest-xdist
pytest-env
pytest-faulthandler
Pillow
mpmath
matplotlib

0 comments on commit ecdd489

Please sign in to comment.