Skip to content

Commit 34ecab8

Browse files
authored
Merge pull request #235 from satra/ref-etelemetry
fix doc building and updated style
2 parents df1d2e1 + c377475 commit 34ecab8

File tree

10 files changed

+59
-64
lines changed

10 files changed

+59
-64
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
command: pip install --no-cache-dir -r docs/requirements.txt
5050
- run:
5151
name: Build only this commit
52-
command: make -C docs SPHINXOPTS="-W" BUILDDIR="_build/no_version_html" html
52+
command: make -C docs SPHINXOPTS="-W" BUILDDIR="_build/no_version_html" SPHINX_APIDOC_OPTIONS="members,undoc-members,show-inheritance,noindex" html
5353
- store_artifacts:
5454
path: ./docs/_build/no_version_html
5555
- run:

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Like this:
2424
```
2525
<code>
2626
```
27-
-->
27+
-->

.github/ISSUE_TEMPLATE/question.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Include the following:
1212
------------------------
1313
What are you trying to accomplish?
1414
What have you tried?
15-
-->
15+
-->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
- [ ] All tests passing
1313
- [ ] I have added tests to cover my changes
1414
- [ ] I have updated documentation (if necessary)
15-
- [ ] My code follows the code style of this project
16-
(we are using `black`: you can `pip install pre-commit`,
17-
run `pre-commit install` in the `pydra` directory
15+
- [ ] My code follows the code style of this project
16+
(we are using `black`: you can `pip install pre-commit`,
17+
run `pre-commit install` in the `pydra` directory
1818
and `black` will be run automatically with each commit)
1919

2020
## Acknowledgment
21-
- [ ] I acknowledge that this contribution will be available under the Apache 2 license.
21+
- [ ] I acknowledge that this contribution will be available under the Apache 2 license.

LICENSE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
1111
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
14-

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
include versioneer.py
22
include pydra/_version.py
3-
include pydra/schema/context.jsonld
3+
include pydra/schema/context.jsonld

docs/conf.py

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,18 @@
1313
import sys
1414
from pathlib import Path
1515
from packaging.version import Version
16+
1617
sys.path.insert(0, str(Path(__file__).parent.parent.absolute()))
17-
sys.path.insert(1, str(Path(__file__).parent / 'sphinxext'))
18+
sys.path.insert(1, str(Path(__file__).parent / "sphinxext"))
1819
from pydra import __version__
1920
from github_link import make_linkcode_resolve
2021

2122

2223
# -- Project information -----------------------------------------------------
2324

24-
project = 'Pydra: A simple dataflow engine with scalable semantics'
25-
copyright = '2019 - 2020, The Nipype Developers team'
26-
author = 'The Nipype Developers team'
25+
project = "Pydra: A simple dataflow engine with scalable semantics"
26+
copyright = "2019 - 2020, The Nipype Developers team"
27+
author = "The Nipype Developers team"
2728

2829
# The full version, including alpha/beta/rc tags
2930
release = __version__
@@ -36,75 +37,66 @@
3637
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3738
# ones.
3839
extensions = [
39-
'sphinx.ext.autodoc',
40-
'sphinx.ext.doctest',
41-
'sphinx.ext.intersphinx',
42-
'sphinx.ext.coverage',
43-
'sphinx.ext.mathjax',
44-
'sphinx.ext.ifconfig',
45-
'sphinx.ext.linkcode',
46-
'sphinx.ext.githubpages',
47-
'sphinxcontrib.apidoc',
48-
'sphinxcontrib.napoleon'
40+
"sphinx.ext.autodoc",
41+
"sphinx.ext.doctest",
42+
"sphinx.ext.intersphinx",
43+
"sphinx.ext.coverage",
44+
"sphinx.ext.mathjax",
45+
"sphinx.ext.ifconfig",
46+
"sphinx.ext.linkcode",
47+
"sphinx.ext.githubpages",
48+
"sphinxcontrib.apidoc",
49+
"sphinxcontrib.napoleon",
4950
]
5051

5152
# Add any paths that contain templates here, relative to this directory.
52-
templates_path = ['_templates']
53+
templates_path = ["_templates"]
5354

5455
# List of patterns, relative to source directory, that match files and
5556
# directories to ignore when looking for source files.
5657
# This pattern also affects html_static_path and html_extra_path.
57-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'api/pydra.rst']
58+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "api/pydra.rst"]
5859

5960

6061
# -- Options for HTML output -------------------------------------------------
6162

6263
# The theme to use for HTML and HTML Help pages. See the documentation for
6364
# a list of builtin themes.
6465
#
65-
html_theme = 'sphinx_rtd_theme'
66+
html_theme = "sphinx_rtd_theme"
6667

6768
# Add any paths that contain custom static files (such as style sheets) here,
6869
# relative to this directory. They are copied after the builtin static files,
6970
# so a file named "default.css" will overwrite the builtin "default.css".
70-
html_static_path = ['_static']
71+
html_static_path = ["_static"]
7172

7273
# -- Options for extensions ---------------------------------------------------
7374

7475
# Autodoc
75-
autodoc_mock_imports = [
76-
'cloudpickle',
77-
'matplotlib',
78-
'numpy',
79-
'psutil',
80-
]
81-
apidoc_module_dir = '../pydra'
82-
apidoc_output_dir = 'api'
83-
apidoc_excluded_paths = ['conftest.py', '*/tests/*', 'tests/*', 'data/*']
76+
autodoc_mock_imports = ["cloudpickle", "matplotlib", "numpy", "psutil"]
77+
apidoc_module_dir = "../pydra"
78+
apidoc_output_dir = "api"
79+
apidoc_excluded_paths = ["conftest.py", "*/tests/*", "tests/*", "data/*"]
8480
apidoc_separate_modules = True
85-
apidoc_extra_args = ['--module-first', '-d 1', '-T']
81+
apidoc_extra_args = ["--module-first", "-d 1", "-T"]
8682

