Remove module import from setup.py

Get the version number from the file, not by importing and thus trying
to import requests
This commit is contained in:
Ben Lopatin
2016-04-08 17:57:19 -04:00
parent 63f120ddca
commit 1e151fc51f
3 changed files with 10 additions and 4 deletions
+9 -3
View File
@@ -2,7 +2,12 @@ from setuptools import setup, find_packages
README = open('README.rst').read()
VERSION = __import__("pydiscourse").__version__
with open("pydiscourse/__init__.py", "r") as module_file:
for line in module_file:
if line.startswith("__version__"):
version_string = line.split("=")[1]
VERSION = version_string.strip().replace("'", "")
setup(
@@ -15,10 +20,11 @@ setup(
license="BSD",
url="https://github.com/bennylope/pydiscourse",
packages=find_packages(exclude=["tests.*", "tests"]),
install_requires=['requests>=2.0.0'],
install_requires=[
'requests>=2.0.0',
],
tests_require=[
'mock',
'requests>=2.0.0',
],
test_suite='tests',
entry_points={
-1
View File
@@ -1,7 +1,6 @@
import sys
import unittest
import mock
import requests
from pydiscourse import client
+1
View File
@@ -4,6 +4,7 @@ envlist = py27, py34, py35, pypy, pypy3
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/pydiscourse
deps=requests
commands = python setup.py test
[testenv:flake8]