Skip to content
Draft
Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
457e40a
Generate files into the build dir
tobiasdiez Aug 31, 2025
1268c3f
Fix autogen on Windows
tobiasdiez Aug 31, 2025
91474e8
Fix compilation on Windows
tobiasdiez Aug 31, 2025
d9c25ca
Add workaround for `#define long long long` in Pari
tobiasdiez Aug 31, 2025
f0c5062
Use less `paripriv`
tobiasdiez Aug 31, 2025
d6540c3
Activate pari compatibility hacks only for MSVC
tobiasdiez Aug 31, 2025
5cac4aa
Add small test script in Meson build to get Pari version
tobiasdiez Aug 31, 2025
f6a3a09
Fix CI
tobiasdiez Aug 31, 2025
e234cef
Add conda environments
tobiasdiez Aug 31, 2025
79cd73d
Fix tests
tobiasdiez Aug 31, 2025
97d8ead
Also build on Windows (CI)
tobiasdiez Aug 31, 2025
fd336b8
Improve install-pari script to reuse existing downloads
tobiasdiez Aug 31, 2025
51919af
Fix tests
tobiasdiez Aug 31, 2025
8a278cf
Also install wget
tobiasdiez Aug 31, 2025
2830da9
Execute windows stuff in msys2
tobiasdiez Aug 31, 2025
eef1139
Fix download url
tobiasdiez Aug 31, 2025
b656f6e
Try without explicit prefix
tobiasdiez Aug 31, 2025
c2dc48b
Fix dist workflow
tobiasdiez Aug 31, 2025
b3164ec
Enhance installation script for PARI on Windows
tobiasdiez Sep 1, 2025
d571259
Update PARI version for Windows jobs to 2.15.4
tobiasdiez Sep 1, 2025
cf96567
Fix tests on Linux, and fix compilation (partly) on my windows system
tobiasdiez Sep 1, 2025
20c2d77
Try with separate make targets on Win
tobiasdiez Sep 1, 2025
da95cdc
Fix msys checks
tobiasdiez Sep 1, 2025
e0d21ec
Another round of platform detection improvements
tobiasdiez Sep 1, 2025
feae01c
Fix installation on windows CI, maybe?
tobiasdiez Sep 1, 2025
0344b1d
Switch to correct build folder for subsequent make targets
tobiasdiez Sep 1, 2025
a5623d0
Don't build exe on windows
tobiasdiez Sep 1, 2025
4bed1f6
Try to setup python after mingw
tobiasdiez Sep 1, 2025
926f14a
Try to fix python path
tobiasdiez Sep 1, 2025
69c0d74
Readd building of the static pari lib
tobiasdiez Sep 1, 2025
9ad5998
try a different way to set path
tobiasdiez Sep 1, 2025
1be28d0
Use cygpath
tobiasdiez Sep 1, 2025
b05488b
And now without the stupid bin
tobiasdiez Sep 1, 2025
561d6a8
Set include and lib path
tobiasdiez Sep 1, 2025
1a66dd5
add print output
tobiasdiez Sep 1, 2025
8d7a47e
explicitly install mingw-w64-ucrt-x86_64-gcc
tobiasdiez Sep 1, 2025
ded0f74
Use pip install directly
tobiasdiez Sep 1, 2025
e1bae6b
Add simple test compilation
tobiasdiez Sep 1, 2025
f60ac70
Improve test
tobiasdiez Sep 1, 2025
7d13422
more playing around
tobiasdiez Sep 1, 2025
3d72238
Also install gmp
tobiasdiez Sep 1, 2025
1b8eb56
explicit lgmp
tobiasdiez Sep 1, 2025
d92c61d
with meson directly?
tobiasdiez Sep 1, 2025
3d1aa87
add cc -v
tobiasdiez Sep 1, 2025
588adfc
as -v has_header
tobiasdiez Sep 1, 2025
19538ae
with inherit path?
tobiasdiez Sep 1, 2025
2ed7202
include dir relative to windows
tobiasdiez Sep 1, 2025
f5732dc
more debug output
tobiasdiez Sep 1, 2025
a14ae25
More debug
tobiasdiez Sep 1, 2025
252b212
try directly
tobiasdiez Sep 1, 2025
c8821df
cygpath -am
tobiasdiez Sep 1, 2025
2262c6e
without ":"
tobiasdiez Sep 1, 2025
01c0e0d
Declare dependency on gmp manually
tobiasdiez Sep 2, 2025
b4077f7
install pkg-config
tobiasdiez Sep 2, 2025
02faaf3
fix meson
tobiasdiez Sep 2, 2025
0612c09
Make gmp optional (as pari might not have been built against using it)
tobiasdiez Sep 2, 2025
d293943
Get pari datadir via pari lib not gp exe
tobiasdiez Sep 2, 2025
98f56cc
Convert relative to absolute imports
tobiasdiez Sep 2, 2025
271ce1d
Use msys python
tobiasdiez Sep 2, 2025
f790c89
properly comment lines
tobiasdiez Sep 2, 2025
ce0678d
Set include and lib path correctly again
tobiasdiez Sep 2, 2025
4953e06
Temporarily disable cysignals
tobiasdiez Sep 4, 2025
b4a1920
Extend readme
tobiasdiez Sep 4, 2025
3815271
Add proper smoke test for Pari install
tobiasdiez Sep 4, 2025
9f40a40
Install gmp on macos
tobiasdiez Sep 4, 2025
e4b8105
Print output of smoke test
tobiasdiez Sep 4, 2025
22abd00
Remove 'pari-' prefix
tobiasdiez Sep 4, 2025
e65f0da
remove deleted autogen paths
tobiasdiez Sep 4, 2025
bd95195
Fix homebrew install cmd
tobiasdiez Sep 4, 2025
e8a52fa
Improve test output
tobiasdiez Sep 4, 2025
6ab7812
Normalize eol
tobiasdiez Sep 4, 2025
1787a6a
fix install script
tobiasdiez Sep 4, 2025
721e19d
Fix smoke test on macOS
tobiasdiez Sep 4, 2025
6223733
cosmetic improvements
tobiasdiez Sep 4, 2025
51d15e3
Fix cinclude and lib path
tobiasdiez Sep 4, 2025
35a7be4
Fix windows paths?
tobiasdiez Sep 4, 2025
498cac1
Build dynamic pari
tobiasdiez Sep 6, 2025
5b61202
Add cython version of readme example
tobiasdiez Sep 9, 2025
ddcf8b7
Streamline mingw packages to install
tobiasdiez Sep 9, 2025
7a502cd
Make meson build more robust
tobiasdiez Sep 9, 2025
ef24a3c
Fix installation prefix for msys
tobiasdiez Sep 9, 2025
04890dd
reactivate cysignals
tobiasdiez Sep 9, 2025
70dcafe
fix parser test
tobiasdiez Sep 9, 2025
373fd62
also install in usr for macos
tobiasdiez Sep 9, 2025
89df3c9
Merge remote-tracking branch 'origin/master' into win
tobiasdiez Sep 10, 2025
ab6c91c
Use pari from homebrew
tobiasdiez Sep 10, 2025
8d72435
fix macos build
tobiasdiez Sep 10, 2025
7677593
Further fixes for macos
tobiasdiez Sep 10, 2025
05cf348
try with direct path to cellar
tobiasdiez Sep 10, 2025
e1fb875
fix typo
tobiasdiez Sep 10, 2025
2913150
add debug for macos
tobiasdiez Sep 10, 2025
1b699d3
try with DYLD_LIBRARY_PATH
tobiasdiez Sep 10, 2025
54228e6
try without static
tobiasdiez Sep 10, 2025
5e730e1
wip - gcc->clang on macOS
dimpase Sep 10, 2025
107c5d6
use clang also in the second example
tobiasdiez Sep 14, 2025
a7c6397
WIP: brew prefix
dimpase Sep 16, 2025
3873775
cleanup macos stuff a bit
tobiasdiez Sep 18, 2025
36bb57b
fix macos headers
tobiasdiez Sep 18, 2025
898c954
.install-pari.sh to support *BSD
dimpase Sep 18, 2025
b06a3b2
Use uv and fix wheel building
tobiasdiez Oct 1, 2025
50f2c95
install wget
tobiasdiez Oct 1, 2025
8fa32e6
fix wget install
tobiasdiez Oct 1, 2025
7e4c3dd
another try...
tobiasdiez Oct 1, 2025
0bcf5cd
don't need sudo
tobiasdiez Oct 1, 2025
52910b0
Add step to install PARI before building sdist
tobiasdiez Oct 1, 2025
01f3cce
Install sudo if not present before building on Linux or macOS
tobiasdiez Oct 1, 2025
dd4dab4
Use uv to run make check and build docs
tobiasdiez Oct 1, 2025
9a96d23
Change file mode of .install-pari.sh to make it executable
tobiasdiez Oct 1, 2025
b4da4d6
Remove non-functional sudo from devtoolset in install script
tobiasdiez Oct 1, 2025
640b1a1
Install sudo non-interactively
tobiasdiez Oct 1, 2025
77a02e2
Add macOS before-all step to install PARI using Homebrew
tobiasdiez Oct 1, 2025
b726b20
Add environment-pass for CI and GitHub Actions in cibuildwheel config…
tobiasdiez Oct 1, 2025
483eeea
install sphinx with uv
tobiasdiez Oct 1, 2025
7918f52
Require Python 3.12 or later
tobiasdiez Oct 1, 2025
c8d61c6
Set macOS deployment target to 13 in cibuildwheel configuration
tobiasdiez Oct 1, 2025
ae23240
Add diagnostic output for PARI installation script
tobiasdiez Oct 1, 2025
f54ba1b
Enhance diagnostic output
tobiasdiez Oct 1, 2025
ecedd12
Update macOS deployment target configuration in cibuildwheel
tobiasdiez Oct 1, 2025
784c9e0
more output
tobiasdiez Oct 1, 2025
ffaafa6
Fix build docs command to use correct group name
tobiasdiez Oct 1, 2025
cd2b26e
fix macos
tobiasdiez Oct 1, 2025
271efe5
make autogen tests optional (not in wheel)
tobiasdiez Oct 1, 2025
71eb5a4
Add GMP installation support in install script
tobiasdiez Oct 1, 2025
09e61be
Move libpari to /usr/lib64 on RHEL/CentOS/Fedora if applicable
tobiasdiez Oct 1, 2025
e9c0746
Don't build wheels for 3.14 yet
tobiasdiez Oct 1, 2025
1ae226f
fix ubuntu...
tobiasdiez Oct 1, 2025
3722838
Add check for dnf before installing gmp-devel on Linux
tobiasdiez Oct 1, 2025
21ef645
Add support for installing sudo using dnf or apt-get
tobiasdiez Oct 1, 2025
fce20c4
Set MACOSX_DEPLOYMENT_TARGET correctly
tobiasdiez Oct 1, 2025
3d89017
add support for alpine as well
tobiasdiez Oct 1, 2025
ce6cbdc
fix syntax in macos part
tobiasdiez Oct 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ jobs:
run: |
bash -x .install-pari.sh
env:
PARI_VERSION: pari-2.17.1
URLDIR: unix
PARI_VERSION: pari-2.17.2
- uses: actions/setup-python@v4
- name: make sdist
run: |
Expand Down
103 changes: 96 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: cypari2
name: CI

