Skip to content

Commit

Permalink
Protect read for long description during normsl install.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunthercox committed Oct 5, 2016
1 parent df7ea5f commit 2fea95e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ __pycache__/
# Distribution / packaging
.Python
env/
venv/
build/
develop-eggs/
dist/
Expand Down
66 changes: 34 additions & 32 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
from setuptools import setup, find_packages
from setuptools.command.install import install
from distutils.core import Command
import os


class MakeReadme(Command):
description = "Generates a README.rst version of README.md"
description = 'Generates a README.rst version of README.md'
user_options = []

def initialize_options(self):
Expand All @@ -24,54 +25,55 @@ def run(self):
readme.write(rst)
readme.close()
except ImportError:
raise ImportWarning("Module pypandoc not found, could not convert Markdown to RST")
raise ImportWarning('Module pypandoc not found, could not convert Markdown to RST')


req = open("requirements.txt")
req = open('requirements.txt')
REQUIREMENTS = req.readlines()
req.close()

rm = open("README.rst")
README = rm.readlines()
rm.close()
if os.path.isfile('README.rst') :
rm = open('README.rst')
README = rm.readlines()
rm.close()
else:
README = ''

# Dynamically retrieve the version from the module
version_string = __import__('zorg_gpio').__version__

setup(
name="zorg-gpio",
name='zorg-gpio',
version=version_string,
url="https://github.com/zorg/zorg-gpio",
description="GPIO drivers for Zorg robots.",
url='https://github.com/zorg/zorg-gpio',
description='GPIO drivers for Zorg robots.',
long_description=README,
maintainer="Zorg Group",
maintainer_email="gunthercx@gmail.com",
maintainer='Zorg Group',
maintainer_email='gunthercx@gmail.com',
packages=find_packages(),
package_dir={"zorg_gpio": "zorg_gpio"},
include_package_data=True,
package_dir={'zorg_gpio': 'zorg_gpio'},
install_requires=REQUIREMENTS,
license="MIT",
license='BSD',
zip_safe=True,
platforms=["any"],
keywords=["zorg", "gpio"],
platforms=['any'],
keywords=['zorg', 'gpio'],
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Environment :: Console",
"Environment :: Web Environment",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Environment :: Console',
'Environment :: Web Environment',
'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',
],
test_suite="tests",
tests_require=["mock"],
test_suite='tests',
tests_require=['mock'],
cmdclass={
"make_readme": MakeReadme,
'make_readme': MakeReadme,
}
)

0 comments on commit 2fea95e

Please sign in to comment.