Skip to content

Commit

Permalink
Merge pull request #457 from skirpichev/pytest6
Browse files Browse the repository at this point in the history
Port some tests to pytest framework (step 6, the last)
  • Loading branch information
casevh authored Nov 27, 2023
2 parents 2183205 + 1da53e7 commit e34324a
Show file tree
Hide file tree
Showing 14 changed files with 1,562 additions and 2,452 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
CIBW_SKIP: pp*
CIBW_BEFORE_BUILD: bash scripts/before_ci_build.sh
CIBW_TEST_EXTRAS: tests
CIBW_TEST_COMMAND: python {package}/test/runtests.py
CIBW_TEST_COMMAND: pytest {package}/test/

- uses: actions/upload-artifact@v3
with:
Expand All @@ -45,7 +45,7 @@ jobs:
CIBW_SKIP: pp*
CIBW_ARCHS_MACOS: arm64
CIBW_TEST_EXTRAS: tests
CIBW_TEST_COMMAND: python {package}/test/runtests.py
CIBW_TEST_COMMAND: pytest {package}/test/

- uses: actions/upload-artifact@v3
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pip_install_gmpy2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
allow-prereleases: true
- run: pip install --upgrade pip
- run: pip --verbose install --editable .[tests]
- run: python test/runtests.py
- run: pytest test/
- run: PYTHONPATH=`pwd`/gmpy2 python test_cython/runtests.py
if: ${{ matrix.python-version != '3.13' }}

Expand All @@ -44,7 +44,7 @@ jobs:
pip --verbose install --editable .[docs,tests]
- name: Tests
run: |
python test/runtests.py
pytest test/
PYTHONPATH=`pwd`/gmpy2 python test_cython/runtests.py
- name: Building docs
if: matrix.python-version == 3.11
Expand All @@ -59,7 +59,7 @@ jobs:
pip uninstall -y gmpy2
python setup.py clean
CFLAGS="-coverage" python setup.py develop
python test/runtests.py
pytest test/
PYTHONPATH=`pwd`/gmpy2 python test_cython/runtests.py
lcov --capture --directory . --no-external --output-file build/coverage.info
genhtml build/coverage.info --output-directory build/coverage
Expand Down Expand Up @@ -103,5 +103,5 @@ jobs:
python-pip
- run: pip install --upgrade pip
- run: pip --verbose install -e .[tests]
- run: python test/runtests.py
- run: pytest test/
- run: PYTHONPATH=`pwd`/gmpy2 python test_cython/runtests.py
31 changes: 31 additions & 0 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,34 @@ on PyPI. You can install latest release with pip::
or some specific version with::

pip install gmpy2==2.1.5

If pre-compiled binary wheels aren't available for your platform, the pip will
fallback to installation from sources. In this case you will need to have
required libraries (GMP, MPFR and MPC) already installed on your system, along
with the include files for those libraries. On Debian you can install them
systed-wide with::

sudo apt install libgmp-dev libmpfr-dev libmpc-dev

.. tip::

On Windows we recommend using `MSYS2 <https://www.msys2.org/>`_ to build
the gmpy2 from sources. To install required dependencies before, run::

pacman -S gcc gmp-devel mpfr-devel mpc-devel python-setuptools python-pip

From Sources
------------

If you are a developer or like to get the latest updates as they come, be sure
to install from the git repository and include required extra dependencies,
for example the optional "tests" list, which include packages required
for testing::

git clone git://github.com/aleaxit/gmpy.git
cd gmpy
pip install -e .[tests]

Next you may want to run full set of unit tests to make sure everything works::

pytest test/
62 changes: 0 additions & 62 deletions test/runtests.py

This file was deleted.

Loading

0 comments on commit e34324a

Please sign in to comment.