Skip to content

Commit 2653417

Browse files
committed
PyPI documentation from README Markdown file
1 parent 39bcd70 commit 2653417

File tree

1 file changed

+42
-32
lines changed

1 file changed

+42
-32
lines changed

setup.py

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
1+
import io
12
import os
23
import re
4+
import sys
35
from setuptools import setup, find_packages
46

57

6-
def docs_read(fname):
7-
return open(os.path.join(os.path.dirname(__file__), 'docs', fname)).read()
8+
# Use repository Markdown README.md for PyPI long description
9+
try:
10+
with io.open("README.md", encoding="utf-8") as f:
11+
readme = f.read()
12+
except IOError as readme_e:
13+
sys.stderr.write(
14+
"[ERROR] setup.py: Failed to read the README.md file for the long description definition: {}".format(
15+
str(readme_e)
16+
)
17+
)
18+
raise readme_e
819

920

1021
def version_read():
11-
settings_file = open(os.path.join(os.path.dirname(__file__), 'lib', 'fontline', 'settings.py')).read()
22+
settings_file = open(
23+
os.path.join(os.path.dirname(__file__), "lib", "fontline", "settings.py")
24+
).read()
1225
major_regex = """major_version\s*?=\s*?["']{1}(\d+)["']{1}"""
1326
minor_regex = """minor_version\s*?=\s*?["']{1}(\d+)["']{1}"""
1427
patch_regex = """patch_version\s*?=\s*?["']{1}(\d+)["']{1}"""
@@ -28,38 +41,35 @@ def version_read():
2841

2942

3043
setup(
31-
name='font-line',
44+
name="font-line",
3245
version=version_read(),
33-
description='A font vertical metrics reporting and line spacing adjustment tool',
34-
long_description=(docs_read('README.rst')),
35-
url='https://github.com/source-foundry/font-line',
36-
license='MIT license',
37-
author='Christopher Simpkins',
38-
author_email='[email protected]',
39-
platforms=['any'],
46+
description="A font vertical metrics reporting and line spacing adjustment tool",
47+
long_description=readme,
48+
long_description_content_type="text/markdown",
49+
url="https://github.com/source-foundry/font-line",
50+
license="MIT license",
51+
author="Christopher Simpkins",
52+
author_email="[email protected]",
53+
platforms=["any"],
4054
packages=find_packages("lib"),
41-
package_dir={'': 'lib'},
42-
install_requires=['commandlines', 'standardstreams', 'fontTools'],
43-
entry_points={
44-
'console_scripts': [
45-
'font-line = fontline.app:main'
46-
],
47-
},
48-
keywords='font,typeface,fonts,spacing,line spacing,spaces,vertical metrics,metrics,type',
55+
package_dir={"": "lib"},
56+
install_requires=["commandlines", "standardstreams", "fontTools"],
57+
entry_points={"console_scripts": ["font-line = fontline.app:main"],},
58+
keywords="font,typeface,fonts,spacing,line spacing,spaces,vertical metrics,metrics,type",
4959
include_package_data=True,
5060
classifiers=[
51-
'Development Status :: 5 - Production/Stable',
52-
'Natural Language :: English',
53-
'License :: OSI Approved :: MIT License',
54-
'Operating System :: OS Independent',
55-
'Programming Language :: Python',
56-
'Programming Language :: Python :: 2',
57-
'Programming Language :: Python :: 2.7',
58-
'Programming Language :: Python :: 3',
59-
'Programming Language :: Python :: 3.3',
60-
'Programming Language :: Python :: 3.4',
61-
'Programming Language :: Python :: 3.5',
62-
'Programming Language :: Python :: 3.6',
63-
'Topic :: Software Development :: Libraries :: Python Modules',
61+
"Development Status :: 5 - Production/Stable",
62+
"Natural Language :: English",
63+
"License :: OSI Approved :: MIT License",
64+
"Operating System :: OS Independent",
65+
"Programming Language :: Python",
66+
"Programming Language :: Python :: 2",
67+
"Programming Language :: Python :: 2.7",
68+
"Programming Language :: Python :: 3",
69+
"Programming Language :: Python :: 3.3",
70+
"Programming Language :: Python :: 3.4",
71+
"Programming Language :: Python :: 3.5",
72+
"Programming Language :: Python :: 3.6",
73+
"Topic :: Software Development :: Libraries :: Python Modules",
6474
],
6575
)

0 commit comments

Comments
 (0)