Skip to content

Commit a19fa73

Browse files
Merge pull request #1 from pymc-devs/package-template-structure
Package template structure
2 parents 138ff72 + 9589d5c commit a19fa73

Some content is hidden

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

56 files changed

+7331
-2
lines changed

.copier-answers.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2+
_commit: v0.14.4
3+
_src_path: gl:openscm/copier-core-python-repository
4+
conda_release: true
5+
6+
include_cli: false
7+
name: Florence Bockting
8+
notebook_based_docs: true
9+
package_manager: uv
10+
pandas_doctests: true
11+
plot_dependencies: true
12+
project_description_short: Learning prior distributions for model parameters in a
13+
Bayesian model based on expert information.
14+
project_name_human: PyMC elicito
15+
project_name_pip: pymc-elicito
16+
project_name_python: pymc_elicito
17+
project_url: https://github.com/pymc-devs/pymc-elicito
18+
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.8.8"
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: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Bump version
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
bump_rule:
7+
type: choice
8+
description: How to bump the project's version (see https://docs.astral.sh/uv/reference/cli/#uv-version)
9+
options:
10+
- patch
11+
- minor
12+
- major
13+
- stable
14+
- alpha
15+
- beta
16+
- rc
17+
- post
18+
- dev
19+
required: true
20+
21+
jobs:
22+
bump_version:
23+
name: "Bump version and create changelog"
24+
if: "!startsWith(github.event.head_commit.message, 'bump:')"
25+
strategy:
26+
matrix:
27+
os: [ "ubuntu-latest" ]
28+
python-version: [ "3.11" ]
29+
runs-on: "${{ matrix.os }}"
30+
env:
31+
CI_COMMIT_EMAIL: "[email protected]"
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
38+
39+
- uses: ./.github/actions/setup
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
uv-dependency-install-flags: "--all-extras --group dev"
43+
44+
- name: Create bump and changelog
45+
run: |
46+
git config --global user.name "$GITHUB_ACTOR"
47+
git config --global user.email "$CI_COMMIT_EMAIL"
48+
49+
BASE_VERSION=`sed -ne 's/^version = "\([0-9\.post]*\)"/\1/p' pyproject.toml`
50+
echo "Bumping from version $BASE_VERSION"
51+
52+
# Bump
53+
uv version --bump ${{ github.event.inputs.bump_rule }}
54+
55+
NEW_VERSION=`sed -ne 's/^version = "\([0-9\.]*\)"/\1/p' pyproject.toml`
56+
echo "Bumping to version $NEW_VERSION"
57+
58+
# Build CHANGELOG
59+
uv run towncrier build --yes --version v$NEW_VERSION
60+
61+
# Commit, tag and push
62+
git commit -a -m "bump: version $BASE_VERSION -> $NEW_VERSION"
63+
git tag v$NEW_VERSION
64+
git push && git push --tags
65+
66+
# Bump to alpha (so that future commits do not have the same
67+
# version as the tagged commit)
68+
BASE_VERSION=`sed -ne 's/^version = "\([0-9\.]*\)"/\1/p' pyproject.toml`
69+
70+
# Bump to pre-release of next version
71+
uv version --bump post
72+
73+
NEW_VERSION=`sed -ne 's/^version = "\([0-9\.post]*\)"/\1/p' pyproject.toml`
74+
echo "Bumping version $BASE_VERSION > $NEW_VERSION"
75+
76+
# Commit and push
77+
git commit -a -m "bump(pre-release): version $BASE_VERSION > $NEW_VERSION"
78+
git push

0 commit comments

Comments
 (0)