Skip to content

Commit 07bbd12

Browse files
committed
Correctly specify dependencies
1 parent 284cadb commit 07bbd12

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ before_install:
3030
- ccache -M 256M && ccache -s
3131
install:
3232
- bash -x .travis-install-pari.sh
33-
- pip install --build=/tmp/pip --verbose -r requirements.txt
3433
# CFLAGS:
3534
# -O1 to speed up compilation (compared to -O2 or -O3)
3635
# -fno-strict-aliasing because that is the default in Python
@@ -42,6 +41,7 @@ install:
4241
# command to run tests
4342
script:
4443
- make check
44+
- pip install sphinx
4545
- (cd docs && make html)
4646
cache:
4747
directories:

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Requirements:
2828
- PARI/GP >= 2.9.4 (header files and library)
2929
- Python 2.7 or Python >= 3.4
3030
- pip
31-
- `cysignals <https://pypi.python.org/pypi/cysignals/>`_
31+
- `cysignals <https://pypi.python.org/pypi/cysignals/>`_ >= 1.7
3232
- Cython >= 0.28
3333

3434
Install cypari2 via the Python Package Index (PyPI) via

setup.py

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,6 @@
3030
# Adapted from Cython's new_build_ext
3131
class build_ext(_build_ext):
3232
def finalize_options(self):
33-
# Check dependencies
34-
try:
35-
from Cython.Build.Dependencies import cythonize
36-
except ImportError as E:
37-
sys.stderr.write("Error: {0}\n".format(E))
38-
sys.stderr.write("The installation of cypari2 requires Cython\n")
39-
sys.exit(1)
40-
41-
try:
42-
# We need the header files for cysignals at compile-time
43-
import cysignals
44-
except ImportError as E:
45-
sys.stderr.write("Error: {0}\n".format(E))
46-
sys.stderr.write("The installation of cypari2 requires cysignals\n")
47-
sys.exit(1)
48-
4933
# Generate auto-generated sources from pari.desc
5034
rebuild()
5135

@@ -56,11 +40,16 @@ def finalize_options(self):
5640
"language_level": 2,
5741
}
5842

43+
_build_ext.finalize_options(self)
44+
45+
def run(self):
46+
# Run Cython
47+
from Cython.Build.Dependencies import cythonize
5948
self.distribution.ext_modules[:] = cythonize(
6049
self.distribution.ext_modules,
6150
compiler_directives=self.directives)
6251

63-
_build_ext.finalize_options(self)
52+
_build_ext.run(self)
6453

6554

6655
class no_egg(_bdist_egg):
@@ -79,6 +68,8 @@ def run(self):
7968
setup(
8069
name='cypari2',
8170
version=VERSION,
71+
setup_requires=['Cython>=0.28'],
72+
install_requires=['cysignals>=1.7'],
8273
description="A Python interface to the number theory library PARI/GP",
8374
long_description=README,
8475
url='https://github.com/defeo/cypari2',

0 commit comments

Comments
 (0)