on:
pull_request:
Expand All @@ -15,34 +15,122 @@ concurrency:

jobs:
build:
name: Build and Test (${{ matrix.os }}, Python ${{ matrix.python-version }}, PARI ${{ matrix.pari-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
pari-version: ['pari-2.13.0', 'pari-2.15.4', 'pari-2.15.5', '2.17.2']
pari-version: ['2.13.0', '2.15.4', '2.15.5', '2.17.2']
include:
- os: macos-latest
python-version: '3.10'
pari-version: '2.17.2' # Whatever comes with homebrew
- os: macos-latest
python-version: '3.13'
pari-version: '2.17.2' # Whatever comes with homebrew
- os: windows-latest
python-version: '3.12' # Whatever comes with msys2
pari-version: '2.15.4'
- os: windows-latest
python-version: '3.12' # Whatever comes with msys2
pari-version: '2.17.2'
env:
LC_ALL: C
PARI_VERSION: ${{ matrix.pari-version }}
defaults:
run:
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
steps:
- name: Set up the repository
uses: actions/checkout@v4
- name: Setup MSYS2
if: runner.os == 'Windows'
id: msys2
uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: >-
base-devel
m4
bison
make
patch
sed
wget
mingw-w64-ucrt-x86_64-toolchain
mingw-w64-ucrt-x86_64-gmp
mingw-w64-ucrt-x86_64-python
mingw-w64-ucrt-x86_64-python-pip
mingw-w64-ucrt-x86_64-meson-python
mingw-w64-ucrt-x86_64-cython
path-type: inherit
- name: Set up Python ${{ matrix.python-version }}
if: runner.os != 'Windows'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install pari
- name: Install PARI
if: matrix.os != 'macos-latest'
run: |
bash -x .install-pari.sh
- name: Install PARI
if: matrix.os == 'macos-latest'
run: |
brew install pari
- name: Smoke test PARI
run: |
bash -x .install-pari.sh
- name: Local build
if [ ${{ runner.os }} = macOS ]; then
HOMEBREW=`brew --prefix`
gcc -v tests/test.c -o test -I$HOMEBREW/include -L$HOMEBREW/lib -lpari -lgmp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might use clang rather gcc here, to make sure you don't by accident use a "real" gcc from Homebrew.

export C_INCLUDE_PATH=$HOMEBREW/include
export LIBRARY_PATH=$HOMEBREW/lib:$HOMEBREW/Cellar/pari/${{ matrix.pari-version }}/lib:$LIBRARY_PATH
gcc -v tests/test.c -o test -lpari -lgmp
else
gcc -v tests/test.c -o test -I/usr/local/include -L/usr/local/bin -lpari -lgmp
fi
expected="zeta(2) = 1.6449340668482264364
p = x^3 + x^2 + x - 1
modulus = y^3 + y^2 + y - 1
centerlift(lift(fq)) = [x - y, 1; x + (y^2 + y - 1), 1; x + (-y^2 - 1), 1]"
output="$(./test)"
# Normalize newlines for comparison
output="$(echo "$output" | tr -d '\r')"
expected="$(echo "$expected" | tr -d '\r')"
echo -e "Got:\n$output"
if [ "$output" != "$expected" ]; then
echo "Unexpected output from test.c"
echo -e "Expected:\n$expected"
exit 1
fi
- name: Build
run: |
if [ ${{ runner.os }} = Windows ]; then
export C_INCLUDE_PATH=$(cygpath -am "${{ steps.msys2.outputs.msys2-location }}")/usr/local/include
export LIBRARY_PATH=$(cygpath -am "${{ steps.msys2.outputs.msys2-location }}")/usr/local/bin
elif [ ${{ runner.os }} = macOS ]; then
HOMEBREW=`brew --prefix`
export C_INCLUDE_PATH=$HOMEBREW/include
ls -l $HOMEBREW/lib
export DYLD_LIBRARY_PATH=$HOMEBREW/lib:$HOMEBREW/Cellar/pari/${{ matrix.pari-version }}/lib:$LIBRARY_PATH
fi
echo $PATH
echo $C_INCLUDE_PATH
echo $LIBRARY_PATH
which python
python -m pip install -v .
- name: Test
run: |
make install
make check
- name: Build docs
run: |
pip install sphinx
(cd docs && make html)

dist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- name: Check out ${{ env.SPKG }}
Expand All @@ -56,7 +144,7 @@ jobs:
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install $DIST_PREREQ
python3 -m pip install build
- name: Run make dist, prepare upstream artifact
- name: Build dist, prepare upstream artifact
run: |
(cd build/pkgs/${{ env.SPKG }}/src && python3 -m build --sdist) \
&& mkdir -p upstream && cp build/pkgs/${{ env.SPKG }}/src/dist/*.tar.gz upstream/${{ env.SPKG }}-git.tar.gz \
Expand All @@ -69,6 +157,7 @@ jobs:
name: upstream

sage:
name: Test with Sage
uses: sagemath/sage/.github/workflows/docker.yml@develop
with:
targets: SAGE_CHECK=no SAGE_CHECK_PACKAGES="cypari" cypari
Expand Down
17 changes: 0 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,3 @@
# Autogenerated files
# (either by Cython or autogen)
cypari2/auto_gen.pxi.tmp
cypari2/auto_gen.pxi
cypari2/auto_instance.pxi.tmp
cypari2/auto_instance.pxi
cypari2/auto_paridecl.pxd.tmp
cypari2/auto_paridecl.pxd
cypari2/closure.c
cypari2/convert.c
cypari2/custom_block.c
cypari2/gen.c
cypari2/handle_error.c
cypari2/pari_instance.c
cypari2/stack.c
cypari2/string_utils.c

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
114 changes: 101 additions & 13 deletions .install-pari.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,112 @@
# Helper script to install PARI for github workflows
#!/bin/bash

# Helper script to install PARI (e.g. for CI builds).
# On macOS: the default system gcc is used
# On Linux: the default system gcc is used
# On Windows: uses the ucrt64 toolchain in Msys2

# Exit on error
set -e

if [ "$URLDIR" = "" ]; then
PURE_VERSION=${PARI_VERSION/pari-}
URLDIR=OLD/${PURE_VERSION%.*}
# Detect platform
PLATFORM="unknown"
case "$(uname -s)" in
MSYS_NT*|MINGW*)
PLATFORM="msys"
;;
Linux)
PLATFORM="linux"
;;
Darwin)
PLATFORM="macos"
;;
*)
echo "Unknown platform"
exit 1
;;
esac

# Run the script again in UCRT64 system for msys
if [ "$ucrt" != "0" ] && [ "$PLATFORM" = "msys" ]; then
MSYSTEM=UCRT64 MSYS2_PATH_TYPE=inherit bash --login -c "cd $pwd ; $self"
fi

# Windows conda prefix is not added to path automatically
# thus mingw compiler is not found later
if [ -n "$CONDA_PREFIX" ]; then
export PATH="$(cygpath "$CONDA_PREFIX")/Library/bin:$PATH"
fi

if [ "$PARI_VERSION" = "" ]; then
PARI_VERSION=2.17.2
fi

PURE_VERSION=${PARI_VERSION/pari-}
URLDIR=OLD/${PURE_VERSION%.*}

PARI_URL="https://pari.math.u-bordeaux.fr/pub/pari/$URLDIR"
PARI_URL1="https://pari.math.u-bordeaux.fr/pub/pari/unix"
PARI_URL2="https://pari.math.u-bordeaux.fr/pub/pari/unstable"

# Download PARI sources
wget --no-verbose "$PARI_URL/$PARI_VERSION.tar.gz" -O pari.tgz || wget --no-verbose "$PARI_URL1/pari-$PARI_VERSION.tar.gz" -O pari.tgz || wget --no-verbose "$PARI_URL2/pari-$PARI_VERSION.tar.gz" -O pari.tgz
if [ -d build/pari-$PURE_VERSION ] ; then
echo "Using existing pari-$PURE_VERSION build directory"
cd "build/pari-$PURE_VERSION"
else
echo "Download PARI sources"
if [ ! -d build ] ; then
mkdir build
fi
cd build
wget --no-verbose "$PARI_URL/$PURE_VERSION.tar.gz" -O "pari-$PURE_VERSION.tgz" \
|| wget --no-verbose "$PARI_URL1/pari-$PURE_VERSION.tar.gz" -O "pari-$PURE_VERSION.tgz" \
|| wget --no-verbose "$PARI_URL2/pari-$PURE_VERSION.tar.gz" -O "pari-$PURE_VERSION.tgz" \
|| wget --no-verbose "$PARI_URL/pari-$PURE_VERSION.tar.gz" -O "pari-$PURE_VERSION.tgz"
tar xzf "pari-$PURE_VERSION.tgz"
cd "pari-$PURE_VERSION"
fi

echo "Building Pari ..."
if [ "$PLATFORM" = "msys" ]; then
# Remove "export_file='$(LIBPARI).def';" line from config/Makefile.SH"
# Otherwise we get a Segmentation Fault during the resulting dlltool call
sed -i.bak "/export_file='\\\$(LIBPARI).def';/d" config/Makefile.SH
fi
# For debugging:
# export CFLAGS="-g"
if [[ "$PLATFORM" = "msys" ]]; then
# If one installs in a non-default location, then one needs to call os.add_dll_directory
# in Python to find the DLLs.
CONFIG_ARGS="--without-readline --prefix=$MSYSTEM_PREFIX"
else
CONFIG_ARGS="--prefix=/usr"
fi
./Configure $CONFIG_ARGS

# On Windows, disable UNIX-specific code in language files
# (not sure why UNIX is defined)
lang_es="src/language/es.c"
if [ -f "$lang_es" ] && [ "$PLATFORM" = "msys" ]; then
sed -i.bak \
-e 's/#if[[:space:]]*defined(UNIX)/#if 0/' \
-e 's/#ifdef[[:space:]]*UNIX/#if 0/' \
"$lang_es"
fi


# Install
mkdir Pari42
tar xzf pari.tgz -C Pari42
cd Pari42/*
./Configure --prefix=/usr
make gp
sudo make install
if [ "$PLATFORM" = "msys" ]; then
# Windows
cd Omingw-x86_64
make install-lib-dyn
make install-include
make install-doc
make install-cfg

# Fix location of libpari.dll.a
if [ -f "$MSYSTEM_PREFIX/bin/libpari.dll.a" ]; then
cp "$MSYSTEM_PREFIX/bin/libpari.dll.a" "$MSYSTEM_PREFIX/lib/"
fi
else
# Linux or macOS
make gp
sudo make install
fi
62 changes: 56 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,30 @@ From source with pip

Requirements:

PARI/GP >= 2.9.4 (header files and library); see
- PARI/GP >= 2.9.4 (header files and library); see
https://doc.sagemath.org/html/en/reference/spkg/pari#spkg-pari
for availability in distributions (GNU/Linux, conda-forge, Homebrew, FreeBSD),
or install from source.
or install from source (e.g using the script ``.install-pari.sh`` provided in this
repository).
- gmp (if PARI/GP was built with gmp)
- A C compiler (GCC)
- pkg-config
- Python >= 3.9
- pip

On Windows, we recommend to use MSYS2, which can be installed from
`Rtools <https://cran.r-project.org/bin/windows/Rtools/>`_.
Afterwards, start the MSYS2 (UCRT64) terminal and install the above
dependencies via
::

$ pacman -Syu
$ pacman -S mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-gmp mingw-w64-ucrt-x86_64-python mingw-w64-ucrt-x86_64-python-pip mingw-w64-ucrt-x86_64-meson-python mingw-w64-ucrt-x86_64-cython mingw-w64-ucrt-x86_64-wget
$ pacman -S bison # for building pari from source
$ .install-pari.sh
$ export C_INCLUDE_PATH=/usr/local/include
$ export LIBRARY_PATH=/usr/local/bin


Install cypari2 via the Python Package Index (PyPI) via

Expand All @@ -66,6 +86,22 @@ If you want to try the development version, use

$ pip install git+https://github.com/sagemath/cypari2.git [--user]

or clone the repository and run
::

$ python -m venv venv
$ source venv/bin/activate
$ pip install "meson-python>=0.18.0" "cython>=3.0" "cysignals>=1.11.3" "ninja>=1.8.2"
$ pip install -e . --no-build-isolation

If you run into certification issues on Windows, you can try to
upgrade the certifi package via
::

$ pip install --upgrade certifi
$ export SSL_CERT_FILE=$(python -m certifi)

and then retry the installation.

Usage
-----
Expand Down Expand Up @@ -143,14 +179,28 @@ CyPari 2 is maintained by the SageMath community.
Open issues or submit pull requests at https://github.com/sagemath/cypari2
and join https://groups.google.com/group/sage-devel to discuss.

To get started with development, you can set up an environment using Conda
as follows:
To get started with development, you can use the provided ``environment.yml``
file to create the full development environment including build backend,
compilers, and documentation dependencies:

::
$ conda create -n cypari2-dev python cython pari=*=*_pthread ninja meson-python cysignals c-compiler

$ conda env create -f environment.yml
$ conda activate cypari2-dev
$ pip install -e . --no-build-isolation

Afterwards, you can build and install the package in editable mode:
On Windows, you can use ``environment-win.yml`` and you may also need to set a
few environment variables:

::
$ conda env create -f environment-win.yml
$ conda activate cypari2-dev
$ set LIBRARY_PATH=%CONDA_PREFIX%\Library\lib;%LIBRARY_PATH%
$ set C_INCLUDE_PATH=%CONDA_PREFIX%\Library\include;%C_INCLUDE_PATH%
$ pip install -e . --no-build-isolation

To update an existing environment after changes to ``environment.yml``:

::

$ conda env update -f environment.yml --prune
Loading
Loading