Skip to content
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

DOC: Build versioned docs and deploy them to gh-pages #45

Merged
merged 8 commits into from
Dec 12, 2019
Merged

DOC: Build versioned docs and deploy them to gh-pages #45

merged 8 commits into from
Dec 12, 2019

Conversation

oesteban
Copy link
Member

This PR adds three new build steps to our CircleCI workflow.
The first one, called build_docs generates the documentation
of the project using sphinx.
In the case the commit message contains the tag [docs versions]
(or a few variations thereof), then a readthedocs-style of versioned
documentation is built.
The other two build steps are run only for tag-commits and the master
branch, to deploy the new versioned documentation to GitHub pages.

I've set up the corresponding write-access keys in the repo and
CircleCI, so this first step towards having documentation should fairly
good to go.

@pull-assistant
Copy link

pull-assistant bot commented Dec 12, 2019

@pep8speaks
Copy link

pep8speaks commented Dec 12, 2019

Hello @oesteban, Thank you for updating!

Line 20:1: E402 module level import not at top of file

Line 65:42: E226 missing whitespace around arithmetic operator
Line 114:13: E123 closing bracket does not match indentation of opening bracket's line
Line 145:33: E226 missing whitespace around arithmetic operator
Line 145:63: E226 missing whitespace around arithmetic operator
Line 158:30: E226 missing whitespace around arithmetic operator
Line 287:31: W605 invalid escape sequence '\w'
Line 287:41: W605 invalid escape sequence '\s'
Line 287:45: W605 invalid escape sequence '\w'
Line 287:47: W605 invalid escape sequence '.'
Line 287:51: W605 invalid escape sequence '('
Line 287:55: W605 invalid escape sequence ')'
Line 331:32: E226 missing whitespace around arithmetic operator
Line 336:24: E226 missing whitespace around arithmetic operator
Line 341:53: W605 invalid escape sequence '*'
Line 433:21: E226 missing whitespace around arithmetic operator
Line 446:31: E226 missing whitespace around arithmetic operator
Line 469:49: W605 invalid escape sequence '*'
Line 471:13: F841 local variable 'e' is assigned to but never used
Line 487:9: F841 local variable 'signature' is assigned to but never used
Line 487:53: W605 invalid escape sequence '*'
Line 513:21: E126 continuation line over-indented for hanging indent
Line 551:22: W503 line break before binary operator
Line 552:21: W503 line break before binary operator
Line 553:21: W503 line break before binary operator
Line 563:21: W503 line break before binary operator

Line 1:10: E401 multiple imports on one line
Line 5:1: E302 expected 2 blank lines, found 1
Line 20:24: E226 missing whitespace around arithmetic operator
Line 41:22: E231 missing whitespace after ','
Line 41:33: E231 missing whitespace after ','
Line 45:45: E231 missing whitespace after ','
Line 87:26: E226 missing whitespace around arithmetic operator
Line 87:48: E226 missing whitespace around arithmetic operator
Line 87:70: E226 missing whitespace around arithmetic operator
Line 129:52: E231 missing whitespace after ','
Line 150:42: E231 missing whitespace after ','
Line 152:41: E231 missing whitespace after ','
Line 165:17: W503 line break before binary operator
Line 191:35: E231 missing whitespace after ','
Line 194:1: E302 expected 2 blank lines, found 1
Line 199:1: E302 expected 2 blank lines, found 1
Line 204:1: E302 expected 2 blank lines, found 1
Line 209:1: E302 expected 2 blank lines, found 1

Line 23:1: E302 expected 2 blank lines, found 1
Line 51:1: E302 expected 2 blank lines, found 1
Line 78:5: E265 block comment should start with '# '
Line 92:1: E302 expected 2 blank lines, found 1
Line 107:5: F841 local variable 'app' is assigned to but never used
Line 108:5: E265 block comment should start with '# '
Line 113:1: E302 expected 2 blank lines, found 1
Line 129:5: E265 block comment should start with '# '
Line 146:1: W293 blank line contains whitespace

Line 3:1: E302 expected 2 blank lines, found 1
Line 33:5: E306 expected 1 blank line before a nested definition, found 0
Line 51:1: W293 blank line contains whitespace
Line 60:1: W293 blank line contains whitespace

Line 31:1: E402 module level import not at top of file
Line 32:1: E402 module level import not at top of file
Line 32:1: F401 'sphinx.util.compat.Directive' imported but unused
Line 35:5: E731 do not assign a lambda expression, use a def
Line 37:5: E731 do not assign a lambda expression, use a def
Line 37:22: F821 undefined name 'unicode'
Line 60:19: F821 undefined name 'unicode'
Line 141:1: E305 expected 2 blank lines after class or function definition, found 1
Line 141:1: E402 module level import not at top of file
Line 142:1: E402 module level import not at top of file
Line 143:1: E402 module level import not at top of file

