1
+ import io
1
2
import os
2
3
import re
4
+ import sys
3
5
from setuptools import setup , find_packages
4
6
5
7
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
8
19
9
20
10
21
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 ()
12
25
major_regex = """major_version\s*?=\s*?["']{1}(\d+)["']{1}"""
13
26
minor_regex = """minor_version\s*?=\s*?["']{1}(\d+)["']{1}"""
14
27
patch_regex = """patch_version\s*?=\s*?["']{1}(\d+)["']{1}"""
@@ -28,38 +41,35 @@ def version_read():
28
41
29
42
30
43
setup (
31
- name = ' font-line' ,
44
+ name = " font-line" ,
32
45
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
-
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
+
53
+ platforms = ["any" ],
40
54
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" ,
49
59
include_package_data = True ,
50
60
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" ,
64
74
],
65
75
)
0 commit comments