New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved test dependency handling, removal of wrapper testing script, and fixes for running pytest directly (issue #644) #781
Changes from all commits
ca44aab
0fecb80
ba6fb21
c2cadaa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ def get_path(fname): | |
return os.path.join(os.path.dirname(__file__), fname) | ||
|
||
|
||
requirements = [ | ||
install_requirements = [ | ||
"Django>=1.11,<2.0", | ||
"bleach>=1.5,<2", | ||
"Pillow", | ||
|
@@ -34,6 +34,30 @@ def get_path(fname): | |
"Markdown>=2.6,<2.7", | ||
] | ||
|
||
test_requirements = [ | ||
'django-functest>=1.0,<1.1', | ||
'mock>=2.0,<2.1', | ||
'pytest>=3.4,<3.5', | ||
'pytest-django>=3.1,<3.2', | ||
'pytest-cov>=2.4,<2.5', | ||
'pytest-pythonpath>=0.7,<0.8', | ||
] | ||
|
||
test_lint_requirements = [ | ||
'flake8>=3.5,<3.6', | ||
] | ||
|
||
setup_requirements = [ | ||
'pytest-runner', | ||
] | ||
|
||
development_requirements = test_requirements + test_lint_requirements | ||
|
||
extras_requirements = { | ||
'devel': development_requirements, | ||
'test': test_requirements, | ||
'testlint': test_lint_requirements, | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I love this pattern!! Really nice overview of requirements, everything maintained in the same place, and the loosest form of dependencies that affect distribution and testing at the same time. |
||
|
||
setup( | ||
name="wiki", | ||
|
@@ -49,7 +73,7 @@ def get_path(fname): | |
py_modules=[os.path.splitext(os.path.basename(path))[0] for path in glob('src/*.py')], | ||
long_description=open('README.rst').read(), | ||
zip_safe=False, | ||
install_requires=requirements, | ||
install_requires=install_requirements, | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', | ||
|
@@ -68,5 +92,7 @@ def get_path(fname): | |
'Topic :: Software Development :: Libraries :: Application Frameworks', | ||
], | ||
include_package_data=True, | ||
test_suite='runtests', | ||
setup_requires=setup_requirements, | ||
tests_require=test_requirements, | ||
extras_require=extras_requirements, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,29 +28,13 @@ commands = | |
# Test that there are no migrations needed -- on Django 1.11, we can | ||
# use --check and remove the '!' which likely doesn't work on Windows | ||
sh -c '! testproject/manage.py makemigrations --dry-run --exit --noinput' | ||
{toxinidir}/runtests.py --basetemp={envtmpdir} --ds=tests.settings --cov=src/wiki --cov-config .coveragerc {posargs} | ||
pytest --basetemp={envtmpdir} --ds=tests.settings --cov={envsitepackagesdir}/wiki --cov-config .coveragerc {posargs} | ||
|
||
usedevelop = true | ||
usedevelop = false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a very important addition!! Great work!! |
||
|
||
deps = | ||
coverage | ||
pytest==3.0.7 | ||
pytest-django==3.1.2 | ||
pytest-pythonpath==0.7.1 | ||
pytest-cov==2.4.0 | ||
Pillow==2.3.0 | ||
django-classy-tags==0.4 | ||
mock>=2.0 | ||
Markdown==2.6.7 | ||
django_nyt==1.0 | ||
bleach==1.5.0 | ||
django111: Django==1.11 | ||
django-mptt==0.8.6 | ||
django-sekizai==0.10.0 | ||
sorl-thumbnail==12.3 | ||
django-functest==1.0.2 | ||
django-webtest==1.9.2 | ||
WebTest==2.0.28 | ||
.[test] | ||
django111: Django>=1.11,<2.0 | ||
|
||
basepython = | ||
py34: python3.4 | ||
|
@@ -60,7 +44,7 @@ basepython = | |
|
||
[testenv:lint] | ||
basepython = python3.4 | ||
deps = flake8 | ||
deps = .[testlint] | ||
commands = | ||
flake8 src/wiki | ||
flake8 tests/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed! Actually flake8 has been introducing changes that broke linting out of no where... it's best to be explicit about which version of flake8 that linting is supposed to conform to (together with specs in setup.cfg)