Skip to content

Commit b7e3be6

Browse files
authored
Merge pull request #1 from mzecc/main
added core openscm
2 parents 51b161d + 73f56a9 commit b7e3be6

55 files changed

Lines changed: 6576 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.copier-answers.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: v0.12.3
3+
_src_path: gl:openscm/copier-core-python-repository
4+
conda_release: false
5+
email: zecchetto@iiasa.ac.at
6+
include_cli: false
7+
name: MZ
8+
notebook_based_docs: true
9+
package_manager: uv
10+
pandas_doctests: false
11+
plot_dependencies: true
12+
project_description_short: test fork+core
13+
project_name_human: test fork
14+
project_name_pip: test-fork
15+
project_name_python: test_fork
16+
project_url: https://github.com/mzecc/test_core_github.git
17+
track_lock_file: true

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug report
3+
about: Report a bug
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Describe the bug
11+
<!--- A clear and concise description of what the bug is. -->
12+
13+
## Failing Test
14+
<!---
15+
Please put the code (ideally in the form of a unit test) which fails below.
16+
17+
e.g.
18+
19+
```python
20+
def test_bug_12():
21+
# Python code here which fails because of the bug
22+
# This is best if other developers can simply copy and paste this test in
23+
# order to run it
24+
```
25+
-->
26+
27+
## Expected behavior
28+
<!--- A clear and concise description of what you expected to happen. -->
29+
30+
## Screenshots
31+
<!--- If applicable, add screenshots to help explain your problem. -->
32+
33+
## System
34+
<!--- Please complete the following information. -->
35+
36+
- OS: [e.g. Windows, Linux, macOS]
37+
- Python version [e.g. Python 3.11]
38+
39+
## Additional context
40+
<!--- Add any other context about the problem here. -->

.github/ISSUE_TEMPLATE/default.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Default
3+
about: Report an issue or problem
4+
title: ''
5+
labels: triage
6+
assignees: ''
7+
8+
---
9+
10+
## The problem
11+
<!--- Useful to breakdown to "As a [persona], I [want to do], so that [reason] -->
12+
13+
## Definition of "done"
14+
<!---
15+
What are the things that must be true in order to close this issue
16+
17+
We find that describing these as dot points works well.
18+
-->
19+
20+
## Additional context
21+
<!--- Add any additional context can go here -->
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Feature Request
3+
about: Request a feature or suggest an idea for this project
4+
title: ''
5+
labels: feature
6+
assignees: ''
7+
8+
---
9+
10+
## The motivation
11+
12+
<!--- Useful to breakdown to "As a [persona], I [want to do], so that [reason] -->
13+
14+
## The proposed solution
15+
16+
<!---
17+
If you'd like, please provide a description of the solution you would like to see
18+
19+
If you don't have any ideas for the solution, simply leave this blank
20+
-->
21+
22+
## Alternatives
23+
24+
<!---
25+
If you've considered any alternatives, please describe them here
26+
27+
If you don't have any alternatives, simply leave this blank
28+
-->
29+
30+
## Additional context
31+
32+
<!--- Add any additional context can go here -->

.github/actions/setup/action.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Setup Python and uv"
2+
description: "setup Python and uv"
3+
4+
inputs:
5+
python-version:
6+
description: "Python version to use"
7+
required: true
8+
uv-dependency-install-flags:
9+
description: "Flags to pass to uv when running `uv install`"
10+
required: true
11+
run-uv-install:
12+
description: "Should we run the uv install steps"
13+
required: false
14+
default: true
15+
16+
runs:
17+
using: "composite"
18+
steps:
19+
- name: Setup uv
20+
id: setup-uv
21+
uses: astral-sh/setup-uv@v4
22+
with:
23+
version: "0.5.21"
24+
python-version: ${{ inputs.python-version }}
25+
- name: Install dependencies
26+
shell: bash
27+
if: ${{ (inputs.run-uv-install == 'true') }}
28+
run: |
29+
uv sync ${{ inputs.uv-dependency-install-flags }}

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Description
2+
3+
## Checklist
4+
5+
Please confirm that this pull request has done the following:
6+
7+
- [ ] Tests added
8+
- [ ] Documentation added (where applicable)
9+
- [ ] Changelog item added to `changelog/`

.github/release_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Announcements
2+
3+
* Announcement 1

.github/workflows/bump.yaml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Bump version
2+
# For the time being, we still do this with pdm.
3+
# Honestly, it doesn't really matter,
4+
# but one day uv will have a bump command too and we can switch to that.
5+
# Relevant issue in uv: https://github.com/astral-sh/uv/issues/6298
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
bump_rule:
11+
type: choice
12+
description: How to bump the project's version (see https://github.com/carstencodes/pdm-bump#usage)
13+
options:
14+
- no-pre-release
15+
# no micro because we always sit on a pre-release in main,
16+
# so we would always use no-pre-release instead of micro
17+
# - micro
18+
- minor
19+
- major
20+
- "pre-release --pre alpha"
21+
- "pre-release --pre beta"
22+
- "pre-release --pre release-candidate"
23+
required: true
24+
25+
jobs:
26+
bump_version:
27+
name: "Bump version and create changelog"
28+
if: "!startsWith(github.event.head_commit.message, 'bump:')"
29+
strategy:
30+
matrix:
31+
os: [ "ubuntu-latest" ]
32+
python-version: [ "3.9" ]
33+
runs-on: "${{ matrix.os }}"
34+
env:
35+
CI_COMMIT_EMAIL: "ci-runner@test-fork.invalid"
36+
steps:
37+
- name: Checkout repository
38+
uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
42+
43+
- name: Setup PDM
44+
uses: pdm-project/setup-pdm@v4.1
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
48+
- name: Install pdm-bump
49+
run: |
50+
pdm self add pdm-bump
51+
52+
- uses: ./.github/actions/setup
53+
with:
54+
python-version: ${{ matrix.python-version }}
55+
uv-dependency-install-flags: "--all-extras --group dev"
56+
57+
- name: Create bump and changelog
58+
run: |
59+
git config --global user.name "$GITHUB_ACTOR"
60+
git config --global user.email "$CI_COMMIT_EMAIL"
61+
62+
BASE_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml`
63+
echo "Bumping from version $BASE_VERSION"
64+
65+
# Bump
66+
pdm bump ${{ github.event.inputs.bump_rule }}
67+
68+
NEW_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml`
69+
echo "Bumping to version $NEW_VERSION"
70+
71+
# Build CHANGELOG
72+
uv run towncrier build --yes --version v$NEW_VERSION
73+
74+
# Commit, tag and push
75+
git commit -a -m "bump: version $BASE_VERSION -> $NEW_VERSION"
76+
git tag v$NEW_VERSION
77+
git push && git push --tags
78+
79+
# Bump to alpha (so that future commits do not have the same
80+
# version as the tagged commit)
81+
BASE_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml`
82+
83+
# Bump to pre-release of next version
84+
pdm bump pre-release --pre alpha
85+
86+
NEW_VERSION=`sed -ne 's/^version = "\([0-9\.a]*\)"/\1/p' pyproject.toml`
87+
echo "Bumping version $BASE_VERSION > $NEW_VERSION"
88+
89+
# Commit and push
90+
git commit -a -m "bump(pre-release): version $BASE_VERSION > $NEW_VERSION"
91+
git push

0 commit comments

Comments
 (0)