put file reading into function, we'll soon need that for more stuff

like e.g. reading long_description from README.rst + CHANGES.rst.
This commit is contained in:
Thomas Waldmann 2015-01-29 15:25:28 +01:00
parent 219b25cd98
commit af8edbc21c
2 changed files with 7 additions and 4 deletions

View file

@ -1,3 +1,2 @@
"""Let's Encrypt."""
__version__ = "0.1"

View file

@ -5,13 +5,17 @@ import codecs
from setuptools import setup
def read_file(filename, encoding='utf8'):
"""read unicode from given file"""
with codecs.open(filename, encoding=encoding) as fd:
return fd.read()
here = os.path.abspath(os.path.dirname(__file__))
# read version number (and other metadata) from package init
init_fn = os.path.join(here, 'letsencrypt', '__init__.py')
with codecs.open(init_fn, encoding='utf8') as meta_file:
content = meta_file.read()
meta = dict(re.findall(r"""__([a-z]+)__ = "([^"]+)""", content))
meta = dict(re.findall(r"""__([a-z]+)__ = "([^"]+)""", read_file(init_fn)))
install_requires = [
'argparse',