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
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.
A clear and concise description of the bug.

**To Reproduce**
**Steps to reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
2. Run '...'
3. Provide '...'
4. See error

**Expected behavior**
Expand All @@ -23,9 +23,9 @@ A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
**Environment (please complete the following information):**
- OS: [e.g. Linux Fedora 43, Windows 11...]
- Version [e.g. v0.1.1]
- Version: [e.g. v0.1.1]

**Additional context**
Add any other context about the problem here.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Modelblocks project website
url: https://www.modelblocks.org/
about: Consult our website for general information on our initiative.
- name: Documentation
url: https://modelblocks.readthedocs.io/
about: Read our documentation for general questions and guidelines.
- name: Community chat
url: https://calliope-modelblocks.zulipchat.com
about: Reach out to our community on our official Zulip chat.
74 changes: 48 additions & 26 deletions .github/workflows/template-check-version.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,76 @@
# Adapted from https://github.com/arup-group/actions-city-modelling-lab/blob/main/.github/workflows/template-check.yml
# MIT licensed
name: Deprecated reusable workflow for checking template updates

name: Reusable workflow for keeping up-to-date with template changes.
on:
workflow_call:

defaults:
run:
shell: bash -l {0}
shell: bash --noprofile --norc -euo pipefail {0}

jobs:
copier-issue:
copier-check-update:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
env:
UPDATE: false
ISSUE_TITLE: Template update workflow migration required
steps:
- uses: actions/checkout@v4

- name: Warn about deprecated reusable workflow
run: |
echo "::warning title=Deprecated template check workflow::This reusable workflow and the data-module-template 'latest' tag update mechanism are deprecated. This compatibility workflow will be removed in the next template release. Update this project from the template to use the generated self-contained check-version workflow."

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Add dummy GitHub credentials
- name: Check for template updates
id: copier_check_update
run: |
git config --global user.name Copier update
git config --global user.email check@dummy.bot.com
update_json="$(uvx --from 'copier>=9.15.2' copier check-update --output-format json)"
echo "$update_json"
{
echo "update_available=$(jq -r '.update_available // false' <<< "$update_json")"
echo "current_version=$(jq -r '.current_version // "unknown"' <<< "$update_json")"
echo "latest_version=$(jq -r '.latest_version // "unknown"' <<< "$update_json")"
} >> "$GITHUB_OUTPUT"

