Skip to content

Commit

Permalink
Revert "Use uv, bump dependencies"
Browse files Browse the repository at this point in the history
  • Loading branch information
julianweng authored Feb 24, 2025
1 parent a70f475 commit 33541de
Show file tree
Hide file tree
Showing 15 changed files with 328 additions and 543 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Docker
Dockerfile
.dockerignore
.venv

# git
.circleci
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
# Generated by cdkactions. Do not modify
# Generated as part of the 'cfa' stack.
name: Build and Deploy
on: push
jobs:
django-check:
name: Django Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v4
uses: actions/cache@v2
with:
path: .venv
key: v0-${{ hashFiles('./uv.lock') }}
path: ~/.local/share/virtualenvs
key: v0-${{ hashFiles('./Pipfile.lock') }}
- name: Install Dependencies
run: |-
cd .
uv sync --frozen
pip install pipenv
pipenv install --deploy --dev
- name: Test (run in parallel)
run: |-
cd .
uv run coverage run --concurrency=multiprocessing manage.py test --settings=penncfa.settings.ci --parallel
uv run coverage combine
pipenv run coverage run --concurrency=multiprocessing manage.py test --settings=penncfa.settings.ci --parallel
pipenv run coverage combine
- name: Upload Code Coverage
run: |-
ROOT=$(pwd)
cd .
uv run codecov --root $ROOT --flags backend
pipenv run codecov --root $ROOT --flags backend
container:
image: ghcr.io/astral-sh/uv:0.6.2-python3.12-bookworm
image: python:3.8-buster
env:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
services:
postgres:
image: postgres:17
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
Expand All @@ -41,11 +44,11 @@ jobs:
name: Publish backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v4
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: buildx-publish-backend
Expand All @@ -67,7 +70,7 @@ jobs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- id: synth
name: Synth cdk8s manifests
run: |-
Expand Down
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
FROM ghcr.io/astral-sh/uv:0.6.2-python3.12-bookworm
FROM pennlabs/django-base:3cadd22f7ad51359c5e86b6a3cba2fc155c1c6ab

LABEL maintainer="Penn Labs"

# Copy project dependencies
COPY Pipfile* /app/

# Install project dependencies
RUN pipenv install --system

# Copy project files
COPY . /app/

WORKDIR /app
RUN uv sync --frozen

ENV DJANGO_SETTINGS_MODULE penncfa.settings.production
ENV SECRET_KEY 'temporary key just to build the docker image'

# Implicitly sync dependencies and collect static files
RUN uv run /app/manage.py collectstatic --noinput
# Collect static files
RUN python3 /app/manage.py collectstatic --noinput
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.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
dj-database-url = "*"
Django = "*"
django-extensions = "*"
django-registration = "*"
psycopg2 = "*"
raven = "*"
uwsgi = "*"

[dev-packages]
codecov = "*"
unittest-xml-reporting = "*"
tblib = "*"

[requires]
python_version = "3"
239 changes: 239 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 33541de

Please sign in to comment.