Skip to content

Commit a85fb10

Browse files
Merge branch 'master' into feat/build-with-hatchling
2 parents 28ab5b2 + d473660 commit a85fb10

Some content is hidden

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

44 files changed

+869
-475
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
- [ ] If code changes were made, then they have been tested
1010
- [ ] I have updated the documentation to reflect the changes
11-
- [ ] I have formatted the code properly by running `pdm run nox -s lint`
12-
- [ ] I have type-checked the code by running `pdm run nox -s pyright`
11+
- [ ] I have formatted the code properly by running `uv run nox -s lint`
12+
- [ ] I have type-checked the code by running `uv run nox -s pyright`
1313
- [ ] This PR fixes an issue
1414
- [ ] This PR adds something new (e.g. new method or parameters)
1515
- [ ] This PR is a breaking change (e.g. methods or parameters removed/renamed)

.github/actions/cache-pdm/action.yml

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

.github/actions/setup-env/action.yml

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,20 @@ description: .
55
inputs:
66
python-version:
77
description: The python version to install
8-
required: true
8+
required: false
9+
default: '3.8'
10+
use-cached-uv-lock:
11+
description: Whether to download the uv lock cache.
12+
required: false
13+
default: 'true'
14+
update-uv-lock:
15+
description: Whether to update the uv lock file. Allows the cache to fail.
16+
required: false
17+
default: 'false'
18+
uv-resolution-strategy:
19+
description: The uv resolution strategy to use. See https://docs.astral.sh/uv/reference/environment/#uv_resolution for details.
20+
required: false
21+
default: 'highest'
922
outputs:
1023
python-version:
1124
description: The python version that was installed.
@@ -14,32 +27,52 @@ outputs:
1427
runs:
1528
using: composite
1629
steps:
17-
- name: Set up pdm with python ${{ inputs.python-version }}
30+
- name: Download uv lock
31+
uses: actions/cache/restore@v4
32+
if: ${{ inputs.use-cached-uv-lock != 'false' }}
33+
id: restore-uv-lock
34+
with:
35+
key: uv-lock-resolved-${{ inputs.uv-resolution-strategy }}
36+
path: uv.lock
37+
restore-keys: |
38+
uv-lock-resolved-${{ inputs.uv-resolution-strategy }}
39+
enableCrossOsArchive: true
40+
fail-on-cache-miss: ${{ inputs.update-uv-lock != 'true' }}
41+
42+
- name: Set up uv with python ${{ inputs.python-version }}
1843
id: setup-python
19-
uses: pdm-project/setup-pdm@v4
44+
uses: astral-sh/setup-uv@v6
2045
with:
46+
version: '0.8.14'
47+
enable-cache: true
48+
# this doesn't install python but pins the uv version; its the same as providing UV_PYTHON
2149
python-version: ${{ inputs.python-version }}
22-
version: "2.20.1" # last version to support python 3.8
23-
cache: false
2450

25-
- name: Disable PDM version check
51+
- name: Install python ${{ inputs.python-version }}
2652
shell: bash
53+
env:
54+
UV_PYTHON_DOWNLOADS: automatic
2755
run: |
28-
pdm config check_update false
56+
uv python install ${{ inputs.python-version }}
2957
30-
- name: Ignore saved pythons
58+
- name: Install nox
3159
shell: bash
3260
run: |
33-
echo "PDM_IGNORE_SAVED_PYTHON=1" >> $GITHUB_ENV
61+
uv tool install nox
3462
35-
- name: Install nox
63+
- name: Lock dependencies
64+
id: lock-uv-deps
65+
if: ${{ inputs.update-uv-lock }}
3666
shell: bash
37-
run: pip install nox
67+
env:
68+
UV_LOCKED: 0
69+
run: uv lock --refresh
3870

3971
- name: Set python version
4072
id: python-version
4173
shell: bash
42-
run: echo "python-version=$(python -c 'import sys; print(".".join(map(str,sys.version_info[:2])))')" >> $GITHUB_OUTPUT
43-
44-
- name: Configure cache
45-
uses: ./.github/actions/cache-pdm
74+
env:
75+
UV_VENV_CLEAR: 1
76+
run: |
77+
uv venv .venv
78+
echo "python-version=$(uv run python -c 'import sys; print(".".join(map(str,sys.version_info[:2])))')" >> $GITHUB_OUTPUT

.github/workflows/changelog.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,19 @@ jobs:
2828
fetch-depth: '0'
2929

3030
- name: Set up environment
31+
id: setup-env
3132
uses: ./.github/actions/setup-env
3233
with:
33-
python-version: '3.9'
34+
update-uv-lock: true
3435

3536
- name: Install dependencies
36-
run: pdm install -dG changelog
37+
run: uv sync --only-group changelog
3738

3839
- name: Check for presence of a Change Log fragment (only pull requests)
3940
# NOTE: The pull request' base branch needs to be fetched so towncrier
4041
# is able to compare the current branch with the base branch.
4142
run: |
42-
if ! pdm run towncrier check --compare-with origin/${BASE_BRANCH}; then
43+
if ! uv run towncrier check --compare-with origin/${BASE_BRANCH}; then
4344
echo "::error::Please see https://github.com/DisnakeDev/disnake/blob/master/changelog/README.rst for details on how to create a changelog entry." >&2
4445
exit 1
4546
fi

.github/workflows/create-release-pr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
python-version: 3.8
4949

5050
- name: Install dependencies
51-
run: pdm install -dG changelog
51+
run: uv sync --no-default-groups --group changelog
5252

5353
- name: Update version
5454
run: |
@@ -57,7 +57,7 @@ jobs:
5757
5858
- name: Build changelog
5959
run: |
60-
pdm run towncrier build --yes --version "$VERSION_INPUT"
60+
uv run towncrier build --yes --version "$VERSION_INPUT"
6161
git commit -a -m "docs: build changelog"
6262
6363
- name: Create pull request

0 commit comments

Comments
 (0)