Line 30:1: E302 expected 2 blank lines, found 1
Line 42:31: E251 unexpected spaces around keyword / parameter equals
Line 42:33: E251 unexpected spaces around keyword / parameter equals
Line 60:15: W605 invalid escape sequence '.'
Line 68:15: W605 invalid escape sequence '.'
Line 68:27: W605 invalid escape sequence '.'
Line 164:41: E261 at least two spaces before inline comment
Line 186:23: E231 missing whitespace after ','
Line 224:13: E122 continuation line missing indentation or outdented
Line 225:13: E122 continuation line missing indentation or outdented
Line 279:56: E231 missing whitespace after ','
Line 279:59: E231 missing whitespace after ','
Line 298:19: E126 continuation line over-indented for hanging indent
Line 299:26: E226 missing whitespace around arithmetic operator
Line 303:19: E127 continuation line over-indented for visual indent
Line 381:46: W605 invalid escape sequence '.'
Line 405:21: E129 visually indented line with same indent as next logical line
Line 412:9: F841 local variable 'main_module' is assigned to but never used
Line 470:39: E231 missing whitespace after ','
Line 493:42: E226 missing whitespace around arithmetic operator
Line 499:24: E231 missing whitespace after ','
Line 508:47: E231 missing whitespace after ','

Line 8:1: F401 're' imported but unused
Line 16:1: E265 block comment should start with '# '
Line 18:1: E302 expected 2 blank lines, found 1

To test for issues locally, pip install flake8 and then run flake8 dmriprep.

Comment last updated at 2019-12-12 07:36:58 UTC

This PR adds three new build steps to our CircleCI workflow.
The first one, called ``build_docs`` generates the documentation
of the project using sphinx.
In the case the commit message contains the tag ``[docs versions]``
(or a few variations thereof), then a readthedocs-style of versioned
documentation is built.
The other two build steps are run only for tag-commits and the master
branch, to deploy the new versioned documentation to GitHub pages.

I've set up the corresponding write-access keys in the repo and
CircleCI, so this first step towards having documentation should fairly
good to go.
@oesteban
Copy link
Member Author

Finally :). The pre-render of the docs is here: https://154-206670456-gh.circle-artifacts.com/0/root/project/docs/_build/no_version_html/html/index.html

This will be very useful to visualize finalized workflows (see https://154-206670456-gh.circle-artifacts.com/0/root/project/docs/_build/no_version_html/html/api/dmriprep.workflows.base.html)

Also, it will be possible to have a nice view of the docstrings and doctest examples we embed in our code (e.g., latest additions by @dPys on https://154-206670456-gh.circle-artifacts.com/0/root/project/docs/_build/no_version_html/html/api/dmriprep.utils.vectors.html)

@oesteban
Copy link
Member Author

An additional feature is: by using Nipype's sphinx extension to generate the workflow graph we are exercising the workflow creation function (is a kind of implicit unit test :))

@codecov-io
Copy link

codecov-io commented Dec 12, 2019

Codecov Report

Merging #45 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #45   +/-   ##
=======================================
  Coverage   54.66%   54.66%           
=======================================
  Files          11       11           
  Lines         772      772           
  Branches      116      116           
=======================================
  Hits          422      422           
  Misses        349      349           
  Partials        1        1
Impacted Files Coverage Δ
dmriprep/workflows/base.py 30.88% <ø> (ø) ⬆️
dmriprep/cli/version.py 92.45% <ø> (ø) ⬆️
dmriprep/interfaces/__init__.py 46.42% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 59a12cc...8a61f26. Read the comment docs.

@dPys
Copy link
Collaborator

dPys commented Dec 12, 2019

These look great!

@oesteban oesteban requested review from josephmje and arokem December 12, 2019 02:26
@oesteban
Copy link
Member Author

Yep, I'm eager to see the graph of new workflows in #25

Copy link
Collaborator

@josephmje josephmje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!!! I just had a few comments and fixed some typos.

docs/conf.py Outdated Show resolved Hide resolved
docs/conf.py Outdated Show resolved Hide resolved
* within a `Manually Prepared Environment (Python 3.5+)`_, also known as
*bare-metal installation*; or
* using container technologies (RECOMMENDED), such as
`Docker <https://fmriprep.readthedocs.io/en/stable/docker.html>`__ or
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove references to running fmriprep via Docker and Singularity

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually, we will generate these docs - but for now, I guess we need to pull from fMRIPrep for this.

docs/installation.rst Outdated Show resolved Hide resolved
https://docs.docker.com/get-started/

After checking your Docker Engine is capable of running Docker images, then go ahead
and `check out our documentation <https://fmriprep.readthedocs.io/en/stable/docker.html>`__
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix link

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, same as above. I didn't want to copy the whole thing.

.. warning::

This method is not recommended! Please checkout container alternatives
such as `Docker <https://fmriprep.readthedocs.io/en/stable/docker.html>`__, or
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix links

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

docs/installation.rst Outdated Show resolved Hide resolved
docs/usage.rst Outdated Show resolved Hide resolved
docs/usage.rst Outdated Show resolved Hide resolved
sphinx-argparse
sphinx_rtd_theme
sphinxcontrib-apidoc ~= 0.3.0
sphinxcontrib-napoleon
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the versions in requirements.txt also be pinned here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They should not for link-dependencies (i.e., pointing to a github repo and commit directly). If you did then Pypi will not accept the package :(. This is the case of napoleon and versioning.

Copy link
Collaborator

@arokem arokem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. I spotted one old thing that we could fix up now, but other than that 👍 from my end.

dmriprep/workflows/base.py Outdated Show resolved Hide resolved
docs/usage.rst Outdated Show resolved Hide resolved
@oesteban
Copy link
Member Author

I'll go ahead and merge since we want to test the actual deployment from master.

@oesteban oesteban merged commit 3a79c62 into nipreps:master Dec 12, 2019
@oesteban oesteban deleted the docs/build-documentation branch December 12, 2019 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants