Skip to content

Commit bdeb940

Browse files
author
Sylvain MARIE
committed
Improved setup.py, in particular long description now uses markdown (no pandoc anymore) and zip_safe is false. Fixes #18
1 parent c27a173 commit bdeb940

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

.travis.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ cache: pip
55
matrix:
66
fast_finish: true
77
include:
8-
# - python: 2.6
98
- python: 2.7
10-
# - python: 3.3
11-
# - python: 3.4
129
- python: 3.5
1310
- python: 3.6
1411
- python: 3.7
@@ -21,14 +18,12 @@ env:
2118

2219
before_install:
2320
# (a) linux dependencies
24-
- sudo apt-get install pandoc
2521
- sudo apt-get install ant
2622
- sudo apt-get install ant-optional
2723

2824
install:
2925
- pip list
30-
# needs to be installed beforehand
31-
- pip install setuptools_scm
26+
- pip install six setuptools_scm # apparently python 2 requires this
3227
- python ci_tools/py_install.py pip ci_tools/requirements-pip.txt
3328
# travis-specific installs
3429
- pip install PyGithub # for ci_tools/github_release.py

setup.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# *************** Dependencies *********
3232
INSTALL_REQUIRES = []
3333
DEPENDENCY_LINKS = []
34-
SETUP_REQUIRES = ['pytest-runner', 'setuptools_scm', 'pypandoc', 'pandoc', 'ordered-set', 'mako']
34+
SETUP_REQUIRES = ['pytest-runner', 'setuptools_scm', 'pypandoc', 'pandoc', 'ordered-set', 'mako', 'six']
3535
TESTS_REQUIRE = ['pytest', 'pytest-logging', 'pytest-cov', 'numpy', 'pandas']
3636
EXTRAS_REQUIRE = {}
3737

@@ -54,17 +54,9 @@
5454
DOWNLOAD_URL = URL + '/tarball/' + version_for_download_url
5555

5656
KEYWORDS = 'mini minimal lambda expr expression simple print string func function symbol symbolic'
57-
# --Get the long description from the README file
58-
# with open(path.join(here, 'README.md'), encoding='utf-8') as f:
59-
# LONG_DESCRIPTION = f.read()
60-
try:
61-
import pypandoc
62-
LONG_DESCRIPTION = pypandoc.convert(path.join(here, 'docs', 'long_description.md'), 'rst').replace('\r', '')
63-
except(ImportError):
64-
from warnings import warn
65-
warn('WARNING pypandoc could not be imported - we recommend that you install it in order to package the '
66-
'documentation correctly')
67-
LONG_DESCRIPTION = open('README.md').read()
57+
58+
with open(path.join(here, 'docs', 'long_description.md')) as f:
59+
LONG_DESCRIPTION = f.read()
6860

6961
# ************* VERSION **************
7062
# --Get the Version number from VERSION file, see https://packaging.python.org/single_source_version/ option 4.
@@ -77,6 +69,7 @@
7769
name=DISTNAME,
7870
description=DESCRIPTION,
7971
long_description=LONG_DESCRIPTION,
72+
long_description_content_type='text/markdown',
8073

8174
# Versions should comply with PEP440. For a discussion on single-sourcing
8275
# the version across setup.py and the project code, see
@@ -174,4 +167,10 @@
174167
# 'sample=sample:main',
175168
# ],
176169
# },
170+
171+
# explicitly setting the flag to avoid `ply` being downloaded
172+
# see https://github.com/smarie/python-getversion/pull/5
173+
# and to make mypy happy
174+
# see https://mypy.readthedocs.io/en/latest/installed_packages.html
175+
zip_safe=False,
177176
)

0 commit comments

Comments
 (0)