Skip to content

Commit b5a6121

Browse files
committed
Merge branch 'release/0.5.1'
2 parents 70eef5a + 3fb7356 commit b5a6121

File tree

14 files changed

+571
-824
lines changed

14 files changed

+571
-824
lines changed

.devcontainer/Dockerfile

Lines changed: 0 additions & 44 deletions
This file was deleted.

.devcontainer/devcontainer.json

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,30 @@
11
{
2-
"name": "python3",
3-
"build": {
4-
"dockerfile": "Dockerfile"
5-
},
6-
7-
// Set *default* container specific settings.json values on container create.
8-
"settings": {
9-
"terminal.integrated.shell.linux": "/bin/bash",
10-
"python.testing.pytestArgs": [
11-
"tests"
12-
],
13-
"python.testing.unittestEnabled": false,
14-
"python.testing.pytestEnabled": true
15-
},
16-
17-
// 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
18-
// "features": {},
19-
20-
// 👇 Use 'forwardPorts' to make a list of ports inside the container available locally.
21-
// "forwardPorts": [],
22-
23-
// 👇 Use 'postCreateCommand' to run commands after the container is created.
24-
"postCreateCommand": "poetry install",
25-
26-
// 👇 Configure tool-specific properties.
27-
"customizations": {
28-
"vscode": {
29-
"extensions":[
30-
"donjayamanne.python-extension-pack"
31-
]
32-
}
33-
}
34-
35-
36-
37-
// 👇 Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
38-
// "remoteUser": "root"
2+
"name": "exchange-calendars-extensions",
3+
"image": "mcr.microsoft.com/devcontainers/python:dev-3.14",
4+
"containerEnv": {
5+
"UV_LINK_MODE": "copy"
6+
},
7+
"features": {
8+
"ghcr.io/jsburckhardt/devcontainer-features/uv:1": {},
9+
"ghcr.io/jsburckhardt/devcontainer-features/ruff:1": {},
10+
"ghcr.io/prulloac/devcontainer-features/pre-commit:1": {}
11+
},
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"ms-python.python",
16+
"ms-python.vscode-pylance",
17+
"ms-python.debugpy"
18+
],
19+
"settings": {
20+
"python.testing.pytestArgs": [
21+
"tests"
22+
],
23+
"python.testing.unittestEnabled": false,
24+
"python.testing.pytestEnabled": true
25+
}
26+
}
27+
},
28+
"postCreateCommand": "uv sync",
29+
"remoteUser": "vscode"
3930
}

.github/dependabot.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "monthly"
12-
- package-ecosystem: "pip" # See documentation for possible values
12+
cooldown:
13+
default-days: 7
14+
- package-ecosystem: "uv" # See documentation for possible values
1315
directory: "/" # Location of package manifests
1416
schedule:
1517
interval: "monthly"
18+
cooldown:
19+
default-days: 7

.github/workflows/ci.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,37 @@ on:
1313
- main
1414
- develop
1515

16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
1623
env:
1724
PACKAGE_VERSION: "0"
1825

1926
jobs:
2027
build-and-test:
28+
name: Run automated tests.
2129
runs-on: ${{ matrix.os }}
30+
timeout-minutes: 5
2231
strategy:
2332
matrix:
2433
os: [ubuntu-latest, windows-latest, macos-latest]
25-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
34+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2635
steps:
27-
- uses: actions/checkout@v6
36+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
37+
with:
38+
persist-credentials: false
2839
- name: Install uv
29-
uses: astral-sh/setup-uv@v5
40+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
3041
with:
31-
enable-cache: true
32-
- name: Set up Python ${{ matrix.python-version }}
33-
run: uv python install ${{ matrix.python-version }}
42+
enable-cache: true # zizmor: ignore[cache-poisoning] Blast radius limited because this workflow only runs automated tests.
43+
- name: Set up Python
44+
shell: bash
45+
env:
46+
PYTHON_VERSION: ${{ matrix.python-version }}
47+
run: uv python install ${PYTHON_VERSION}
3448
- name: Run tests.
3549
run: uv run pytest

.github/workflows/draft-release.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@ on:
55
branches:
66
- develop
77

