Skip to content

Commit

Permalink
Split setup.py read into read+readlines
Browse files Browse the repository at this point in the history
  • Loading branch information
fbcotter committed Nov 28, 2017
1 parent 5851315 commit c9f33be
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
def readlines(fname):
enc = 'utf-8'
return open(os.path.join(os.path.dirname(__file__), fname), 'r',
encoding=enc).readlines()


def read(fname):
enc = 'utf-8'
return open(os.path.join(os.path.dirname(__file__), fname), 'r',
encoding=enc).read()


# Read metadata from version file
def get_version():
f = read("plotters.py")
f = readlines("plotters.py")
for line in f:
if line.startswith("__version__"):
return line[15:-2]
Expand All @@ -34,7 +40,8 @@ def get_version():

setup(
name='plotters',
version=get_version(),
# version=get_version(),
version="0.0.5",
author="Fergal Cotter",
author_email="fbc23@cam.ac.uk",
description=("Convenience Functions for Plotting in Matplotlib"),
Expand All @@ -46,8 +53,8 @@ def get_version():
classifiers=classifiers,
py_modules=["plotters"],
install_requires=["numpy", "matplotlib"],
tests_require=["pytest"],
extras_require={
'docs': ['sphinx', 'docutils']
}
# tests_require=["pytest"],
# extras_require={
# 'docs': ['sphinx', 'docutils']
# }
)

0 comments on commit c9f33be

Please sign in to comment.