diff options
| author | Egor Tensin <egor@tensin.name> | 2026-03-28 15:28:39 +0100 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-03-28 15:30:54 +0100 |
| commit | 61a2ec1a9c7848c5fec5e4b86d6c289ef16f25bf (patch) | |
| tree | f4956091dc52511376641243e82f7967af0ffff3 | |
| parent | workflows/ci: run Docker builds on PRs (diff) | |
| download | void-61a2ec1a9c7848c5fec5e4b86d6c289ef16f25bf.tar.gz void-61a2ec1a9c7848c5fec5e4b86d6c289ef16f25bf.zip | |
support Python >= 3.13
| -rw-r--r-- | .dockerignore | 1 | ||||
| -rw-r--r-- | .github/workflows/ci.yml | 6 | ||||
| -rw-r--r-- | Dockerfile | 3 | ||||
| -rw-r--r-- | Makefile | 42 | ||||
| -rw-r--r-- | requirements.txt | 2 |
5 files changed, 27 insertions, 27 deletions
diff --git a/.dockerignore b/.dockerignore index cb61aa2..069ef0d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,5 @@ !app.py !index.html +!requirements.txt !server.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6495393..d21b61a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,7 @@ jobs: test: strategy: matrix: - # The cgi module was removed in 3.13. - python-version: ['3.9', '3.10', '3.11', '3.12'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] runs-on: ubuntu-latest name: 'Python ${{ matrix.python-version }}' steps: @@ -19,6 +18,9 @@ jobs: uses: actions/setup-python@v6 with: python-version: '${{ matrix.python-version }}' + cache: pip + - name: Install dependencies + run: pip install -q -r requirements.txt - name: Run tests run: make test @@ -1,4 +1,3 @@ -# The cgi module was removed in 3.13. FROM python:3.12-alpine RUN mkdir -p /var/lib/void @@ -6,6 +5,8 @@ RUN mkdir -p /var/lib/void COPY [".", "/usr/src/"] WORKDIR /usr/src +RUN pip install -q -r requirements.txt + # I don't know why, but in Docker, simple print() statements show nothing: # https://stackoverflow.com/q/29663459 # Fixed by adding the -u flag: @@ -3,43 +3,37 @@ include prelude.mk PORT ?= 23666 $(eval $(call noexpand,PORT)) -URL := http://localhost:$(PORT)/ -STATE := ./void.state +url := http://localhost:$(PORT)/ +state := ./void.state + +venv_dir := .venv +venv_activate := . '$(call escape,$(venv_dir)/bin/activate)' .PHONY: all all: serve +.PHONY: venv/reset +venv/reset: + rm -rf -- '$(call escape,$(venv_dir))' + mkdir -p -- '$(call escape,$(venv_dir))' + python -m venv -- '$(call escape,$(venv_dir))' + +.PHONY: venv +venv: venv/reset + $(venv_activate) && pip install -q -r requirements.txt + .PHONY: serve serve: - ./server.py --port '$(call escape,$(PORT))' --void '$(call escape,$(STATE))' + $(venv_activate) && ./server.py --port '$(call escape,$(PORT))' --void '$(call escape,$(state))' .PHONY: clean clean: - rm -f -- '$(call escape,$(STATE))' + rm -f -- '$(call escape,$(state))' .PHONY: view view: - xdg-open '$(call escape,$(URL))' &> /dev/null + xdg-open '$(call escape,$(url))' &> /dev/null .PHONY: test test: ./test/test.sh - -.PHONY: build -build: docker/build - -.PHONY: docker/build -docker/build: - docker compose build --progress plain --pull - -.PHONY: docker/serve -docker/serve: build/docker - docker compose up - -.PHONY: deploy -deploy: docker/build - docker compose up -d - -.PHONY: undeploy -undeploy: - docker compose down --rmi all --volumes diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..38fbfd8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# The cgi module was removed in 3.13. +legacy-cgi; python_version >= '3.13' |
