Skip to content

Commit

Permalink
make sure to close files
Browse files Browse the repository at this point in the history
  • Loading branch information
thijstriemstra committed Feb 26, 2017
1 parent ecb70e1 commit 232e1f9
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
import sys
from setuptools import setup

README = open(os.path.join(os.path.dirname(__file__), "README.rst")).read()
CONTRIB = open(os.path.join(os.path.dirname(__file__), "CONTRIBUTING.rst")).read()
CHANGES = open(os.path.join(os.path.dirname(__file__), "CHANGES.rst")).read()
version = open(os.path.join(os.path.dirname(__file__), "VERSION.txt")).read().strip()

def read_file(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as r:
return r.read()


README = read_file("README.rst")
CONTRIB = read_file("CONTRIBUTING.rst")
CHANGES = read_file("CHANGES.rst")
version = read_file("VERSION.txt").strip()

needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
Expand All @@ -32,7 +38,7 @@
packages=["luma.oled"],
zip_safe=False,
install_requires=["luma.core>=0.2.0"],
setup_requires=[] + pytest_runner,
setup_requires=pytest_runner,
tests_require=["mock", "pytest", "pytest-cov", "python-coveralls"],
classifiers=[
"License :: OSI Approved :: MIT License",
Expand Down

0 comments on commit 232e1f9

Please sign in to comment.