-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathsetup.py
107 lines (97 loc) · 3.5 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Usage:
# pip install https://github.com/jfbercher/jupyter_latex_envs/archive/master.zip --user
# verbose mode can be enabled with -v switch eg pip -v install ...
# upgrade with a --upgrade.
# A system install can be done by omitting the --user switch.
from __future__ import print_function
import io, sys
from setuptools import setup, find_packages
from os.path import join, dirname
from sys import exit, prefix, argv
msg="""
----------------- INSTALLATION -------------------------
step 1: pip3 install jupyter_latex_envs [--user][--upgrade]
--> Now:
step 2: install the notebook extension
jupyter nbextension install --py latex_envs [--user]
step 3: and enable it
jupyter nbextension enable latex_envs [--user] --py
----------------------------------------------------------
"""
readme_file = open('README.rst', 'r')
try:
detailed_description = readme_file.read()
finally:
readme_file.close()
def read(*names, **kwargs):
return io.open(
join(dirname(__file__), *names),
encoding=kwargs.get('encoding', 'utf8')
).read()
setup(name='jupyter_latex_envs',
version='1.4.6',
description=("Jupyter notebook extension which supports (some) LaTeX environments " # noqa
"within markdown cells. Also provides support for labels and crossreferences, " # noqa
"document wide numbering, bibliography, and more..."),
# '\n'.join(__doc__.split("\n")[2:]).strip(),
long_description=detailed_description,
url='https://github.com/jfbercher/jupyter_latex_envs',
author='Jean-François Bercher',
author_email='jf.bercher@gmail.com',
license='Modified BSD',
packages=find_packages('src'),
package_dir={'': 'src'},
include_package_data=True,
install_requires=[
'ipython',
'jupyter_core',
'nbconvert',
'notebook >=4.0',
'traitlets >=4.1',
],
zip_safe=False,
entry_points={
'nbconvert.exporters': [
'html_with_lenvs = latex_envs.latex_envs:LenvsHTMLExporter',
'latex_with_lenvs = latex_envs.latex_envs:LenvsLatexExporter',
'slides_with_lenvs = latex_envs.latex_envs:LenvsSlidesExporter',
'html_with_toclenvs = latex_envs.latex_envs:LenvsTocHTMLExporter',
],
},
classifiers=[
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: JavaScript',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Utilities',
],
)
#if 'install' in argv:
# import sys
x=sys.stdout.write(msg)
# import site
# try:
# import importlib
# importlib.reload(site)
# except:
# reload(site)
# import latex_envs
# import notebook.nbextensions as nb
# user = False
# sys_prefix = False
# if "--user" in argv:
# user=True
# if "--sys-prefix" in argv:
# sys_prefix=True
# x=sys.stdout.write("[Step 2]: Installing the javascript nbextension"+"\n")
# nb.install_nbextension_python('latex_envs',
# user=user, sys_prefix=sys_prefix)
# x=sys.stdout.write("[Step 3]: Enabing the nbextension"+"\n")
# nb.enable_nbextension_python('latex_envs',
# user=user, sys_prefix=sys_prefix)