Skip to content

Commit

Permalink
Various small fixes to keep this up to date with the template
Browse files Browse the repository at this point in the history
  • Loading branch information
vikahl committed Oct 8, 2023
1 parent 1c55654 commit 619f1a3
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Example Docker image that uses a multistage build to first build the a
# library of the service.

FROM python:slim AS builder
FROM python:3.8-slim AS builder
# It is recommended to use sha256 hash to ensure exact version, as tags can be
# moved. For example:
# FROM python:slim@sha256:a7deebfd654d0158999e9ae9a78ce4a9c7090816a2d1600d254fef8b7fd74cac
Expand Down Expand Up @@ -29,7 +29,7 @@ RUN python3 -m build --wheel .
# Start the runtime image.
# It is recommended to use sha256 here as well (see comment at builder FROM
# statement).
FROM python:slim AS runtime
FROM python:3.8-slim AS runtime

# Create a user and group to not run everything as root.
RUN groupadd --gid 1000 --system python_project_example && \
Expand All @@ -47,7 +47,7 @@ RUN pip3 install --no-cache-dir --no-deps --no-index --find-links=dist python_pr

# Copy the compiled requirements and install them. See the two alternatives for
# different type of packages.
COPY --chown=1000:1000 requirements.txt .
COPY --chown=1000:1000 requirements/requirements-py38.txt requirements.txt

# ALTERNATIVE 1: If the packages requires system dependencies (e.g., compilers)
# they can be installed and removed within the same layer to keep the
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ requires-python = ">=3.8"
# should be loosely defined as too narrow constraints will make it hard to
# install the package together with other libraries and will prevent users from
# getting security updates.

# For services, the dependencies (including transitive) should be compiled with
# pip-tools. See requirements.txt for details.

dependencies = [
"typer"
]

[project.optional-dependencies]
# pip-compile doesn't work well with extras referencing the package itself when
Expand Down
9 changes: 8 additions & 1 deletion requirements/requirements-py310-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ black==23.9.1 \
click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via black
# via
# black
# typer
coverage[toml]==7.3.2 \
--hash=sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1 \
--hash=sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63 \
Expand Down Expand Up @@ -194,10 +196,15 @@ tomlkit==0.12.1 \
--hash=sha256:38e1ff8edb991273ec9f6181244a6a391ac30e9f5098e7535640ea6be97a7c86 \
--hash=sha256:712cbd236609acc6a3e2e97253dfc52d4c2082982a88f61b640ecf0817eab899
# via pylint
typer==0.9.0 \
--hash=sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2 \
--hash=sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee
# via python-project-example (pyproject.toml)
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
--hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef
# via
# astroid
# black
# mypy
# typer
12 changes: 12 additions & 0 deletions requirements/requirements-py310.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@
#
# 'tox run -m requirements'
#
click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via typer
typer==0.9.0 \
--hash=sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2 \
--hash=sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee
# via python-project-example (pyproject.toml)
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
--hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef
# via typer
12 changes: 10 additions & 2 deletions requirements/requirements-py311-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ black==23.9.1 \
click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via black
# via
# black
# typer
coverage[toml]==7.3.2 \
--hash=sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1 \
--hash=sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63 \
Expand Down Expand Up @@ -181,7 +183,13 @@ tomlkit==0.12.1 \
--hash=sha256:38e1ff8edb991273ec9f6181244a6a391ac30e9f5098e7535640ea6be97a7c86 \
--hash=sha256:712cbd236609acc6a3e2e97253dfc52d4c2082982a88f61b640ecf0817eab899
# via pylint
typer==0.9.0 \
--hash=sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2 \
--hash=sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee
# via python-project-example (pyproject.toml)
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
--hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef
# via mypy
# via
# mypy
# typer
12 changes: 12 additions & 0 deletions requirements/requirements-py311.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@
#
# 'tox run -m requirements'
#
click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via typer
typer==0.9.0 \
--hash=sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2 \
--hash=sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee
# via python-project-example (pyproject.toml)
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
--hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef
# via typer
9 changes: 8 additions & 1 deletion requirements/requirements-py38-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ black==23.9.1 \
click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via black
# via
# black
# typer
coverage[toml]==7.3.2 \
--hash=sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1 \
--hash=sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63 \
Expand Down Expand Up @@ -194,6 +196,10 @@ tomlkit==0.12.1 \
--hash=sha256:38e1ff8edb991273ec9f6181244a6a391ac30e9f5098e7535640ea6be97a7c86 \
--hash=sha256:712cbd236609acc6a3e2e97253dfc52d4c2082982a88f61b640ecf0817eab899
# via pylint
typer==0.9.0 \
--hash=sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2 \
--hash=sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee
# via python-project-example (pyproject.toml)
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
--hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef
Expand All @@ -202,3 +208,4 @@ typing-extensions==4.8.0 \
# black
# mypy
# pylint
# typer
12 changes: 12 additions & 0 deletions requirements/requirements-py38.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@
#
# 'tox run -m requirements'
#
click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via typer
typer==0.9.0 \
--hash=sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2 \
--hash=sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee
# via python-project-example (pyproject.toml)
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
--hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef
# via typer
9 changes: 8 additions & 1 deletion requirements/requirements-py39-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ black==23.9.1 \
click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via black
# via
# black
# typer
coverage[toml]==7.3.2 \
--hash=sha256:0cbf38419fb1a347aaf63481c00f0bdc86889d9fbf3f25109cf96c26b403fda1 \
--hash=sha256:12d15ab5833a997716d76f2ac1e4b4d536814fc213c85ca72756c19e5a6b3d63 \
Expand Down Expand Up @@ -194,6 +196,10 @@ tomlkit==0.12.1 \
--hash=sha256:38e1ff8edb991273ec9f6181244a6a391ac30e9f5098e7535640ea6be97a7c86 \
--hash=sha256:712cbd236609acc6a3e2e97253dfc52d4c2082982a88f61b640ecf0817eab899
# via pylint
typer==0.9.0 \
--hash=sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2 \
--hash=sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee
# via python-project-example (pyproject.toml)
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
--hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef
Expand All @@ -202,3 +208,4 @@ typing-extensions==4.8.0 \
# black
# mypy
# pylint
# typer
12 changes: 12 additions & 0 deletions requirements/requirements-py39.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,15 @@
#
# 'tox run -m requirements'
#
click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via typer
typer==0.9.0 \
--hash=sha256:50922fd79aea2f4751a8e0408ff10d2662bd0c8bbfa84755a699f3bada2978b2 \
--hash=sha256:5d96d986a21493606a358cae4461bd8cdf83cbf33a5aa950ae629ca3b51467ee
# via python-project-example (pyproject.toml)
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
--hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef
# via typer
2 changes: 1 addition & 1 deletion src/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

for i in range(10):
print(f"{i}. Service is running.")
time.sleep(30)
time.sleep(2)

0 comments on commit 619f1a3

Please sign in to comment.