Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,15 @@ jobs:
--data include_notebooks=no
--data use_gitlfs=disabled
foldername: 'pylint_w_o_example_module'
- name: No sphinx docs
package_name: 'drewtonian'
extra_flags: >-
--data project_name=new_science
--data package_name=drewtonian
--data include_docs=no
--data include_notebooks=no
foldername: 'no_sphinx_docs'

steps:

- name: Checkout code
Expand Down Expand Up @@ -125,6 +134,7 @@ jobs:
cat ../test/${{ matrix.copier_config.foldername }}/docs/requirements.txt

- name: Build docs
if: ${{ !contains(matrix.copier_config.extra_flags, 'include_docs=no') }}
run: |
cd ../test/${{ matrix.copier_config.foldername }}
sphinx-build -T -E -b html -d docs/build/doctrees ./docs docs/build/html
Expand Down
11 changes: 10 additions & 1 deletion copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,23 @@ create_example_module:
no: false
when: "{{ custom_install }}"

include_docs:
help: Do you want to include a directory for sphinx, and autoapi generation?
type: bool
default: yes
choices:
yes: true
no: false
when: "{{ custom_install }}"

include_notebooks:
help: Do you want to include rendered notebooks in your documentation?
type: bool
default: yes
choices:
yes: true
no: false
when: "{{ custom_install }}"
when: "{{ custom_install and include_docs }}"

use_gitlfs:
help: Do you want to add a .gitattributes with entries for git-lfs (see https://lincc-ppt.readthedocs.io/en/latest/practices/git-lfs.html)?
Expand Down
2 changes: 1 addition & 1 deletion python-project-template/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ repos:
"-D", # Flag to override settings in conf.py
"exclude_patterns=notebooks/*", # Exclude our notebooks from pre-commit
]
{%- else %}
{%- elif include_docs %}
# Make sure Sphinx can build the documentation without issues.
- repo: local
hooks:
Expand Down
4 changes: 4 additions & 0 deletions python-project-template/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ classifiers = [
]
dynamic = ["version"]
dependencies = [
{%- if include_notebooks %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for adding this check here!

"ipykernel", # Support for Jupyter notebooks
{%- endif %}
]

# On a mac, install optional dependencies with `pip install '.[dev]'` (include the single quotes)
Expand All @@ -28,9 +30,11 @@ dev = [
"pytest",
"pytest-cov", # Used to report total code coverage
"pre-commit", # Used to run checks before finalizing a git commit
{%- if include_docs %}
"sphinx==6.1.3", # Used to automatically generate documentation
"sphinx-rtd-theme==1.2.0", # Used to render documentation
"sphinx-autoapi==2.0.1", # Used to automatically generate api documentation
{%- endif %}
{%- if preferred_linter == 'pylint' %}
"pylint", # Used for static linting of files
{%- elif preferred_linter == 'black' %}
Expand Down