Skip to content

Commit 3cf082b

Browse files
Merge pull request #8 from ekonstantinidis/project-uptodate
Bring project up to date
2 parents b4031a1 + 0514e35 commit 3cf082b

File tree

8 files changed

+49
-23
lines changed

8 files changed

+49
-23
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ lib/
1313
lib64/
1414
parts/
1515
sdist/
16+
.tox/
1617
var/
1718
*.egg-info/
1819
.installed.cfg

.travis.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,24 @@ language: python
22

33
sudo: false
44

5-
python:
6-
- "2.7"
7-
- "3.4"
8-
- "3.5"
5+
env:
6+
- TOX_ENV=py27
7+
- TOX_ENV=py34
8+
9+
matrix:
10+
fast_finish: true
11+
12+
before_install:
13+
- pip install codecov
914

1015
install:
11-
- pip install -r requirements.txt
16+
- pip install tox
1217

1318
script:
14-
- python runtests.py
19+
- tox -e $TOX_ENV
20+
21+
after_success:
22+
- codecov
1523

1624
notifications:
1725
slack:

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pypiup [![travis][travis-image]][travis-url] [![pypi][pypi-image]][pypi-url]
1+
# pypiup [![travis][travis-image]][travis-url] [![codecov][codecov-image]][codecov-url] [![pypi][pypi-image]][pypi-url]
22
Check whether your PyPI requirements are up to date.
33

44
[![press][press-image]][press-url]
@@ -55,6 +55,9 @@ In order to run the tests you will have to run:
5555
[travis-image]: https://travis-ci.org/ekonstantinidis/pypiup.svg?branch=master
5656
[travis-url]: https://travis-ci.org/ekonstantinidis/pypiup
5757

58+
[codecov-image]: https://codecov.io/github/ekonstantinidis/pypiup/coverage.svg?branch=master
59+
[codecov-url]: https://codecov.io/github/ekonstantinidis/pypiup?branch=master
60+
5861
[pypi-image]: https://badge.fury.io/py/pypiup.svg
5962
[pypi-url]: https://pypi.python.org/pypi/pypiup/
6063

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
click==6.4
22
flake8==2.5.4
3-
coverage==4.0.3
3+
nose2==0.6.4
4+
cov-core==1.15.0
45
requests==2.9.1
56
httpretty==0.8.14
67
semantic-version==2.5.0

requirements/requirements-demo.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Django==1.9.4
2-
click==6.3
3-
djangorestframework==3.3.3
1+
Django==1.7.1
2+
click==6.1
3+
djangorestframework==3.3.2
44
django-crispy-forms==1.4.0
5-
drfdocs==0.0.9
6-
apscheduler==3.0.5
5+
drfdocs==0.0.5
6+
apscheduler==3.0.3
77

88
# commented-package==1.2.3
99
testing-errors-abc==0.0.12

runtests.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44

55

66
FLAKE8_ARGS = ['pypiup/', 'tests/', '--ignore=E501']
7-
COVERAGE_ARGS = ['--source=pypiup', '--omit=pypiup/__init__.py', 'python -m unittest -v tests/tests.py']
7+
NOSE2_ARGS = [
8+
'--with-coverage',
9+
'--coverage', 'pypiup',
10+
'--coverage-report', 'term-missing',
11+
'--coverage-report', 'html',
12+
'--verbose'
13+
]
814

915

1016
def exit_on_failure(command, message=None):
@@ -13,16 +19,16 @@ def exit_on_failure(command, message=None):
1319

1420

1521
def flake8_main(args):
16-
print('Running: flake8', FLAKE8_ARGS)
22+
print('Running: flake8 %s' % FLAKE8_ARGS)
1723
command = subprocess.call(['flake8'] + args)
18-
print("" if command else "Success. flake8 passed.")
24+
print("" if command else "Success. flake8 passed.\n")
1925
return command
2026

2127

22-
def run_tests_coverage(args):
23-
command = subprocess.call('coverage run --source=pypiup --omit=pypiup/__init__.py -m unittest tests.tests_cli', shell=True)
24-
command = subprocess.call(['coverage', 'report'])
28+
def run_tests(args):
29+
print('Running: nose2 -v %s' % " ".join(args))
30+
command = subprocess.call(['nose2'] + args)
2531
return command
2632

2733
exit_on_failure(flake8_main(FLAKE8_ARGS))
28-
exit_on_failure(run_tests_coverage(COVERAGE_ARGS))
34+
exit_on_failure(run_tests(NOSE2_ARGS))
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,3 @@ def test_cli_file_not_found(self):
7575

7676
self.assertEqual(result.exit_code, 0)
7777
self.assertIn("Could not find requirements-fake.txt. No such file or directory.", result.output)
78-
79-
if __name__ == '__main__':
80-
unittest.main()

tox.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[tox]
2+
envlist = py27,py34
3+
4+
[testenv]
5+
setenv =
6+
PYTHONDONTWRITEBYTECODE = 1
7+
deps =
8+
-rrequirements.txt
9+
commands =
10+
python runtests.py

0 commit comments

Comments
 (0)