-
Notifications
You must be signed in to change notification settings - Fork 259
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
RF: Cleanup Makefile to bring parity with CI, remove tox + nose references #1105
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -8,7 +8,7 @@ PROJECT=nibabel | |||||||||||||
# The Python executable to be used | ||||||||||||||
# | ||||||||||||||
PYTHON ?= python | ||||||||||||||
NOSETESTS = $(PYTHON) $(shell which nosetests) | ||||||||||||||
TEST_RUNNER ?= pytest | ||||||||||||||
|
||||||||||||||
# | ||||||||||||||
# Determine details on the Python/system | ||||||||||||||
|
@@ -66,7 +66,6 @@ distclean: clean | |||||||||||||
-o -iname '#*#' | xargs -L10 rm -f | ||||||||||||||
-rm -r dist | ||||||||||||||
-rm build-stamp | ||||||||||||||
-rm -r .tox | ||||||||||||||
# -rm tests/data/*.hdr.* tests/data/*.img.* tests/data/something.nii \ | ||||||||||||||
# tests/data/noise* tests/data/None.nii | ||||||||||||||
|
||||||||||||||
|
@@ -83,22 +82,23 @@ $(WWW_DIR): | |||||||||||||
# Tests | ||||||||||||||
# | ||||||||||||||
|
||||||||||||||
test: unittest testmanual | ||||||||||||||
test: test-style unittest testmanual | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
ut-%: build | ||||||||||||||
@PYTHONPATH=.:$(PYTHONPATH) $(NOSETESTS) nibabel/tests/test_$*.py | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
unittest: build | ||||||||||||||
@PYTHONPATH=.:$(PYTHONPATH) $(NOSETESTS) nibabel --with-doctest | ||||||||||||||
unittest: build test-clean | ||||||||||||||
export CHECK_TYPE=test; ./tools/ci/check.sh | ||||||||||||||
|
||||||||||||||
testmanual: build | ||||||||||||||
@cd doc/source && PYTHONPATH=../..:$(PYTHONPATH) $(NOSETESTS) --with-doctest --doctest-extension=.rst . dicom | ||||||||||||||
export CHECK_TYPE=doc; ./tools/ci/check.sh | ||||||||||||||
|
||||||||||||||
coverage: unittest | ||||||||||||||
|
||||||||||||||
coverage: build | ||||||||||||||
@PYTHONPATH=.:$(PYTHONPATH) $(NOSETESTS) --with-coverage --cover-package=nibabel | ||||||||||||||
.PHONY: test-style | ||||||||||||||
test-style: | ||||||||||||||
export CHECK_TYPE=style; ./tools/ci/check.sh | ||||||||||||||
Comment on lines
+95
to
+97
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 would rather put
Suggested change
|
||||||||||||||
|
||||||||||||||
.PHONY: test-clean | ||||||||||||||
test-clean: | ||||||||||||||
rm -rf for_testing | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
# | ||||||||||||||
|
@@ -252,11 +252,13 @@ sdist-venv: clean | |||||||||||||
rm -rf dist venv | ||||||||||||||
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 wasn't sure if this target is still being used anywhere -- so I kind of hacked it to install the dev dependencies to get it to pass on my local |
||||||||||||||
unset PYTHONPATH && $(PYTHON) setup.py sdist --formats=zip | ||||||||||||||
virtualenv --system-site-packages --python=$(PYTHON) venv | ||||||||||||||
. venv/bin/activate && pip install --ignore-installed nose | ||||||||||||||
. venv/bin/activate && pip install -r dev-requirements.txt | ||||||||||||||
mkdir venv/tmp | ||||||||||||||
cd venv/tmp && unzip ../../dist/*.zip | ||||||||||||||
. venv/bin/activate && cd venv/tmp/nibabel* && python setup.py install | ||||||||||||||
unset PYTHONPATH && . venv/bin/activate && cd venv && nosetests --with-doctest nibabel nisext | ||||||||||||||
unset PYTHONPATH && . \ | ||||||||||||||
venv/bin/activate && \ | ||||||||||||||
cd venv && $(TEST_RUNNER) --doctest-modules --doctest-plus nibabel nisext | ||||||||||||||
|
||||||||||||||
source-release: distclean | ||||||||||||||
$(PYTHON) -m compileall . | ||||||||||||||
|
@@ -269,17 +271,7 @@ venv-tests: | |||||||||||||
make distclean | ||||||||||||||
- rm -rf $(VIRTUAL_ENV)/lib/python$(PYVER)/site-packages/nibabel | ||||||||||||||
$(PYTHON) setup.py install | ||||||||||||||
cd .. && nosetests $(VIRTUAL_ENV)/lib/python$(PYVER)/site-packages/nibabel | ||||||||||||||
|
||||||||||||||
tox-fresh: | ||||||||||||||
# tox tests with fresh-installed virtualenvs. Needs network. And | ||||||||||||||
# pytox, obviously. | ||||||||||||||
tox -c tox.ini | ||||||||||||||
|
||||||||||||||
tox-stale: | ||||||||||||||
# tox tests with MB's already-installed virtualenvs (numpy and nose | ||||||||||||||
# installed) | ||||||||||||||
tox -e python25,python26,python27,python32,np-1.2.1 | ||||||||||||||
cd .. && $(TEST_RUNNER) $(VIRTUAL_ENV)/lib/python$(PYVER)/site-packages/nibabel | ||||||||||||||
|
||||||||||||||
refresh-readme: | ||||||||||||||
$(PYTHON) tools/refresh_readme.py | ||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Requirements for running tests | ||
-r requirements.txt | ||
pytest | ||
pytest-doctestplus | ||
flake8 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# Requirements for building docs | ||
-r requirements.txt | ||
sphinx<3 | ||
numpydoc | ||
jinja2<3 | ||
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 needed to pin these to get version compatibility to work. In the future might be better to use a tool like poetry so that we can generate a lockfile and not have to deal with this sort of not-fun dependency pinning 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 needed this to get my local to pass but it seems like CI might not like it.... I'll try reverting to see if if this is what is breaking the pre-release CI jobs |
||
numpydoc<1.3 | ||
MarkupSafe<2.1 | ||
texext | ||
matplotlib >=1.3.1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,10 +96,17 @@ nibabel = | |
max-line-length = 100 | ||
ignore = D100,D101,D102,D103,D104,D105,D200,D201,D202,D204,D205,D208,D209,D210,D300,D301,D400,D401,D403,E24,E121,E123,E126,E226,E266,E402,E704,E731,F821,I100,I101,I201,N802,N803,N804,N806,W503,W504,W605 | ||
exclude = | ||
venv | ||
build | ||
*test* | ||
*sphinx* | ||
nibabel/externals/* | ||
*/__init__.py | ||
# temporary -- should be removed in another PR | ||
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. Need a follow-up PR to clean up the remaining issues. I added these as ignores so that local flake8 passes. These were being covered up by the configuration of pep8speaks only looking at the diff |
||
./doc/source/conf.py | ||
./doc/tools/apigen.py | ||
./nisext | ||
./tools | ||
|
||
[versioneer] | ||
VCS = git | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
if [ -e virtenv/bin/activate ]; then | ||
source virtenv/bin/activate | ||
elif [ -e virtenv/Scripts/activate ]; then | ||
source virtenv/Scripts/activate | ||
if [ -e venv/bin/activate ]; then | ||
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 change was made so that we are consistent in local dev and remote dev with the virtualenv |
||
source venv/bin/activate | ||
elif [ -e venv/Scripts/activate ]; then | ||
source venv/Scripts/activate | ||
else | ||
echo Cannot activate virtual environment | ||
ls -R virtenv | ||
ls -R venv | ||
false | ||
fi | ||
|
This file was deleted.
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.
I removed this as I did not see it being used anywhere. I can revert this if a maintainer feels it should be brought back