Skip to content

Commit 2a842ca

Browse files
authored
Merge pull request #606 from lincc-frameworks/issue600
Address Issue600
2 parents e9e5e37 + e7be348 commit 2a842ca

15 files changed

Lines changed: 15 additions & 2 deletions

‎copier.yml‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ custom_install:
1818
retrofitting existing project: retrofit
1919
custom: custom
2020

21+
contains_code:
22+
help: The repo contains some code that should be tested.
23+
type: bool
24+
default: >-
25+
{% if custom_install != 'notebook' %}
26+
true
27+
{% else %}
28+
false
29+
{% endif %}
30+
when: false # Automatically determined, not asked to the user.
31+
2132
project_name:
2233
type: str
2334
help: What is the name of your project?
@@ -119,7 +130,7 @@ mypy_type_checking:
119130
create_example_module:
120131
help: Do you want to create some example module code?
121132
type: bool
122-
default: yes
133+
default: "{{ contains_code }}"
123134
choices:
124135
yes: true
125136
no: false
@@ -153,7 +164,7 @@ include_dev_guide:
153164
include_benchmarks:
154165
help: Do you want to enable benchmarking?
155166
type: bool
156-
default: yes
167+
default: "{{ contains_code }}"
157168
choices:
158169
yes: true
159170
no: false

python-project-template/.github/workflows/publish-to-pypi.yml.jinja renamed to python-project-template/.github/workflows/{% if contains_code %}publish-to-pypi.yml{% endif %}.jinja

File renamed without changes.

python-project-template/.github/workflows/smoke-test.yml.jinja renamed to python-project-template/.github/workflows/{% if contains_code %}smoke-test.yml{% endif %}.jinja

File renamed without changes.

python-project-template/.github/workflows/testing-and-coverage.yml.jinja renamed to python-project-template/.github/workflows/{% if contains_code %}testing-and-coverage.yml{% endif %}.jinja

File renamed without changes.

‎python-project-template/.pre-commit-config.yaml.jinja‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ repos:
151151
args:
152152
["docs/pre_executed/"]
153153
{%- endif %}
154+
{%- if contains_code %}
154155
# Run unit tests, verify that they pass. Note that coverage is run against
155156
# the ./src directory here because that is what will be committed. In the
156157
# github workflow script, the coverage is run against the installed package
@@ -165,3 +166,4 @@ repos:
165166
language: system
166167
pass_filenames: false
167168
always_run: true
169+
{%- endif %}

python-project-template/src/{% if 'pylint' in enforce_style %}.pylintrc{% endif %}.jinja renamed to python-project-template/{% if contains_code %}src{% endif %}/{% if 'pylint' in enforce_style %}.pylintrc{% endif %}.jinja

File renamed without changes.

python-project-template/src/{{package_name}}/__init__.py.jinja renamed to python-project-template/{% if contains_code %}src{% endif %}/{{package_name}}/__init__.py.jinja

File renamed without changes.

python-project-template/src/{{package_name}}/{% if create_example_module %}example_module.py{% endif %} renamed to python-project-template/{% if contains_code %}src{% endif %}/{{package_name}}/{% if create_example_module %}example_module.py{% endif %}

File renamed without changes.

python-project-template/src/{{package_name}}/{% if include_benchmarks %}example_benchmarks.py{% endif %} renamed to python-project-template/{% if contains_code %}src{% endif %}/{{package_name}}/{% if include_benchmarks %}example_benchmarks.py{% endif %}

File renamed without changes.

python-project-template/src/{{package_name}}/{% if mypy_type_checking != 'none' %}py.typed{% endif %}.jinja renamed to python-project-template/{% if contains_code %}src{% endif %}/{{package_name}}/{% if mypy_type_checking != 'none' %}py.typed{% endif %}.jinja

File renamed without changes.

0 commit comments

Comments
 (0)