|
1 | 1 | #!/usr/bin/env python
|
2 |
| -"""Julia/Python bridge with IPython support. |
3 |
| -""" |
4 | 2 |
|
5 | 3 | from setuptools import setup
|
6 |
| -import sys |
| 4 | +import os |
7 | 5 |
|
8 |
| -doc = __doc__ |
| 6 | + |
| 7 | +def pyload(name): |
| 8 | + ns = {} |
| 9 | + with open(name) as f: |
| 10 | + exec(compile(f.read(), name, "exec"), ns) |
| 11 | + return ns |
| 12 | + |
| 13 | +# In case it's Python 2: |
9 | 14 | try:
|
10 |
| - import pypandoc |
11 |
| - with open('README.md') as f: |
12 |
| - desc = f.read() |
13 |
| - print('will convert description from markdown to rst.') |
14 |
| - doc = pypandoc.convert(desc, 'rst', format='markdown') |
15 |
| -except Exception: |
16 |
| - print('Unable to convert markdown to rst. Please install `pypandoc` and `pandoc` to use markdown long description.') |
| 15 | + execfile |
| 16 | +except NameError: |
| 17 | + pass |
| 18 | +else: |
| 19 | + def pyload(path): |
| 20 | + ns = {} |
| 21 | + execfile(path, ns) |
| 22 | + return ns |
| 23 | + |
| 24 | + |
| 25 | +repo_root = os.path.abspath(os.path.dirname(__file__)) |
| 26 | + |
| 27 | +with open(os.path.join(repo_root, "README.md")) as f: |
| 28 | + long_description = f.read() |
| 29 | +# https://packaging.python.org/guides/making-a-pypi-friendly-readme/ |
| 30 | + |
| 31 | +ns = pyload(os.path.join(repo_root, "julia", "release.py")) |
| 32 | +version = ns["__version__"] |
17 | 33 |
|
18 | 34 | setup(name='julia',
|
19 |
| - version='0.1.5', |
20 |
| - description=doc, |
| 35 | + version=version, |
| 36 | + description="Julia/Python bridge with IPython support.", |
| 37 | + long_description=long_description, |
| 38 | + long_description_content_type="text/markdown", |
21 | 39 | author='The Julia and IPython development teams.',
|
22 | 40 |
|
23 | 41 | license='MIT',
|
|
42 | 60 | 'Programming Language :: Python :: 3.4',
|
43 | 61 | 'Programming Language :: Python :: 3.5',
|
44 | 62 | 'Programming Language :: Python :: 3.6',
|
| 63 | + 'Programming Language :: Python :: 3.7', |
45 | 64 | ],
|
46 | 65 | url='http://julialang.org',
|
47 | 66 | packages=['julia'],
|
|
51 | 70 | "python-jl = julia.python_jl:main",
|
52 | 71 | ],
|
53 | 72 | },
|
| 73 | + # We bundle Julia scripts etc. inside `julia` directory. Thus, |
| 74 | + # this directory must exist in the file system (not in a zip |
| 75 | + # file): |
| 76 | + zip_safe=False, |
54 | 77 | )
|
0 commit comments