From d208e50d25790eca27c193403e583c35d9b9bb7a Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sun, 23 Dec 2018 16:29:33 +0300 Subject: [PATCH 1/2] Add optional gmpy deps & run tests with gmpy --- .github/workflows/test.yml | 9 ++++++++- setup.cfg | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3ec6bf4..2f3e9abc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,16 +12,23 @@ jobs: uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Install libs + run: | + sudo apt update + sudo apt install libmpc-dev - name: Install dependencies run: | pip install --upgrade --force-reinstall setuptools pip - pip install --upgrade .[develop] + pip install --upgrade .[develop,gmpy] - name: Linting with pycodestyle, etc run: | python -We:invalid -m compileall -f mpmath -q pycodestyle - name: Tests run: pytest + - name: Remove gmpy on 2.7 + if: matrix.python-version == 2.7 + run: pip uninstall -y gmpy2 - name: Run coverage tests & upload results env: PYTEST_ADDOPTS: --cov mpmath diff --git a/setup.cfg b/setup.cfg index a9144bdd..a7efb35b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,6 +36,8 @@ develop = %(tests)s pytest-cov codecov wheel +gmpy = + gmpy2>=2.1.0a4; platform_python_implementation!="PyPy" [pycodestyle] select = E101,W191,W291,W293,E111,E112,E113,W292,W391 exclude = .eggs,.git From 2eb4c5eba70ecd5f697ded7cd61ce51ead2955ee Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Tue, 2 Mar 2021 17:55:09 +0300 Subject: [PATCH 2/2] Drop support for CPython 3.4 Reason: test failure for the master. GA has no such version support anymore, e.g.: https://github.com/fredrik-johansson/mpmath/runs/2005546465 --- .github/workflows/test.yml | 2 +- README.rst | 4 ++-- mpmath/matrices/matrices.py | 2 +- mpmath/tests/test_matrices.py | 4 ++-- setup.cfg | 1 - 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f3e9abc..d9b100f9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10-dev, pypy2, pypy3] + python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10-dev, pypy2, pypy3] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} diff --git a/README.rst b/README.rst index d05de49a..c9409e54 100644 --- a/README.rst +++ b/README.rst @@ -108,8 +108,8 @@ Release history: 1. Download & installation -------------------------- -Mpmath requires Python 2.7 or 3.4 (or later versions). It has been tested -with CPython 2.7, 3.4 through 3.7 and for PyPy. +Mpmath requires Python 2.7 or 3.5 (or later versions). It has been tested +with CPython 2.7, 3.5 through 3.7 and for PyPy. The latest release of mpmath can be downloaded from the mpmath website and from https://github.com/fredrik-johansson/mpmath/releases diff --git a/mpmath/matrices/matrices.py b/mpmath/matrices/matrices.py index 94bdd0a3..a97d5a9c 100644 --- a/mpmath/matrices/matrices.py +++ b/mpmath/matrices/matrices.py @@ -206,7 +206,7 @@ class _matrix(object): .. COMMENT: TODO: the above "doctest:+SKIP" may be removed as soon as we - have dropped support for Python 3.4 and below. + have dropped support for Python 3.5 and below. You can raise powers of square matrices:: diff --git a/mpmath/tests/test_matrices.py b/mpmath/tests/test_matrices.py index 49d03af9..1547b906 100644 --- a/mpmath/tests/test_matrices.py +++ b/mpmath/tests/test_matrices.py @@ -52,9 +52,9 @@ def test_matrix_basic(): def test_matmul(): """ Test the PEP465 "@" matrix multiplication syntax. - To avoid syntax errors when importing this file in Python 3.4 and below, we have to use exec() - sorry for that. + To avoid syntax errors when importing this file in Python 3.5 and below, we have to use exec() - sorry for that. """ - # TODO remove exec() wrapper as soon as we drop support for Python <= 3.4 + # TODO remove exec() wrapper as soon as we drop support for Python <= 3.5 if sys.hexversion < 0x30500f0: # we are on Python < 3.5 pytest.skip("'@' (__matmul__) is only supported in Python 3.5 or newer") diff --git a/setup.cfg b/setup.cfg index a7efb35b..dc361ca0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,7 +13,6 @@ classifiers = License :: OSI Approved :: BSD License Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 - Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7