Merge pull request #25 from rooterkyberian/issue_19

Fix chicken and egg problem of #19
This commit is contained in:
Michał Sałaban 2018-06-06 14:10:59 +02:00 committed by GitHub
commit f3ea24d7c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 1 deletions

View File

@ -1,8 +1,29 @@
# -*- coding: utf-8 -*-
import codecs
import os
import re
from distutils.core import setup
from setuptools import find_packages
version = __import__('monero').__version__
here = os.path.abspath(os.path.dirname(__file__))
def find_version(*parts):
"""
Figure out version number without importing the package.
https://packaging.python.org/guides/single-sourcing-package-version/
"""
with codecs.open(os.path.join(here, *parts), 'r', errors='ignore') as fp:
version_file = fp.read()
version_match = re.search(r"^__version__ = ['\"](.*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
version = find_version('monero', '__init__.py')
setup(
name = 'monero-python',