Skip to content

Commit

Permalink
Merge pull request #98 from dbaxa/make_setup_test_work_without_instal…
Browse files Browse the repository at this point in the history
…ling_deps_first

Make `python setup.py test` work without first needing to install any…
  • Loading branch information
ssbarnea committed Jul 15, 2015
2 parents ce6c2b6 + abc3d22 commit ac23534
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import re
import sys
import subprocess
import warnings
import codecs

Expand Down Expand Up @@ -67,11 +68,13 @@ def finalize_options(self):

def run_tests(self):
# before running tests we need to run autopep8
r = os.system(
"python -m autopep8 -r --in-place jira/ tests/ examples/")
if r:
raise Exception("autopep8 failed")

try:
r = subprocess.check_call(
"python -m autopep8 -r --in-place jira/ tests/ examples/",
shell=True)
except subprocess.CalledProcessError:
logging.getLogger().warn('autopep8 is not installed so '
'it will not be run')
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
Expand Down Expand Up @@ -140,16 +143,18 @@ def run(self):
packages=find_packages(exclude=['tests', 'tools']),
include_package_data=True,


install_requires=['requests>=2.6.0',
'requests_oauthlib>=0.3.3',
'tlslite>=0.4.4',
'six>=1.9.0',
'requests_toolbelt',
'ordereddict'],
setup_requires=[],
setup_requires=['pytest', ],
tests_require=['pytest', 'tlslite>=0.4.4', 'requests>=2.6.0',
'setuptools', 'pep8', 'autopep8', 'sphinx', 'six>=1.9.0'],
'setuptools', 'pep8', 'autopep8', 'sphinx', 'six>=1.9.0',
'pytest-cov', 'pytest-pep8', 'pytest-instafail',
'pytest-xdist',
],
extras_require={
'magic': ['filemagic>=1.6'],
'shell': ['ipython>=0.13'],
Expand Down

0 comments on commit ac23534

Please sign in to comment.