Skip to content

Commit 5e9a9e7

Browse files
authored
refactor: minor (#317)
* refactor: minor * Update ci.yml * Update .yamllint.yaml
1 parent 176102e commit 5e9a9e7

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
5757
- run: |
5858
uv lock --check
59-
uv sync --locked
59+
uv sync
6060
uv pip list
6161
6262
- run: make lint test
@@ -102,7 +102,7 @@ jobs:
102102
with:
103103
registry: ghcr.io
104104
username: ${{ github.repository_owner }}
105-
password: ${{ secrets.GITHUB_TOKEN }}
105+
password: ${{ github.token }}
106106

107107
- if: ${{ github.event_name == 'push' || github.ref_name == github.event.repository.default_branch }}
108108
uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0 # v6

.trunk/configs/.yamllint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
rules:
22
quoted-strings:
33
required: only-when-needed
4-
extra-allowed: ["{|}"]
4+
extra-allowed: ["{|}?"]
55
key-duplicates: {}
66
octal-values:
77
forbid-implicit-octal: true

Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ ARG VIRTUAL_ENV=${APP_HOME}/.venv
1818
ENV PATH=${VIRTUAL_ENV}/bin:${PATH} \
1919
PYTHONFAULTHANDLER=1 \
2020
PYTHONUNBUFFERED=1 \
21+
UV_LOCKED=1 \
22+
UV_NO_SYNC=1 \
23+
UV_PYTHON_DOWNLOADS=manual \
2124
UV_PYTHON_INSTALL_DIR=/opt \
2225
VIRTUAL_ENV=${VIRTUAL_ENV}
2326

@@ -45,14 +48,13 @@ RUN apt-get update && \
4548
&& rm -rf /var/lib/apt/lists/*
4649

4750
ARG PYTHONDONTWRITEBYTECODE=1
48-
ENV UV_LOCKED=1 \
49-
UV_NO_CACHE=1 \
50-
UV_NO_SYNC=1
51+
ARG UV_NO_CACHE=1
5152

5253
# set up python
5354
COPY --from=ghcr.io/astral-sh/uv:latest@sha256:83285c39ee68ed64708fca1495c2d0aad084e9ac02a8910f5180b8e36bcf803a /uv /uvx /bin/
5455
COPY .python-version pyproject.toml uv.lock ./
55-
RUN uv sync --no-default-groups --no-install-project && \
56+
RUN uv python install && \
57+
uv sync --no-default-groups --no-install-project && \
5658
chown -R "${USER}:${USER}" "${VIRTUAL_ENV}" && \
5759
chown -R "${USER}:${USER}" "${APP_HOME}" && \
5860
uv pip list
@@ -103,7 +105,7 @@ COPY main.py main.py
103105
RUN pyinstaller --hidden-import example_app.main --onefile main.py && \
104106
staticx --strip dist/main /main
105107

106-
USER user
108+
USER ${USER}
107109
ENTRYPOINT [ "/dist/main" ]
108110

109111
##

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
66
name = "example-app"
77
version = "0.1.0"
88
description = "Python example app incorporating best practices"
9-
authors = [{ name = "yxtay", email = "wyextay@gmail.com" }]
9+
authors = [{ name = "yxtay", email = "[email protected].com" }]
1010
license = "MIT"
1111
requires-python = "~=3.11"
1212
dependencies = [

0 commit comments

Comments
 (0)