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

Commit

Permalink
Merge pull request #354 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 ee9e921 + 6b052d4 commit 2f60283
Show file tree
Hide file tree
Showing 7 changed files with 1,815 additions and 582 deletions.
18 changes: 15 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
# Use non-slim image as includes GCC
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", "--host", "0.0.0.0", "--port", "8080"]
50 changes: 49 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,62 @@
[package]
[project]
name = "funding-service-design-authenticator"
version = "0.1.1"
description = "The funding service design authenticator for the DLUHC."
authors = ["Version One"]
license = "MIT License"

requires-python = ">=3.10, <3.11"
dependencies = [
"beautifulsoup4>=4.12.3",
"connexion==2.14.2",
"cssmin==0.2.0",
"email-validator==1.2.1",
"flask-assets==2.0",
"flask-compress==1.14",
"flask-redis==0.4.0",
"flask-session==0.4.0",
"flask-talisman==0.8.1",
"flask-wtf==1.2.1",
"flask==2.2.5",
"funding-service-design-utils==5.1.*",
"govuk-frontend-jinja==2.3.0",
"greenlet>=3.1.1",
"jsmin==3.0.1",
"msal==1.28.0",
"openapi-spec-validator>=0.4.0",
"prance>=0.21.8.0",
"pyjwt==2.4.0",
"pyscss==1.4.0",
"requests>=2.32.3",
]

[tool.black]
line-length = 120
experimental-string-processing = 1

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

[tool.uv]

[dependency-groups]
dev = [
"beautifulsoup4>=4.12.3",
"black>=22.12.0",
"debugpy>=1.6.7",
"deepdiff>=5.8.1",
"dparse>=0.5.2",
"flake8-pyproject>=1.2.3",
"invoke>=2.0.0",
"moto>=5.0.12",
"pre-commit~=4.0.0",
"pytest>=7.1.2",
"pytest-env>=0.6.2",
"pytest-flask>=1.3.0",
"pytest-mock==3.10.0",
"pytest-selenium==2.0.1",
"selenium==4.23.1",
"swagger-ui-bundle>=0.0.9",
"webdriver-manager==4.0.1",
]
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ filterwarnings =
# these two below are actully caused by connexion but register as flask because connexion hands off to flask; we should remove this when connexion is upgraded
ignore:Setting 'json_encoder' on the app or a blueprint is deprecated and will be removed in Flask 2.3. Customize 'app.json' instead.:DeprecationWarning:flask
ignore:'JSONEncoder' is deprecated and will be removed in Flask 2.3. Use 'Flask.json' to provide an alternate JSON implementation instead.:DeprecationWarning:flask


# newer versions of setuptools are deprecating some pkg_resources things; we will need to fix this sooner or later
ignore:.*pkg_resources.*:DeprecationWarning
19 changes: 0 additions & 19 deletions requirements-dev.in

This file was deleted.

Loading

0 comments on commit 2f60283

Please sign in to comment.