Skip to content

Commit

Permalink
fix pycodestyle warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Mar 21, 2024
1 parent 1385b9a commit ba7b5d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from glob import glob
from setuptools import setup, Extension
from setuptools.command.bdist_egg import bdist_egg as _bdist_egg
from subprocess import Popen, PIPE

kernelpath = os.path.join("share", "jupyter", "kernels", "pari_jupyter")
nbextpath = os.path.join("share", "jupyter", "nbextensions", "gp-mode")
Expand All @@ -20,18 +21,17 @@
ext = ".pyx"
cmdclass = dict(build_ext=build_ext)

extensions = [Extension("PARIKernel.kernel", ["PARIKernel/kernel"+ext], libraries=["pari", "readline"]),
Extension("PARIKernel.io", ["PARIKernel/io"+ext], libraries=["pari"])]
extensions = [Extension("PARIKernel.kernel", ["PARIKernel/kernel" + ext], libraries=["pari", "readline"]),
Extension("PARIKernel.io", ["PARIKernel/io" + ext], libraries=["pari"])]


# Are SVG graphics available?
from subprocess import Popen, PIPE
gp = Popen("gp -f -q", shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
gp.communicate(b'''iferr(install(pari_set_plot_engine, "vL"), E, quit(1));''')
HAVE_SVG = (gp.wait() == 0)

if HAVE_SVG:
ext = Extension("PARIKernel.svg", ["PARIKernel/svg"+ext], libraries=["pari"])
ext = Extension("PARIKernel.svg", ["PARIKernel/svg" + ext], libraries=["pari"])
extensions.append(ext)


Expand All @@ -40,6 +40,7 @@ def run(self):
from distutils.errors import DistutilsOptionError
raise DistutilsOptionError("The package pari-jupyter will not function correctly when built as egg. Therefore, it cannot be installed using 'python setup.py install' or 'easy_install'. Instead, use 'pip install' to install this package.")


cmdclass['bdist_egg'] = no_egg


Expand All @@ -49,6 +50,6 @@ def run(self):
data_files=[(kernelpath, glob("spec/*")),
(nbextpath, glob("gp-mode/*")),
(nbconfpath, ["gp-mode.json"]),
],
],
cmdclass=cmdclass,
)
2 changes: 2 additions & 0 deletions test/test_pari_jupyter_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import unittest
import jupyter_kernel_test as jkt


class PARIKernelTests(jkt.KernelTests):

# REQUIRED
Expand Down Expand Up @@ -98,5 +99,6 @@ class PARIKernelTests(jkt.KernelTests):
# the client
# code_clear_output = "from IPython.display import clear_output; clear_output()"


if __name__ == '__main__':
unittest.main(verbosity=2)

0 comments on commit ba7b5d8

Please sign in to comment.