Skip to content

Commit 4417b18

Browse files
authored
Merge branch 'ep2024' into pre-commit-ci-update-config
2 parents 49c1174 + ff12c22 commit 4417b18

23 files changed

+562
-461
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "pip"
3+
- package-ecosystem: "uv"
44
directory: "/"
55
schedule:
6-
interval: "weekly"
6+
interval: "monthly"
77

88
- package-ecosystem: "github-actions"
99
directory: "/"
1010
schedule:
11-
interval: "weekly"
11+
interval: "monthly"

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy to static server
2+
3+
on:
4+
push:
5+
branches:
6+
- ep2024
7+
schedule:
8+
- cron: "*/10 * * * *" # every 10 minutes
9+
workflow_dispatch:
10+
11+
jobs:
12+
tests:
13+
name: Run tests
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python 3
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.13'
25+
26+
- name: Setup uv
27+
uses: astral-sh/setup-uv@v5
28+
29+
- name: Install dependencies from uv.lock
30+
run: make deps/install
31+
32+
- name: Download data
33+
run: uv run make download > /dev/null 2>&1
34+
env:
35+
PRETALX_TOKEN: ${{ secrets.PRETALX_TOKEN }}
36+
37+
- name: Transform data
38+
run: uv run make transform > /dev/null 2>&1
39+
40+
- name: Setup SSH
41+
uses: webfactory/[email protected]
42+
with:
43+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
44+
45+
- name: Adjust known_hosts
46+
run: ssh-keyscan "static.europython.eu" > ~/.ssh/known_hosts
47+
48+
- name: Deploy
49+
run: uv run make deploy FORCE_DEPLOY=true

.github/workflows/tests.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ jobs:
1515
- name: Set up Python 3
1616
uses: actions/setup-python@v5
1717
with:
18-
python-version: '3.x'
19-
cache: "pip"
18+
python-version: '3.13'
2019

21-
- name: Install dependencies
22-
run: make deps/pre install
20+
- name: Setup uv
21+
uses: astral-sh/setup-uv@v5
22+
23+
- name: Install dependencies from uv.lock
24+
run: make deps/install
2325

2426
- name: Run pytest
2527
run: make test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,6 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
#.idea/
161+
162+
# Ruff:
163+
.ruff_cache/

.pre-commit-config.yaml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
repos:
2-
- repo: https://github.com/pycqa/isort
3-
rev: 6.0.1
4-
hooks:
5-
- id: isort
6-
7-
- repo: https://github.com/psf/black-pre-commit-mirror
8-
rev: 25.1.0
9-
hooks:
10-
- id: black
11-
122
- repo: https://github.com/pre-commit/pre-commit-hooks
133
rev: v5.0.0
144
hooks:
@@ -22,16 +12,15 @@ repos:
2212
rev: v0.11.4
2313
hooks:
2414
- id: ruff
15+
args: [ --fix ]
2516
- id: ruff-format
2617

27-
- repo: local
18+
- repo: https://github.com/tox-dev/pyproject-fmt
19+
rev: v2.5.1
2820
hooks:
29-
- id: pytest
30-
name: Run pytest
31-
entry: make test
32-
language: system
33-
pass_filenames: false
34-
always_run: true
21+
- id: pyproject-fmt
3522

36-
ci:
37-
skip: [pytest]
23+
- repo: https://github.com/abravalheri/validate-pyproject
24+
rev: v0.24.1
25+
hooks:
26+
- id: validate-pyproject

.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

Dockerfile

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

Makefile

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
1+
# Variables for the project
2+
# =========================
3+
CONFERENCE ?= ep2024
4+
DATA_DIR ?= ./data/public/$(CONFERENCE)/
15

2-
deps/pre:
3-
pip install pip-tools
6+
# Variables for remote host
7+
# =========================
8+
VPS_USER ?= static_content_user
9+
VPS_HOST ?= static.europython.eu
10+
VPS_PATH ?= /home/$(VPS_USER)/content/programapi/$(CONFERENCE)/releases
11+
REMOTE_CMD=ssh $(VPS_USER)@$(VPS_HOST)
412

5-
deps/compile:
6-
pip-compile
13+
# Variables for deploy
14+
# ==========================
15+
TIMESTAMP ?= $(shell date +%Y%m%d%H%M%S)
16+
FORCE_DEPLOY ?= false
17+
18+
dev:
19+
uv sync --dev
20+
21+
deps/upgrade:
22+
uv lock --upgrade
723

824
deps/install:
9-
pip-sync
25+
uv sync
1026

1127
install: deps/install
1228

@@ -22,12 +38,21 @@ endif
2238

2339
all: download transform
2440

41+
ifeq ($(FORCE_DEPLOY), true)
42+
deploy: TARGET = $(VPS_PATH)/$(TIMESTAMP)
43+
deploy:
44+
@echo "\n\n**** Deploying branch '$(CONFERENCE)' to $(TARGET)...\n\n"
45+
$(REMOTE_CMD) "mkdir -p $(TARGET)"
46+
rsync -avz --delete $(DATA_DIR) $(VPS_USER)@$(VPS_HOST):$(TARGET)
47+
$(REMOTE_CMD) "cd $(VPS_PATH) && ln -snf $(TIMESTAMP) current"
48+
@echo "\n\n**** Deployment complete.\n\n"
49+
endif
50+
2551
test:
26-
PYTHONPATH="src" pytest
52+
uv run pytest
2753

2854
pre-commit:
2955
pre-commit install
30-
pre-commit run --all-files
3156

3257
clean:
3358
git clean -xdf

deploy/.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

deploy/Makefile

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

0 commit comments

Comments
 (0)