Skip to content
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
13 changes: 7 additions & 6 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Install UV
run: pipx install uv
- uses: actions/setup-python@v5
with:
python-version: 3.13
cache: poetry
- run: poetry install
cache: pip
- name: Install dependencies
run: uv pip install -e .
- name: Run Tests
run: |
poetry run python manage.py compress
poetry run pytest
python manage.py compress
pytest
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.7
3.13.2
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.languageServer": "None"
}
25 changes: 7 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.14.0a4
FROM python:3.13.2

# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
Expand All @@ -9,26 +9,15 @@
# Set the working directory in the container
WORKDIR /code

# Install Poetry
# Note: Consider locking the Poetry version for consistent builds
ENV POETRY_VERSION=1.8.4
RUN pip install "poetry==$POETRY_VERSION" --no-cache-dir
# Install UV for dependency management
RUN pip install uv --no-cache-dir

Check warning on line 13 in Dockerfile

View check run for this annotation

Trunk.io / Trunk Check

hadolint(DL3013)

[new] Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>`

# Copy the project files into the working directory
COPY pyproject.toml poetry.lock* /code/

# Configure Poetry
# - Do not create a virtual environment inside the Docker container
# - Do not ask any interactive question (like the confirmation of package installation)
ENV POETRY_VIRTUALENVS_CREATE=false
ENV POETRY_NO_INTERACTION=1

# Install runtime dependencies using Poetry
RUN poetry install --only main --no-root

# Copy the rest of the project files into the working directory
# Copy all project files into the working directory
COPY . /code/

# Install dependencies using UV with --system flag
RUN uv pip install --system -e .

HEALTHCHECK CMD curl --fail http://localhost:8000/ || exit 1

# Use a script as the entrypoint
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ open http://localhost:8000
3. Install dependencies

```shell
brew install pyenv poetry
pyenv install 3.11.7
pyenv local 3.11.7
brew install pyenv uv
pyenv install 3.13.2
pyenv local 3.13.2
pyenv init
poetry install
eval $(poetry env activate)
uv venv
source .venv/bin/activate
uv pip install -e .
```

4. Before you run the Django server for the first time, you'll need to create the database tables:
Expand Down
1,719 changes: 0 additions & 1,719 deletions poetry.lock

This file was deleted.

57 changes: 29 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
[tool.poetry]
[project]
name = "approval-frame"
version = "0.1.0"
description = ""
authors = ["Felix Sargent <[email protected]>"]
authors = [{ name = "Felix Sargent", email = "[email protected]" }]
readme = "README.md"
packages = [{ include = "approval_polls" }]

[tool.poetry.dependencies]
python = "^3.13.1"
django = "~5.0.0"
pytz = "^2023.4"
django-extensions = "^3.2.3"
djangoajax = "^3.3"
django-environ = "^0.11.2"
django-sendgrid-v5 = "^1.2.3"
gunicorn = "^22.0.0"
django-upgrade = "^1.15.0"
whitenoise = "^6.6.0"
django-structlog = "^7.1.0"
django-allauth = { version = "65.3.1", extras = ["socialaccount", "google"] }
djlint = "^1.34.1"
django-widget-tweaks = "^1.5.0"
sentry-sdk = { extras = ["django"], version = "^2.8.0" }
pytest = "^8.2.2"
pytest-django = "^4.8.0"
django-compressor = "^4.5.1"
django-libsass = "^0.9"
django-import-export = { extras = ["all"], version = "^4.3.4" }
requires-python = ">=3.13.1"
dependencies = [
"django~=5.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: ~=5.0.0 restricts Django to 5.0.x only

If you want to support all 5.x versions, use ~=5.0 or >=5.0,<6.0 instead.

Suggested change
"django~=5.0.0",
"django~=5.0",

"pytz>=2023.4",
"django-extensions>=3.2.3",
"djangoajax>=3.3",
"django-environ>=0.11.2",
"django-sendgrid-v5>=1.2.3",
"gunicorn>=22.0.0",
"django-upgrade>=1.15.0",
"whitenoise>=6.6.0",
"django-structlog>=7.1.0",
"django-allauth[socialaccount]>=65.3.1",
"djlint>=1.34.1",
"django-widget-tweaks>=1.5.0",
"sentry-sdk[django]>=2.8.0",
"pytest>=8.2.2",
"pytest-django>=4.8.0",
"django-compressor>=4.5.1",
"django-libsass>=0.9",
"django-import-export[all]>=4.3.4",
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["approval_polls"]

# pyproject.toml
[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "approval_polls.settings"
python_files = "tests.py test_*.py *_tests.py"
Expand Down
187 changes: 187 additions & 0 deletions requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml -o requirements.lock
asgiref==3.8.1
# via
# django
# django-allauth
# django-structlog
certifi==2025.4.26
# via
# requests
# sentry-sdk
cffi==1.17.1
# via cryptography
charset-normalizer==3.4.2
# via requests
click==8.2.1
# via djlint
colorama==0.4.6
# via djlint
cryptography==45.0.3
# via pyjwt
cssbeautifier==1.15.4
# via djlint
defusedxml==0.7.1
# via odfpy
diff-match-patch==20241021
# via django-import-export
django==5.0.14
# via
# approval-frame (pyproject.toml)
# django-allauth
# django-appconf
# django-compressor
# django-extensions
# django-import-export
# django-sendgrid-v5
# django-structlog
# djangoajax
# sentry-sdk
django-allauth==65.9.0
# via approval-frame (pyproject.toml)
django-appconf==1.1.0
# via django-compressor
django-compressor==4.5.1
# via
# approval-frame (pyproject.toml)
# django-libsass
django-environ==0.12.0
# via approval-frame (pyproject.toml)
django-extensions==4.1
# via approval-frame (pyproject.toml)
django-import-export==4.3.7
# via approval-frame (pyproject.toml)
django-ipware==7.0.1
# via django-structlog
django-libsass==0.9
# via approval-frame (pyproject.toml)
django-sendgrid-v5==1.3.0
# via approval-frame (pyproject.toml)
django-structlog==9.1.1
# via approval-frame (pyproject.toml)
django-upgrade==1.25.0
# via approval-frame (pyproject.toml)
django-widget-tweaks==1.5.0
# via approval-frame (pyproject.toml)
djangoajax==3.3
# via approval-frame (pyproject.toml)
djlint==1.36.4
# via approval-frame (pyproject.toml)
ecdsa==0.19.1
# via sendgrid
editorconfig==0.17.0
# via
# cssbeautifier
# jsbeautifier
et-xmlfile==2.0.0
# via openpyxl
gunicorn==23.0.0
# via approval-frame (pyproject.toml)
idna==3.10
# via requests
iniconfig==2.1.0
# via pytest
jsbeautifier==1.15.4
# via
# cssbeautifier
# djlint
json5==0.12.0
# via djlint
libsass==0.23.0
# via django-libsass
markupsafe==3.0.2
# via werkzeug
numpy==2.2.6
# via pandas
oauthlib==3.2.2
# via requests-oauthlib
odfpy==1.4.1
# via tablib
openpyxl==3.1.5
# via tablib
packaging==25.0
# via
# gunicorn
# pytest
pandas==2.2.3
# via tablib
pathspec==0.12.1
# via djlint
pluggy==1.6.0
# via pytest
pycparser==2.22
# via cffi
pygments==2.19.1
# via pytest
pyjwt==2.10.1
# via django-allauth
pytest==8.4.0
# via
# approval-frame (pyproject.toml)
# pytest-django
pytest-django==4.11.1
# via approval-frame (pyproject.toml)
python-dateutil==2.9.0.post0
# via pandas
python-http-client==3.3.7
# via
# django-sendgrid-v5
# sendgrid
python-ipware==3.0.0
# via django-ipware
pytz==2025.2
# via
# approval-frame (pyproject.toml)
# pandas
pyyaml==6.0.2
# via
# djlint
# tablib
rcssmin==1.1.2
# via django-compressor
regex==2024.11.6
# via djlint
requests==2.32.3
# via
# django-allauth
# requests-oauthlib
requests-oauthlib==2.0.0
# via django-allauth
rjsmin==1.2.2
# via django-compressor
sendgrid==6.12.3
# via django-sendgrid-v5
sentry-sdk==2.29.1
# via approval-frame (pyproject.toml)
six==1.17.0
# via
# cssbeautifier
# ecdsa
# jsbeautifier
# python-dateutil
sqlparse==0.5.3
# via django
structlog==25.4.0
# via django-structlog
tablib==3.8.0
# via django-import-export
tabulate==0.9.0
# via tablib
tokenize-rt==6.2.0
# via django-upgrade
tqdm==4.67.1
# via djlint
tzdata==2025.2
# via pandas
urllib3==2.4.0
# via
# requests
# sentry-sdk
werkzeug==3.1.3
# via sendgrid
whitenoise==6.9.0
# via approval-frame (pyproject.toml)
xlrd==2.0.1
# via tablib
xlwt==1.3.0
# via tablib
Loading