Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to pipenv #30

Merged
merged 3 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install Dependencies
run: pip install -r requirements.txt
python-version: "3.12"
cache: "pipenv"
- name: Install Pipenv
run: pip install pipenv
- name: Verify Pipfile.lock is in sync
run: pipenv verify
- name: Install dependencies
run: pipenv install --dev
- name: Run Unit Tests
run: python -m pytest -v
run: pipenv run pytest -v
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PIP_ROOT_USER_ACTION=ignore

RUN addgroup -S appgroup && adduser -S appuser -G appgroup
RUN addgroup -S appgroup && adduser -S appuser -G appgroup -u 80

RUN \
apk add \
Expand All @@ -16,8 +16,13 @@ RUN \
build-base

COPY . /app
RUN pip install --no-cache-dir -r requirements.txt
COPY Pipfile Pipfile
COPY Pipfile.lock Pipfile.lock

# Install deps and run build
RUN pip3 install --no-cache-dir pipenv \
&& pipenv install --system --deploy --ignore-pipfile

USER 80
EXPOSE 5000
CMD ["flask", "run", "--host", "0.0.0.0"]
CMD ["pipenv", "run", "flask", "run", "--host", "0.0.0.0"]
21 changes: 21 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
flask = "*"
flask-sqlalchemy = "*"
flask-cors = "*"
govuk-frontend-jinja = "*"
jinja2 = "~=3.1.2"
psycopg2-binary = "*"
alembic = "*"
boto3 = "*"
pytest = "*"
coverage = "*"

[dev-packages]

[requires]
python_version = "3.12"
Loading
Loading