Skip to content

Commit 6dc7afe

Browse files
authored
Merge pull request #104 from ImperialCollegeLondon/uv
Port project to `uv` and add dependabot config
2 parents 7747605 + 798a70a commit 6dc7afe

File tree

9 files changed

+726
-1154
lines changed

9 files changed

+726
-1154
lines changed

.github/actions/setup/action.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Set up
2+
description: Set up Python environment and install dependencies
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Install the latest version of uv
8+
uses: astral-sh/setup-uv@v6
9+
with:
10+
enable-cache: true
11+
activate-environment: true
12+
13+
- name: Install project
14+
shell: bash
15+
run: uv sync --all-groups

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "uv"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"

.github/workflows/auto-merge.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Dependabot and Pre-commit auto-merge
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: write
8+
pull-requests: write # Needed if in a private repository
9+
10+
jobs:
11+
auto-merge:
12+
runs-on: ubuntu-latest
13+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' }}
14+
steps:
15+
- name: Enable auto-merge for Dependabot and pre-commit-ci PRs
16+
run: |
17+
gh pr review --approve "$PR_URL"
18+
gh pr merge --auto --merge "$PR_URL"
19+
env:
20+
PR_URL: ${{github.event.pull_request.html_url}}
21+
# GitHub provides this variable in the CI env. You don't
22+
# need to add anything to the secrets vault.
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ jobs:
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v4
14-
- name: Install Poetry
15-
run: pipx install poetry
16-
- uses: actions/setup-python@v5
17-
with:
18-
python-version: "3.12"
19-
cache: poetry
20-
- name: Install dependencies
21-
run: poetry install
14+
- uses: ./.github/actions/setup
2215
- name: Check that documentation builds cleanly with MkDocs
23-
run: poetry run mkdocs build --strict
16+
run: mkdocs build --strict

.github/workflows/publish.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,9 @@ jobs:
2727
steps:
2828
- name: Checkout
2929
uses: actions/checkout@v4
30-
- name: Install Poetry
31-
run: pipx install poetry
32-
- uses: actions/setup-python@v5
33-
with:
34-
python-version: "3.12"
35-
cache: poetry
36-
- name: Install dependencies
37-
run: poetry install
30+
- uses: ./.github/actions/setup
3831
- name: Build docs with MkDocs
39-
run: poetry run mkdocs build --strict
32+
run: mkdocs build --strict
4033
- name: Setup Pages
4134
uses: actions/configure-pages@v5
4235
- name: Upload artifact

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ This repository contains blogs by the [central RSE team](https://www.imperial.ac
66

77
### Development tools setup
88

9-
- Make sure you have [poetry](https://python-poetry.org/docs/#installation) installed.
9+
- Make sure you have [`uv`](https://docs.astral.sh/uv/getting-started/installation/) installed.
1010
- Clone the repository locally (`git clone https://github.com/ImperialCollegeLondon/RSEBlog.git`).
11-
- Install the dependencies `poetry install`
12-
- Install the pre-commit hooks `poetry run pre-commit install`
11+
- Install the dependencies `uv sync`
12+
- Install the pre-commit hooks `uv run pre-commit install`
1313

1414
### Adding your blog
1515

poetry.lock

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

pyproject.toml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
[tool.poetry]
2-
name = "RSE Blog"
1+
[project]
2+
name = "RSEBlog"
33
version = "0.1.0"
44
description = "Blog for Imperial's Central RSE Team"
5-
authors = ["Imperial College London RSE Team <ict-rse-team@imperial.ac.uk>"]
6-
package-mode = false
5+
authors = [{ name = "Imperial College London RSE Team", email = "ict-rse-team@imperial.ac.uk" }]
6+
requires-python = ">=3.13"
7+
dependencies = [
8+
"mkdocs>=1.6.0,<2",
9+
"mkdocs-material>=9.5.27,<10",
10+
"pre-commit>=3.7.1,<4",
11+
"mkdocs-caption>=1.2.0,<2",
12+
"python-markdown-math>=0.8,<0.9",
13+
"mkdocs-rss-plugin>=1.15.0,<2",
14+
]
715

8-
[tool.poetry.dependencies]
9-
python = ">=3.9,<4"
10-
mkdocs = "^1.6.0"
11-
mkdocs-material = "^9.5.27"
12-
pre-commit = "^3.7.1"
13-
mkdocs-caption = "^1.2.0"
14-
python-markdown-math = "^0.8"
15-
mkdocs-rss-plugin = "^1.15.0"
16+
[tool.uv]
17+
package = false
1618

1719
[build-system]
18-
requires = ["poetry>=0.12"]
19-
build-backend = "poetry.masonry.api"
20+
requires = ["uv_build>=0.8.3,<0.9.0"]
21+
build-backend = "uv_build"

uv.lock

Lines changed: 650 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)