8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: release-drafter
13+
cancel-in-progress: false
14+
815
jobs:
916
draft-release-publish:
1017
name: Draft a new release
1118
permissions:
12-
# write permission is required to create a GitHub release
13-
contents: write
14-
# write permission is required for autolabeler
15-
# otherwise, read permission is required at least
16-
pull-requests: write
19+
contents: write # Required to create GitHub release.
20+
pull-requests: read # Required to read PR contents.
1721
runs-on: ubuntu-latest
1822
steps:
1923
# Drafts your next Release notes as Pull Requests are merged into "master"
20-
- uses: release-drafter/release-drafter@v6
24+
- uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6
2125
with:
2226
config-name: release-drafter-config.yml
2327
env:

.github/workflows/publish-rc.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,61 @@ on:
77
- 'hotfix/**'
88
- 'support/**'
99

10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: publish
15+
cancel-in-progress: false
16+
1017
env:
1118
PACKAGE_NAME: exchange_calendars_extensions_api
1219
MODULE_NAME: exchange_calendars_extensions.api
1320
PYTHON_VERSION: "3.13"
1421

1522
jobs:
16-
build-and-publish-testpypi:
23+
build-and-publish:
1724
name: Build and publish release candidate Python distribution to TestPyPI.
1825
runs-on: ubuntu-latest
1926
environment: testpypi
2027
permissions:
21-
id-token: write
28+
id-token: write # Required for trusted publishing.
2229
steps:
23-
- uses: actions/checkout@v6
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
31+
with:
32+
persist-credentials: false
2433
- name: Install uv
25-
uses: astral-sh/setup-uv@v5
34+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7
2635
with:
27-
enable-cache: true
28-
- name: Set up Python ${{ env.PYTHON_VERSION }}
29-
run: uv python install ${{ env.PYTHON_VERSION }}
36+
enable-cache: false # No cache when building RCs or releases.
37+
- name: Set up Python
38+
shell: bash
39+
run: uv python install ${PYTHON_VERSION}
3040
- name: Determine package version.
41+
shell: bash
42+
env:
43+
REF_NAME: ${{ github.ref_name }}
44+
RUN_NUMBER: ${{ github.run_number }}
3145
run: |
32-
export PACKAGE_VERSION=$(echo ${{ github.ref_name }} | sed -e 's/^\(release\|hotfix\|support\)\///')rc${{ github.run_number }}
46+
export PACKAGE_VERSION=$(echo ${REF_NAME} | sed -e 's/^\(release\|hotfix\|support\)\///')rc${RUN_NUMBER}
3347
echo "RC version is $PACKAGE_VERSION."
3448
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
3549
- name: Build package
3650
run: uv build
3751
- name: Publish package to Test PyPI.
38-
uses: pypa/gh-action-pypi-publish@release/v1
52+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
3953
with:
4054
repository-url: https://test.pypi.org/legacy/
4155
skip-existing: true
4256
- name: Test that the package can be installed and imported (Test PyPI).
57+
shell: bash
4358
run: |
4459
i=0
4560
max=10
4661
exists=0
4762
while [ $i -lt $max ] && [ $exists -eq 0 ]; do
4863
i=$(expr $i + 1)
49-
if curl -f -s https://test.pypi.org/pypi/${{ env.PACKAGE_NAME }}/json | jq -e ".releases | has(\"${{ env.PACKAGE_VERSION }}\")" &> /dev/null; then
64+
if curl -f -s https://test.pypi.org/pypi/${PACKAGE_NAME}/json | jq -e ".releases | has(\"${PACKAGE_VERSION}\")" &> /dev/null; then
5065
echo "$i/$max Package has appeared in index."
5166
exists=1
5267
else
@@ -59,7 +74,7 @@ jobs:
5974
i=0
6075
max=3
6176
while [ $i -lt $max ]; do
62-
if uv run -n --refresh --default-index https://test.pypi.org/simple --index https://pypi.org/simple --index-strategy unsafe-best-match --with "${{ env.PACKAGE_NAME }}==${{ env.PACKAGE_VERSION }}" --no-project -- python -c 'from importlib.metadata import version;print(version("${{ env.MODULE_NAME }}"))'; then
77+
if uv run -n --refresh --default-index https://test.pypi.org/simple --index https://pypi.org/simple --index-strategy unsafe-best-match --with "${PACKAGE_NAME}==${PACKAGE_VERSION}" --no-project -- python -c "from importlib.metadata import version;print(version(\"${MODULE_NAME}\"))"; then
6378
exit 0
6479
else
6580
echo "The command failed. Retrying $i/$max."

0 commit comments

Comments
 (0)