-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[setup.py] transition to use repository Markdown README file for long…
… description on PyPI
- Loading branch information
1 parent
cf2454d
commit 1884a90
Showing
1 changed file
with
43 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
import io | ||
import os | ||
import re | ||
import sys | ||
from setuptools import setup, find_packages | ||
|
||
|
||
def docs_read(fname): | ||
return open(os.path.join(os.path.dirname(__file__), 'docs', fname)).read() | ||
# Use repository Markdown README.md for PyPI long description | ||
try: | ||
with io.open("README.md", encoding="utf-8") as f: | ||
readme = f.read() | ||
except IOError as readme_e: | ||
sys.stderr.write( | ||
"[ERROR] setup.py: Failed to read the README.md file for the long description definition: {}".format( | ||
str(readme_e) | ||
) | ||
) | ||
raise readme_e | ||
|
||
|
||
def version_read(): | ||
settings_file = open(os.path.join(os.path.dirname(__file__), 'lib', 'fontv', 'settings.py')).read() | ||
major_regex = """major_version\s*?=\s*?["']{1}(\d+)["']{1}""" | ||
minor_regex = """minor_version\s*?=\s*?["']{1}(\d+)["']{1}""" | ||
patch_regex = """patch_version\s*?=\s*?["']{1}(\d+)["']{1}""" | ||
settings_file = open( | ||
os.path.join(os.path.dirname(__file__), "lib", "fontv", "settings.py") | ||
).read() | ||
major_regex = r"""major_version\s*?=\s*?["']{1}(\d+)["']{1}""" | ||
minor_regex = r"""minor_version\s*?=\s*?["']{1}(\d+)["']{1}""" | ||
patch_regex = r"""patch_version\s*?=\s*?["']{1}(\d+)["']{1}""" | ||
major_match = re.search(major_regex, settings_file) | ||
minor_match = re.search(minor_regex, settings_file) | ||
patch_match = re.search(patch_regex, settings_file) | ||
|
@@ -28,36 +41,33 @@ def version_read(): | |
|
||
|
||
setup( | ||
name='font-v', | ||
name="font-v", | ||
version=version_read(), | ||
description='Font version reporting and modification tool', | ||
long_description=(docs_read('README.rst')), | ||
url='https://github.com/source-foundry/font-v', | ||
license='MIT license', | ||
author='Christopher Simpkins', | ||
author_email='[email protected]', | ||
platforms=['any'], | ||
description="Font version reporting and modification tool", | ||
long_description=readme, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/source-foundry/font-v", | ||
license="MIT license", | ||
author="Christopher Simpkins", | ||
author_email="[email protected]", | ||
platforms=["any"], | ||
packages=find_packages("lib"), | ||
package_dir={'': 'lib'}, | ||
install_requires=['gitpython', 'fonttools'], | ||
entry_points={ | ||
'console_scripts': [ | ||
'font-v = fontv.app:main' | ||
], | ||
}, | ||
keywords='', | ||
package_dir={"": "lib"}, | ||
install_requires=["gitpython", "fonttools"], | ||
entry_points={"console_scripts": ["font-v = fontv.app:main"],}, | ||
keywords="", | ||
include_package_data=True, | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Natural Language :: English', | ||
'License :: OSI Approved :: MIT License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6' | ||
"Development Status :: 4 - Beta", | ||
"Natural Language :: English", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.4", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
], | ||
) |