Skip to content

Commit

Permalink
Fixes running tests via tox
Browse files Browse the repository at this point in the history
Corrected linting errors and removed rouge 'print' calls.

Moved to using nosetest as the setup.py test runner. This is mainly as nose
give clearer error messages when something goes wrong.

Also of note there were pinned dependencies which have been changed to
'at least' version dependencies. For reasons why see
https://caremad.io/posts/2013/07/setup-vs-requirement/

Laster, we currently have a README.md and a README.rst. I'm unsure which one of these
we mean to use. Shouldn't we at the very least keep all of the following in
the same markup format: README, HISTORY, CONTRIBUTING, AUTHORS,
  • Loading branch information
tomdottom committed May 26, 2018
1 parent 93e8722 commit 6debcce
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include CONTRIBUTING.rst
include HISTORY.rst
include LICENSE
include README.rst
include README.md

recursive-include tests *
recursive-exclude * __pycache__
Expand Down
16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@
history = history_file.read()

requirements = [
'Click>=6.0',
'humanfriendly==4.8',
'requirements-parser==0.2.0',
'termcolor==1.1.0',
'Click>=6',
'humanfriendly>=4',
'requirements-parser>=0.2',
'termcolor>=1',
'setuptools>=',
'requests>=2',
]

setup_requirements = [
# TODO(phildini): Put setup requirements (distutils extensions, etc.) here
'nose'
]

test_requirements = [
# TODO: Put package test requirements here
'ddt',
]

setup(
Expand Down Expand Up @@ -60,7 +62,7 @@
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
test_suite='tests',
test_suite='nose.collector',
tests_require=test_requirements,
setup_requires=setup_requirements,
)
3 changes: 0 additions & 3 deletions thanks/package_tools.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from functools import reduce
from itertools import chain, takewhile
import json
import os
import pkg_resources
import re
Expand All @@ -26,7 +25,6 @@ def get_dist_metadata(dist):


def get_funding_data(metadata):
print(metadata)
return metadata.get('funding_url')


Expand All @@ -53,7 +51,6 @@ def get_local_dist_metadata_filepath(dist):
ext = None
metadata_file = None


filename = '{}.{}'.format(filename, ext)
path = os.path.join(dist.location, filename, metadata_file)

Expand Down
5 changes: 3 additions & 2 deletions thanks/thanks.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ def _display_thanks(self):
"the project repository asking the author to ",
colored("ADD A 'FUNDING' PROJECT_URL ", "yellow"),
"to the projects setup.py"
])
, attrs=['bold'])
]),
attrs=['bold']
)

def get_local_data(self, project_name):
try:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ commands = flake8 thanks
setenv =
PYTHONPATH = {toxinidir}

commands = python setup.py test
commands = python setup.py nosetests

0 comments on commit 6debcce

Please sign in to comment.