8783
# Napoleon
8884
# Accept custom section names to be parsed for numpy-style docstrings
8985
# of parameters.
9086
# Requires pinning sphinxcontrib-napoleon to a specific commit while
9187
# https://github.com/sphinx-contrib/napoleon/pull/10 is merged.
9288
napoleon_use_param = False
93-
napoleon_custom_sections = [
94-
('Inputs', 'Parameters'),
95-
('Outputs', 'Parameters'),
96-
]
89+
napoleon_custom_sections = [("Inputs", "Parameters"), ("Outputs", "Parameters")]
9790

9891
# Intersphinx
99-
intersphinx_mapping = {
100-
'https://docs.python.org/': None,
101-
}
92+
intersphinx_mapping = {"https://docs.python.org/": None}
10293

10394
# Linkcode
10495
# The following is used by sphinx.ext.linkcode to provide links to github
10596
linkcode_resolve = make_linkcode_resolve(
106-
'pydra', 'https://github.com/nipype/pydra/blob/{revision}/'
107-
'{package}/{path}#L{lineno}')
97+
"pydra",
98+
"https://github.com/nipype/pydra/blob/{revision}/" "{package}/{path}#L{lineno}",
99+
)
108100

109101
# Sphinx-versioning
110102
scv_show_banner = True

docs/sphinxext/github_link.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
import sys
1010
from functools import partial
1111

12-
REVISION_CMD = 'git rev-parse --short HEAD'
12+
REVISION_CMD = "git rev-parse --short HEAD"
1313

1414

1515
def _get_git_revision():
1616
try:
1717
revision = subprocess.check_output(REVISION_CMD.split()).strip()
1818
except (subprocess.CalledProcessError, OSError):
19-
print('Failed to execute git to get revision')
19+
print("Failed to execute git to get revision")
2020
return None
21-
return revision.decode('utf-8')
21+
return revision.decode("utf-8")
2222

2323

2424
def _linkcode_resolve(domain, info, package, url_fmt, revision):
@@ -38,18 +38,18 @@ def _linkcode_resolve(domain, info, package, url_fmt, revision):
3838

3939
if revision is None:
4040
return
41-
if domain not in ('py', 'pyx'):
41+
if domain not in ("py", "pyx"):
4242
return
43-
if not info.get('module') or not info.get('fullname'):
43+
if not info.get("module") or not info.get("fullname"):
4444
return
4545

46-
class_name = info['fullname'].split('.')[0]
46+
class_name = info["fullname"].split(".")[0]
4747
if type(class_name) != str:
4848
# Python 2 only
49-
class_name = class_name.encode('utf-8')
50-
module = __import__(info['module'], fromlist=[class_name])
49+
class_name = class_name.encode("utf-8")
50+
module = __import__(info["module"], fromlist=[class_name])
5151
try:
52-
obj = attrgetter(info['fullname'])(module)
52+
obj = attrgetter(info["fullname"])(module)
5353
except AttributeError:
5454
return
5555

@@ -65,14 +65,12 @@ def _linkcode_resolve(domain, info, package, url_fmt, revision):
6565
if not fn:
6666
return
6767

68-
fn = os.path.relpath(fn,
69-
start=os.path.dirname(__import__(package).__file__))
68+
fn = os.path.relpath(fn, start=os.path.dirname(__import__(package).__file__))
7069
try:
7170
lineno = inspect.getsourcelines(obj)[1]
7271
except Exception:
73-
lineno = ''
74-
return url_fmt.format(revision=revision, package=package,
75-
path=fn, lineno=lineno)
72+
lineno = ""
73+
return url_fmt.format(revision=revision, package=package, path=fn, lineno=lineno)
7674

7775

7876
def make_linkcode_resolve(package, url_fmt):
@@ -87,5 +85,6 @@ def make_linkcode_resolve(package, url_fmt):
8785
'{path}#L{lineno}')
8886
"""
8987
revision = _get_git_revision()
90-
return partial(_linkcode_resolve, revision=revision, package=package,
91-
url_fmt=url_fmt)
88+
return partial(
89+
_linkcode_resolve, revision=revision, package=package, url_fmt=url_fmt
90+
)

min-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
attrs
33
cloudpickle == 0.8.0
44
filelock == 3.0.0
5-
etelemetry
5+
etelemetry == 0.2.0

pydra/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
"""
88
import logging
9+
910
logger = logging.getLogger("pydra")
1011
from ._version import get_versions
1112

@@ -15,14 +16,18 @@
1516
from .engine import Submitter, Workflow, AuditFlag, ShellCommandTask, DockerTask, specs
1617
from . import mark
1718

19+
1820
def check_latest_version():
1921
import etelemetry
20-
return etelemetry.check_available_version("nipype/pydra", __version__, lgr=logger)
22+
23+
return etelemetry.check_available_version("nipype/pydra", __version__, lgr=logger)
24+
2125

2226
# Run telemetry on import for interactive sessions, such as IPython, Jupyter notebooks, Python REPL
2327
import __main__
2428

2529
if not hasattr(__main__, "__file__"):
2630
from .engine.core import TaskBase
31+
2732
if TaskBase._etelemetry_version_data is None:
2833
TaskBase._etelemetry_version_data = check_latest_version()

0 commit comments

Comments
 (0)