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' , 'fontv' , 'settings.py' )).read ()
12
- major_regex = """major_version\s*?=\s*?["']{1}(\d+)["']{1}"""
13
- minor_regex = """minor_version\s*?=\s*?["']{1}(\d+)["']{1}"""
14
- patch_regex = """patch_version\s*?=\s*?["']{1}(\d+)["']{1}"""
22
+ settings_file = open (
23
+ os .path .join (os .path .dirname (__file__ ), "lib" , "fontv" , "settings.py" )
24
+ ).read ()
25
+ major_regex = r"""major_version\s*?=\s*?["']{1}(\d+)["']{1}"""
26
+ minor_regex = r"""minor_version\s*?=\s*?["']{1}(\d+)["']{1}"""
27
+ patch_regex = r"""patch_version\s*?=\s*?["']{1}(\d+)["']{1}"""
15
28
major_match = re .search (major_regex , settings_file )
16
29
minor_match = re .search (minor_regex , settings_file )
17
30
patch_match = re .search (patch_regex , settings_file )
@@ -28,36 +41,33 @@ def version_read():
28
41
29
42
30
43
setup (
31
- name = ' font-v' ,
44
+ name = " font-v" ,
32
45
version = version_read (),
33
- description = 'Font version reporting and modification tool' ,
34
- long_description = (docs_read ('README.rst' )),
35
- url = 'https://github.com/source-foundry/font-v' ,
36
- license = 'MIT license' ,
37
- author = 'Christopher Simpkins' ,
38
- author_email = 'chris@sourcefoundry.org' ,
39
- platforms = ['any' ],
46
+ description = "Font version reporting and modification tool" ,
47
+ long_description = readme ,
48
+ long_description_content_type = "text/markdown" ,
49
+ url = "https://github.com/source-foundry/font-v" ,
50
+ license = "MIT license" ,
51
+ author = "Christopher Simpkins" ,
52
+ author_email = "chris@sourcefoundry.org" ,
53
+ platforms = ["any" ],
40
54
packages = find_packages ("lib" ),
41
- package_dir = {'' : 'lib' },
42
- install_requires = ['gitpython' , 'fonttools' ],
43
- entry_points = {
44
- 'console_scripts' : [
45
- 'font-v = fontv.app:main'
46
- ],
47
- },
48
- keywords = '' ,
55
+ package_dir = {"" : "lib" },
56
+ install_requires = ["gitpython" , "fonttools" ],
57
+ entry_points = {"console_scripts" : ["font-v = fontv.app:main" ],},
58
+ keywords = "" ,
49
59
include_package_data = True ,
50
60
classifiers = [
51
- ' Development Status :: 4 - Beta' ,
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.4' ,
60
- ' Programming Language :: Python :: 3.5' ,
61
- ' Programming Language :: Python :: 3.6'
61
+ " Development Status :: 4 - Beta" ,
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.4" ,
70
+ " Programming Language :: Python :: 3.5" ,
71
+ " Programming Language :: Python :: 3.6" ,
62
72
],
63
73
)
0 commit comments