- name: Run copier update
run: uvx copier update --skip-answered --defaults
- name: Check for existing migration issue
id: existing_issue
run: |
issue_count="$(gh issue list \
--repo "${{ github.repository }}" \
--state open \
--search "$ISSUE_TITLE in:title" \
--json title \
--jq "map(select(.title == \"$ISSUE_TITLE\")) | length")"
if [[ "$issue_count" -gt 0 ]]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Wait a bit for copier cleanups
run: sleep 10s
- name: Open migration issue
if: steps.existing_issue.outputs.exists != 'true'
run: |
gh issue create \
--repo "${{ github.repository }}" \
--title "$ISSUE_TITLE" \
--body "This project is still using the deprecated reusable Modelblocks template update workflow through the data-module-template \`latest\` tag.

- name: Display differences
run: git status --porcelain
Template update available: ${{ steps.copier_check_update.outputs.update_available }}
Current template version: ${{ steps.copier_check_update.outputs.current_version }}
Latest template version: ${{ steps.copier_check_update.outputs.latest_version }}

- name: Set update flag if changes occurred
run: test -z "$(git status --porcelain)" || echo "UPDATE=true" >> $GITHUB_ENV
Please update this project from the template:

- name: Show environment variables
run: |
echo "$UPDATE"
\`\`\`shell
copier update --skip-answered --defaults
\`\`\`

- name: Open issue
if: env.UPDATE == true
run: |
gh issue --repo ${{ github.repository }} \
create --title "Template update" \
--body "A new version of the template has been published. Please update this project using \`copier update --skip-answered --defaults\` and review changes. If you need help, refer to the Modelblocks documentation or reach out to the project team."
The update will migrate this repository to a self-contained \`.github/workflows/check-version.yml\` workflow. This compatibility workflow will be removed in the next template release."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 8 additions & 9 deletions .github/workflows/template-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ name: Reusable release workflow for modules
on:
workflow_call:

defaults:
run:
shell: bash --noprofile --norc -euo pipefail {0}

jobs:
add-latest-tag:
latest-tag-deprecation-warning:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Run latest-tag
uses: EndBug/latest-tag@v1.6.2
with:
# Name of the tag.
ref: latest
- name: Warn about removed latest tag management
run: |
echo "::warning title=Deprecated template release workflow::The Modelblocks data module template no longer manages a 'latest' tag for generated projects. This compatibility workflow will be removed in the next template release. Update this project from the template to remove the generated release workflow."
3 changes: 3 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ authors:
- given-names: Ivan
family-names: Ruiz Manuel
orcid: https://orcid.org/0000-0003-2288-6423
- given-names: Stefan
family-names: Pfenninger-Lee
orcid: https://orcid.org/0000-0002-8420-9498
29 changes: 15 additions & 14 deletions copier.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# === copier settings ===
_min_copier_version: '9.4.1'
_min_copier_version: '9.15.2'
_subdirectory: template
_exclude:
# copier defaults
- "copier.yaml"
- "copier.yml"
- "copier.yaml"
- "~*"
- "*.py[co]"
- "__pycache__"
- ".git"
- ".DS_Store"
- ".svn"
# Do not add the dummy example when updating
- "{% if _copier_operation == 'update' -%}workflow/envs/shell.yaml{% endif %}"
- "{% if _copier_operation == 'update' -%}workflow/internal/config.schema.yaml{% endif %}"
- "{% if _copier_operation == 'update' -%}workflow/internal/settings.yaml{% endif %}"
- "{% if _copier_operation == 'update' -%}workflow/rules/automatic.smk{% endif %}"
- "{% if _copier_operation == 'update' -%}workflow/rules/dummy.smk{% endif %}"
- "{% if _copier_operation == 'update' -%}workflow/scripts/dummy_script.py{% endif %}"
# Respect user-owned files and folders during updates.
- "{% if _copier_operation == 'update' -%}workflow{% endif %}"
- "{% if _copier_operation == 'update' -%}resources{% endif %}"
- "{% if _copier_operation == 'update' -%}figures{% endif %}"
- "{% if _copier_operation == 'update' -%}results{% endif %}"
- "{% if _copier_operation == 'update' -%}config/**{% endif %}"
- "{% if _copier_operation == 'update' -%}tests/**{% endif %}"
# Special cases within the above that should not be excluded.
- "{% if _copier_operation == 'update' -%}!config/README.md{% endif %}"
- "{% if _copier_operation == 'update' -%}!tests/integration_test.py{% endif %}"
- "{% if _copier_operation == 'update' -%}!workflow/profiles/default/config.yaml{% endif %}"
_skip_if_exists:
# Respect user changes, except for a few standard files.
- config/**
Expand All @@ -26,13 +30,10 @@ _skip_if_exists:
- results/**
- tests/**
- workflow/**
- .readthedocs.yaml
- AUTHORS
- CITATION.cff
- INTERFACE.yaml
# Special cases: these files should not be user-modified, even though they are in user-modifiable directories
# Special cases within the above that should not be skipped.
- "!config/README.md"
- "!tests/integration_test.py"
- "!workflow/profiles/default/config.yaml"
_templates_suffix: .jinja
_answers_file: .copier-answers.yml

Expand Down
18 changes: 10 additions & 8 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage = "https://www.modelblocks.org/"

[dependencies]
python = ">=3.12"
copier = ">=9.5.0"
copier = ">=9.15.2"
mypy = ">=1.15.0"
pytest = ">=8.3.5"
ruff = ">=0.9.9"
Expand Down
12 changes: 6 additions & 6 deletions template/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.
A clear and concise description of the bug.

**To Reproduce**
**Steps to reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
2. Run '...'
3. Provide '...'
4. See error

**Expected behavior**
Expand All @@ -23,9 +23,9 @@ A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
**Environment (please complete the following information):**
- OS: [e.g. Linux Fedora 43, Windows 11...]
- Version [e.g. v0.1.1]
- Version: [e.g. v0.1.1]

**Additional context**
Add any other context about the problem here.
5 changes: 0 additions & 5 deletions template/.github/ISSUE_TEMPLATE/config.yaml

This file was deleted.

11 changes: 11 additions & 0 deletions template/.github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Modelblocks project website
url: https://www.modelblocks.org/
about: Consult our website for general information on our initiative.
- name: Documentation
url: https://modelblocks.readthedocs.io/
about: Read our documentation for general questions and guidelines.
- name: Community chat
url: https://calliope-modelblocks.zulipchat.com
about: Reach out to our community on our official Zulip chat.
Loading
Loading