Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #699 from communitiesuk/uv-requirements
Browse files Browse the repository at this point in the history
Migrate app to use `uv` for dependencies
  • Loading branch information
samuelhwilliams authored Nov 13, 2024
2 parents d1c7e01 + e6e01c1 commit bc024c5
Show file tree
Hide file tree
Showing 7 changed files with 2,054 additions and 677 deletions.
19 changes: 16 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
FROM python:3.10-bullseye

WORKDIR /app
COPY requirements-dev.txt requirements-dev.txt
RUN python3 -m pip install --upgrade pip && pip install -r requirements-dev.txt

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# Install the project's dependencies using the lockfile and settings
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project

# Then, add the rest of the project source code and install it
# Installing separately from its dependencies allows optimal layer caching
COPY . .
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen

# Place executables in the environment at the front of the path
ENV PATH="/app/.venv/bin:$PATH"
EXPOSE 8080

CMD ["flask", "run", "--port", "8080", "--host", "0.0.0.0"]
CMD ["flask", "run", "--host", "0.0.0.0", "--port", "8080"]
46 changes: 45 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,58 @@
[package]
[project]
name = "funding-service-design-assessment"
version = "0.1.1"
description = "The funding service design frontend for the DLUHC."
authors = ["Version One"]
license = "MIT License"

requires-python = ">=3.10, <3.11"
dependencies = [
"babel>=2.16.0",
"beautifulsoup4==4.12.2",
"boto3>=1.35.7",
"connexion>=3.1.0",
"cssmin>=0.2.0",
"email-validator>=2.2.0",
"flask>=2.3.3",
"flask-assets>=2.1.0",
"flask-babel>=2.0.0",
"flask-compress>=1.15",
"flask-talisman==1.1.0",
"flask-wtf>=1.2.1",
"funding-service-design-utils>=2.0.51,<2.1.0",
"govuk-frontend-jinja>=3.2.0",
"jsmin>=3.0.1",
"num2words>=0.5.13",
"openapi-spec-validator>=0.7.1",
"pyopenssl>=24.2.1",
"pyscss>=1.4.0",
"requests>=2.32.3",
"swagger-ui-bundle>=1.1.0",
"xhtml2pdf>=0.2.16",
]

[tool.isort]
profile = "black"
force_single_line = "true"

[tool.flake8]
max-line-length = 120
count = true

[tool.uv]

[dependency-groups]
dev = [
"beautifulsoup4==4.12.2",
"black>=24.8.0",
"boto3>=1.35.7",
"debugpy>=1.8.5",
"deepdiff>=8.0.0",
"flake8-pyproject>=1.2.3",
"invoke>=2.2.0",
"pre-commit~=4.0.0",
"pytest>=8.3.2",
"pytest-env>=1.1.3",
"pytest-flask>=1.3.0",
"pytest-mock>=3.14.0",
]
15 changes: 0 additions & 15 deletions requirements-dev.in

This file was deleted.

Loading

0 comments on commit bc024c5

Please sign in to comment.