Skip to content

Commit

Permalink
Merge pull request #521 from danielhass/python-3.13
Browse files Browse the repository at this point in the history
Bump to Python 3.13
  • Loading branch information
almarklein authored Dec 30, 2024
2 parents adaad0b + 3f45823 commit 69a0d7d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 25 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ jobs:
strategy:
matrix:
include:
- name: Linux py37
os: ubuntu-latest
pyversion: '3.7'
- name: Linux py38
os: ubuntu-latest
pyversion: '3.8'
- name: Linux py39
os: ubuntu-latest
pyversion: '3.9'
Expand All @@ -51,15 +45,21 @@ jobs:
- name: Linux py311
os: ubuntu-latest
pyversion: '3.11'
- name: Linux py312
os: ubuntu-latest
pyversion: '3.12'
- name: Linux py313
os: ubuntu-latest
pyversion: '3.13'
- name: Linux pypy3
os: ubuntu-latest
pyversion: 'pypy3.9'
- name: Windows py39
- name: Windows py313
os: windows-latest
pyversion: '3.9'
- name: MacOS py39
pyversion: '3.13'
- name: MacOS py313
os: macos-latest
pyversion: '3.9'
pyversion: '3.13'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.pyversion }}
Expand All @@ -71,8 +71,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -U -r requirements.txt
pip install pytest requests
python setup.py install
pip install pytest requests setuptools .
rm -rf ./timetagger ./build ./egg-info
- name: Test with pytest
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion deploy/pip.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# mypaas.maxmem = 256m
# mypaas.env = TIMETAGGER_CREDENTIALS

FROM python:3.10-slim-buster
FROM python:3.13-slim-bookworm

# Install dependencies (including optional ones that make uvicorn faster)
RUN pip --no-cache-dir install pip --upgrade && pip --no-cache-dir install \
Expand Down
2 changes: 1 addition & 1 deletion deploy/repo.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Note that the build context must be the root of the repo.
# Used by CI to build the image that is pushed to ghcr.

FROM python:3.10-slim-buster
FROM python:3.13-slim-bookworm

WORKDIR /root
COPY . .
Expand Down
2 changes: 1 addition & 1 deletion deploy/repo.nonroot.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Used by CI to build the image that is pushed to ghcr.
# Unpriviliged version that installs and runs as UID 1000.

FROM python:3.10-slim-buster
FROM python:3.13-slim-bookworm

# Create unpriviliged user and group, including directory structure
RUN groupadd -g 1000 timetagger && \
Expand Down
10 changes: 5 additions & 5 deletions timetagger/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import json
import logging
from base64 import b64decode
from pkg_resources import resource_filename
from importlib import resources

import bcrypt
import asgineer
Expand Down Expand Up @@ -55,10 +55,10 @@
logger = logging.getLogger("asgineer")

# Get sets of assets provided by TimeTagger
common_assets = create_assets_from_dir(resource_filename("timetagger.common", "."))
apponly_assets = create_assets_from_dir(resource_filename("timetagger.app", "."))
image_assets = create_assets_from_dir(resource_filename("timetagger.images", "."))
page_assets = create_assets_from_dir(resource_filename("timetagger.pages", "."))
common_assets = create_assets_from_dir(resources.files("timetagger.common") / ".")
apponly_assets = create_assets_from_dir(resources.files("timetagger.app") / ".")
image_assets = create_assets_from_dir(resources.files("timetagger.images") / ".")
page_assets = create_assets_from_dir(resources.files("timetagger.pages") / ".")

# Combine into two groups. You could add/replace assets here.
app_assets = dict(**common_assets, **image_assets, **apponly_assets)
Expand Down
8 changes: 3 additions & 5 deletions timetagger/server/_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import re
import hashlib
import logging
import pkg_resources
from importlib import resources

import jinja2
import pscript
Expand All @@ -29,14 +29,12 @@
re_fas = re.compile(r"\>(\\uf[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])\<")

default_template = (
open(pkg_resources.resource_filename("timetagger.common", "_template.html"), "rb")
.read()
.decode()
open(resources.files("timetagger.common") / "_template.html", "rb").read().decode()
)


def _get_base_style():
fname = pkg_resources.resource_filename("timetagger.common", "_style_embed.scss")
fname = resources.files("timetagger.common") / "_style_embed.scss"
with open(fname, "rb") as f:
text = f.read().decode()
return utils.get_scss_vars(text), utils.compile_scss_to_css(text)
Expand Down

0 comments on commit 69a0d7d

Please sign in to comment.