From b70c95ee4fa9b7a79f3fde0c26ded2e1d4c6f492 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Tue, 8 Aug 2023 21:48:11 +0100 Subject: [PATCH 1/3] Bump version to 0.4.0 --- MANIFEST.in | 7 +++-- README.md | 4 ++- bin/activate | 1 - bin/build_mingw64_wheel.sh | 4 +-- doc/source/conf.py | 4 +-- doc/source/setup.rst | 57 ++++++++++++++++++++++++++++++++++---- setup.py | 2 +- 7 files changed, 63 insertions(+), 16 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 17dc6b1b..8554fdff 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,9 +1,10 @@ include LICENSE include CHANGES include README -include src/*.pxd -include src/*.pyx -include src/*.py +include src/flint/*.pxd +include src/flint/*.pyx +include src/flint/*.py +include test/*.py include doc/source/*.py include doc/source/*.rst include doc/Makefile diff --git a/README.md b/README.md index 71ef4c5d..1fe3c28e 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,9 @@ as follows: pip install . See the documentation for further notes on building and installing -Python-FLINT. +Python-FLINT: + + https://fredrikj.net/python-flint/setup.html Examples ------------------------------------- diff --git a/bin/activate b/bin/activate index 1c9a9b6e..83f5d452 100644 --- a/bin/activate +++ b/bin/activate @@ -2,4 +2,3 @@ export C_INCLUDE_PATH=$(pwd)/.local/include export LIBRARY_PATH=$(pwd)/.local/lib export LD_LIBRARY_PATH=$(pwd)/.local/lib export PYTHONPATH=$(pwd)/src -source .local/venv/bin/activate diff --git a/bin/build_mingw64_wheel.sh b/bin/build_mingw64_wheel.sh index 7c239a09..bd8eae80 100755 --- a/bin/build_mingw64_wheel.sh +++ b/bin/build_mingw64_wheel.sh @@ -44,7 +44,7 @@ fi PYTHON=$PYTHONDIR/python VER="${PYTHONVER//./}" -WHEELNAME=python_flint-0.3.0-cp$VER-cp$VER-win_amd64.whl +WHEELNAME=python_flint-0.4.0-cp$VER-cp$VER-win_amd64.whl $PYTHON -c 'print("hello world")' @@ -90,7 +90,7 @@ wheel pack python_flint-* cd .. # Make the wheel relocatable -delvewheel repair dist/python_flint-0.3.0-cp$VER-cp$VER-win_amd64.whl \ +delvewheel repair dist/python_flint-0.4.0-cp$VER-cp$VER-win_amd64.whl \ --add-path .local/bin:.local/lib/ # Make a virtual enironment to test the wheel diff --git a/doc/source/conf.py b/doc/source/conf.py index 73b14b84..c2ae42cc 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -51,9 +51,9 @@ # built documents. # # The short X.Y version. -version = '0.3.0' +version = '0.4.0' # The full version, including alpha/beta/rc tags. -release = '0.3.0' +release = '0.4.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/setup.rst b/doc/source/setup.rst index 68d875d7..e4389152 100644 --- a/doc/source/setup.rst +++ b/doc/source/setup.rst @@ -1,7 +1,7 @@ Setup =============================================================================== -First install both FLINT (version 2.5 or later) and Arb (version 2.16 or later). +First install both FLINT (version 2.9 or later) and Arb (version 2.23 or later). See: * http://flintlib.org/ @@ -13,7 +13,13 @@ The latest release can be installed using:: pip install python-flint -Python-FLINT is also available on conda-forge +Binary wheels are provided for Windows amd64, Linux (manylinux 2_17) x86_64, +macOS x86_64 and macOS arm64. For other platforms, pip will attempt to build +Python-FLINT from source which requires a C compiler and the FLINT and Arb +header files and library files (libflint.so and libarb.so) to be available as +well as the Python development headers and Cython and numpy. + +Python-FLINT is also available on conda-forge for Linux and macOS. (https://anaconda.org/conda-forge/python-flint). It can be installed using:: @@ -24,19 +30,20 @@ as follows:: pip install . -To build Python-FLINT manually, you may first have to install -some build dependencies:: +To build Python-FLINT manually, you first need to install some build +dependencies:: - sudo apt-get install cython python-dev + pip install Cython numpy Then run:: python setup.py build_ext - sudo python setup.py install + python setup.py install Run the test suite:: python test/test.py + python test/dtest.py Build the documentation:: @@ -59,3 +66,41 @@ where to find the library files using something like:: export LD_LIBRARY_PATH=/home/fredrik/src/flint2:/home/fredrik/src/arb:$LD_LIBRARY_PATH +Build all dependencies from source +---------------------------------- + +From a VCS checkout, to build python-flint and all dependencies from source, +using the exact versions that are tested in CI and used for the binary PyPI +wheels, run the following in a unix shell:: + + source bin/activate + bin/build_dependencies_unix.sh + +The script will download and build GMP, MPFR, FLINT and Arb and build them all +in a ``.local`` directory. The ``bin/activate`` script sets the appropriate +path environment variables for C headers and libraries which is needed for +the ``build_dependencies_unix.sh`` script to work. After running the script, +you can then build Python-FLINT in place with:: + + python setup.py build_ext --in-place + +and run the test suite with:: + + python test/test.py + python test/dtest.py + +This way of building Python-FLINT depends on the ``bin/activate`` script to +locate the shared libraries at runtime. The script will also set ``PYTHONPATH`` +so that the in-place build of Python-FLINT can be imported. + +These steps will also work under MinGW with the mingw64 toolchain, but you +should first run:: + + echo '[build]' > setup.cfg + echo 'compiler = mingw32' >> setup.cfg + + # Install the mingw-w64 toolchain + pacman -S --noconfirm mingw-w64-x86_64-gcc m4 make mingw-w64-x86_64-tools-git + +To change the versions of the dependencies that are built, edit the +``bin/build_variables.sh`` script. diff --git a/setup.py b/setup.py index cdd19c99..0ad57646 100644 --- a/setup.py +++ b/setup.py @@ -78,7 +78,7 @@ packages=['flint'], package_dir={'': 'src'}, description='Bindings for FLINT and Arb', - version='0.3.0', + version='0.4.0', url='https://github.com/python-flint/python-flint', author='Fredrik Johansson', author_email='fredrik.johansson@gmail.com', From a01783bea1bbe6a0cc9e2bf6d12c45c4fb1bb9ea Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Tue, 8 Aug 2023 21:52:31 +0100 Subject: [PATCH 2/3] Add __version__ --- src/flint/__init__.py | 2 ++ test/test.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/flint/__init__.py b/src/flint/__init__.py index 3e042394..42d566bf 100644 --- a/src/flint/__init__.py +++ b/src/flint/__init__.py @@ -1 +1,3 @@ from ._flint import * + +__version__ = '0.4.0' diff --git a/test/test.py b/test/test.py index bb626590..55cbfe7f 100644 --- a/test/test.py +++ b/test/test.py @@ -29,6 +29,9 @@ def raises(f, exception): """ def test_pyflint(): + + assert flint.__version__ == "0.4.0" + ctx = flint.ctx assert str(ctx) == repr(ctx) == _default_ctx_string assert ctx.prec == 53 From 17033b5fcbf29b7ad653a82af9f496f102f68e2c Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Tue, 8 Aug 2023 21:59:32 +0100 Subject: [PATCH 3/3] Skip Arb tests --- bin/build_dependencies_unix.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/build_dependencies_unix.sh b/bin/build_dependencies_unix.sh index ade0d8a9..5d9ede5a 100755 --- a/bin/build_dependencies_unix.sh +++ b/bin/build_dependencies_unix.sh @@ -232,7 +232,8 @@ cd arb-$ARBVER # PATH=$PATH:$PREFIX/lib:$PREFIX/bin \ ARB_TEST_MULTIPLIER=0.1 \ - make check + # Skip Arb tests now because they are slow. + # make check cd .. # ------------------------------------------------------------------------- #