-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
47 lines (41 loc) · 1.46 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from setuptools import setup, find_packages
#from distutils.command.build_scripts import build_scripts
from pathlib import Path
import sys,os
from contextlib import suppress
this_directory = Path(__file__).parent.absolute()
long_description = Path(this_directory, 'README.md').read_text(encoding='utf-8')
def ensureFile(scriptname,thescript):
writeScript = True
with suppress(Exception):
with open(scriptname,"rt") as file:
if(file.read()==thescript):
writeScript = False
if(writeScript):
with open(scriptname,"wt") as file:
file.write(thescript)
ensureFile("scripts/pyptex",r"""#!/bin/sh
{} -u -m pyptex $@
""".format(sys.executable)
)
os.system("chmod a+rx scripts/pyptex")
setup(
name='pyptex',
description='Python Preprocessor for (La)TeX',
version='1.5.6',
packages=find_packages(),
install_requires=['sympy>=1.5', 'numpy>=1.18', 'setuptools', 'pdoc3>=0.7','matplotlib','streamcapture>=1.2'],
python_requires='>=3.8',
author='Sébastien Loisel',
author_email='[email protected]',
zip_safe=False,
url='https://github.com/sloisel/pyptex',
project_urls={
'Documentation': 'https://htmlpreview.github.io/?https://github.com/sloisel/pyptex/blob/master/pyptex.html',
'Source': 'https://github.com/sloisel/pyptex',
},
license='MIT',
scripts=['scripts/pyptex'],
long_description=long_description,
long_description_content_type='text/markdown',
)