Skip to content

Commit 65a9891

Browse files
authored
Merge pull request #11 from josephmje/infrastructure
STY: Fix typos and add Makefiles
2 parents 6f26dd0 + 546dcd5 commit 65a9891

File tree

7 files changed

+127
-13
lines changed

7 files changed

+127
-13
lines changed

.dockerignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ build/**/*
88
build
99
dist/**/*
1010
dist
11-
fmriprep.egg-info/**/*
12-
fmriprep.egg-info
11+
dmriprep.egg-info/**/*
12+
dmriprep.egg-info
1313
.eggs/**/*
1414
.eggs
1515

@@ -39,4 +39,4 @@ out/
3939
.zenodo.json
4040
.travis.yml
4141
.readthedocs.yml
42-
CONTRIBUTING.md
42+
CONTRIBUTING.md

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ RUN pip install --no-cache-dir "$( grep templateflow fmriprep-setup.cfg | xargs
163163
find $HOME/.cache/templateflow -type d -exec chmod go=u {} + && \
164164
find $HOME/.cache/templateflow -type f -exec chmod go=u {} +
165165

166-
# Installing FMRIPREP
166+
# Installing DMRIPREP
167167
COPY . /src/dmriprep
168168
ARG VERSION
169169
# Force static versioning within container

Makefile

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
.PHONY: clean clean-test clean-pyc clean-build docs help
2+
.DEFAULT_GOAL := help
3+
4+
define BROWSER_PYSCRIPT
5+
import os, webbrowser, sys
6+
7+
try:
8+
from urllib import pathname2url
9+
except:
10+
from urllib.request import pathname2url
11+
12+
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1])))
13+
endef
14+
export BROWSER_PYSCRIPT
15+
16+
define PRINT_HELP_PYSCRIPT
17+
import re, sys
18+
19+
for line in sys.stdin:
20+
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
21+
if match:
22+
target, help = match.groups()
23+
print("%-20s %s" % (target, help))
24+
endef
25+
export PRINT_HELP_PYSCRIPT
26+
27+
BROWSER := python -c "$$BROWSER_PYSCRIPT"
28+
29+
help:
30+
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
31+
32+
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
33+
34+
clean-build: ## remove build artifacts
35+
rm -fr build/
36+
rm -fr dist/
37+
rm -fr .eggs/
38+
find . -name '*.egg-info' -exec rm -fr {} +
39+
find . -name '*.egg' -exec rm -f {} +
40+
41+
clean-pyc: ## remove Python file artifacts
42+
find . -name '*.pyc' -exec rm -f {} +
43+
find . -name '*.pyo' -exec rm -f {} +
44+
find . -name '*~' -exec rm -f {} +
45+
find . -name '__pycache__' -exec rm -fr {} +
46+
47+
clean-test: ## remove test and coverage artifacts
48+
rm -fr .tox/
49+
rm -f .coverage
50+
rm -fr htmlcov/
51+
rm -fr .pytest_cache
52+
53+
lint: ## check style with flake8
54+
flake8 dmriprep tests
55+
56+
test: ## run tests quickly with the default Python
57+
py.test
58+
59+
test-all: ## run tests on every Python version with tox
60+
tox
61+
62+
coverage: ## check code coverage quickly with the default Python
63+
coverage run --source dmriprep -m pytest
64+
coverage report -m
65+
coverage html
66+
$(BROWSER) htmlcov/index.html
67+
68+
docs: ## generate Sphinx HTML documentation, including API docs
69+
rm -f docs/dmriprep*.rst
70+
rm -f docs/modules.rst
71+
sphinx-apidoc -o docs/ dmriprep
72+
$(MAKE) -C docs clean
73+
$(MAKE) -C docs html
74+
$(BROWSER) docs/_build/html/index.html
75+
76+
servedocs: docs ## compile the docs watching for changes
77+
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
78+
79+
release: dist ## package and upload a release
80+
twine upload dist/*
81+
82+
dist: clean ## builds source and wheel package
83+
python setup.py sdist
84+
python setup.py bdist_wheel
85+
ls -l dist
86+
87+
install: clean ## install the package to the active Python's site-packages
88+
python setup.py install
89+
90+
docker: docker
91+
docker build --rm -t nipreps/dmriprep:latest \
92+
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
93+
--build-arg VCS_REF=`git rev-parse --short HEAD` \
94+
--build-arg VERSION=$( python get_version.py ) .

README.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ dmriprep
33
========
44

55
.. image:: https://badgen.net/badge/chat/on%20mattermost/blue
6-
:target: https://mattermost.brainhack.org/brainhack/channels/dmriprep
7-
6+
:target: https://mattermost.brainhack.org/brainhack/channels/dmriprep
7+
88
.. image:: https://img.shields.io/pypi/v/dmriprep.svg
9-
:target: https://pypi.python.org/pypi/dmriprep
9+
:target: https://pypi.python.org/pypi/dmriprep
1010

1111
.. image:: https://circleci.com/gh/nipreps/dmriprep.svg?style=svg
1212
:target: https://circleci.com/gh/nipreps/dmriprep
1313

1414
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3392201.svg
15-
:target: https://doi.org/10.5281/zenodo.3392201
15+
:target: https://doi.org/10.5281/zenodo.3392201
1616

1717
.. image:: https://readthedocs.org/projects/dmriprep/badge/?version=latest
18-
:target: https://dmriprep.readthedocs.io/en/latest/?badge=latest
19-
:alt: Documentation Status
18+
:target: https://dmriprep.readthedocs.io/en/latest/?badge=latest
19+
:alt: Documentation Status
2020

2121

2222
The preprocessing of diffusion MRI (dMRI) involves numerous steps to clean and standardize
@@ -49,4 +49,4 @@ segmentation, skullstripping etc.) providing outputs that can be
4949
easily submitted to a variety of tractography algorithms.
5050

5151
[Documentation `dmriprep.org <https://dmriprep.readthedocs.io>`_]
52-
[Support `neurostars.org <https://neurostars.org/tags/fmriprep>`_]
52+
[Support `neurostars.org <https://neurostars.org/tags/dmriprep>`_]

dmriprep/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'__packagename__',
1616
]
1717

18-
# cmp is not used by fmriprep, so ignore nipype-generated warnings
18+
# cmp is not used by dmriprep, so ignore nipype-generated warnings
1919
_warnings.filterwarnings('ignore', r'cmp not installed')
2020
_warnings.filterwarnings('ignore', r'This has not been fully tested. Please report any failures.')
2121
_warnings.filterwarnings('ignore', r"can't resolve package from __spec__ or __package__")

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = python -msphinx
7+
SPHINXPROJ = dmriprep
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ maintainer_email = [email protected]
77
description = dMRIPrep is a robust and easy-to-use pipeline for preprocessing of diverse dMRI data.
88
long_description = file:README.rst
99
long_description_content_type = text/x-rst; charset=UTF-8
10-
license = 3-clause BSD
10+
license = Apache License, Version 2.0
1111
classifiers =
1212
Development Status :: 3 - Alpha
1313
Intended Audience :: Science/Research

0 commit comments

Comments
 (0)