Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove LaTeX checking in setup.py. #9571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Remove LaTeX checking in setup.py.
We already have runtime tests for LaTeX and associated dependencies; the
check in setup.py is not used for anything.
  • Loading branch information
anntzer committed Oct 25, 2017
commit 293d11cfcf37c6a4d23718c38f1fa9410ec2a834
5 changes: 0 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@
setupext.BackendAgg(),
setupext.BackendCairo(),
setupext.Windowing(),
'Optional LaTeX dependencies',
setupext.DviPng(),
setupext.Ghostscript(),
setupext.LaTeX(),
setupext.PdfToPs(),
'Optional package data',
setupext.Dlls(),
]
Expand Down
69 changes: 0 additions & 69 deletions setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -2181,75 +2181,6 @@ def check_requirements(self):
return "cairocffi version %s" % cairocffi.version


class DviPng(SetupPackage):
name = "dvipng"
optional = True

def check(self):
try:
output = check_output('dvipng -version', shell=True,
stderr=subprocess.STDOUT)
return "version %s" % output.splitlines()[1].decode().split()[-1]
except (IndexError, ValueError, subprocess.CalledProcessError):
raise CheckFailed()


class Ghostscript(SetupPackage):
name = "ghostscript"
optional = True

def check(self):
if sys.platform == 'win32':
# mgs is the name in miktex
gs_execs = ['gswin32c', 'gswin64c', 'mgs', 'gs']
else:
gs_execs = ['gs']
for gs_exec in gs_execs:
try:
command = gs_exec + ' --version'
output = check_output(command, shell=True,
stderr=subprocess.STDOUT)
return "version %s" % output.decode()[:-1]
except (IndexError, ValueError, subprocess.CalledProcessError):
pass

raise CheckFailed()


class LaTeX(SetupPackage):
name = "latex"
optional = True

def check(self):
try:
output = check_output('latex -version', shell=True,
stderr=subprocess.STDOUT)
line = output.splitlines()[0].decode()
pattern = '(3\.1\d+)|(MiKTeX \d+.\d+)'
match = re.search(pattern, line)
return "version %s" % match.group(0)
except (IndexError, ValueError, AttributeError, subprocess.CalledProcessError):
raise CheckFailed()


class PdfToPs(SetupPackage):
name = "pdftops"
optional = True

def check(self):
try:
output = check_output('pdftops -v', shell=True,
stderr=subprocess.STDOUT)
for line in output.splitlines():
line = line.decode()
if 'version' in line:
return "version %s" % line.split()[2]
except (IndexError, ValueError, subprocess.CalledProcessError):
pass

raise CheckFailed()


class OptionalPackageData(OptionalPackage):
config_category = "package_data"

Expand Down