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

Update testing setup for python 3.11 and django 5.0 #583

Merged
merged 26 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
00a34f3
Update testing setup
mrchrisadams May 3, 2024
5d26453
Try one version lower
mrchrisadams May 3, 2024
f9032a2
Switch to python 3.11
mrchrisadams May 3, 2024
68240fa
Test run of upgrade to django 4.0
mrchrisadams May 3, 2024
e642d22
Update to django 4.1
mrchrisadams May 3, 2024
e7d9b3e
Update to django 4.2
mrchrisadams May 3, 2024
df18ca8
Update to Django 5.0
mrchrisadams May 3, 2024
6eb3fb9
Update github actions for node 16 deprecation
mrchrisadams May 3, 2024
66e4b1b
Add steps for running platform on Python 3.11
mrchrisadams May 3, 2024
ad4097d
Update admin logo, fix app_list in our admin subclass
mrchrisadams May 3, 2024
a1d940c
Switch to using dotenv and uv for managing packages
mrchrisadams May 3, 2024
56b8d83
Create virtual env with uv in CI
mrchrisadams May 3, 2024
94450e6
Make sure we're using the python dotenv, not ruby one
mrchrisadams May 3, 2024
1268621
Swap out pipenv for dotenv
mrchrisadams May 3, 2024
33cbde4
Update logout to be a POST
mrchrisadams May 6, 2024
7f2397d
Add header for Django 4.0 upwards behind Caddy server
mrchrisadams May 6, 2024
4bdb28f
Add call to exec, so that supervisor can stop/stop web servers
mrchrisadams May 6, 2024
2e87b58
Add explicit control over gunicorn concurrency in deploys
mrchrisadams May 6, 2024
1f04f47
Scale down our default sample rate
mrchrisadams May 6, 2024
88a9186
Switch from supervisor to systemd for process mgmt
mrchrisadams May 8, 2024
8ad267e
Update gunicorn setup for readability
mrchrisadams May 9, 2024
22c2bb3
Update deploy scripts for systemd
mrchrisadams May 9, 2024
640a8d0
Switch to using uv for installing dependencies
mrchrisadams May 9, 2024
10ef781
We no longer use nginx, remove from docs and ansible
mrchrisadams May 9, 2024
71b01e7
We no longer use pipenv. Remove from repo
mrchrisadams May 9, 2024
94b34be
Remove out of date docker related code
mrchrisadams May 9, 2024
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
35 changes: 15 additions & 20 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

services:
mariadb:
image: mariadb:10.3
image: mariadb:10.11
ports:
- 3306:3306
env:
Expand All @@ -29,47 +29,42 @@ jobs:
- 5672:5672
options: '--hostname "rmq" --health-cmd "rabbitmqctl status" --health-interval 10s --health-timeout 10s --health-retries 3 --health-start-period 60s'

# redis
redis:
image: redis:latest
ports:
- 6379:6379

strategy:
matrix:
python-version: [3.8]
python-version: [3.11]

steps:
- uses: actions/checkout@v4

- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install pipenv and wheel for managing dependencies
- name: Install tooling for managing dependencies
run: |
python -m pip install --upgrade pipenv wheel
python -m pip install --upgrade uv wheel

- name: Set up a cache-key for installations of dependencies, in .venv
id: cache-pipenv
uses: actions/cache@v3
with:
path: ./.venv
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
# - name: Set up a cache-key for installations of dependencies, in .venv
# id: cache-venv
# uses: actions/cache@v4
# with:
# path: ./.venv
# key: ${{ runner.os }}-venv-${{ hashFiles('**/Pipfile.lock') }}

- name: Install dependencies
# skipping this check to see if we have a collision between cache keys
# when deploying versus running tests
# if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --deploy --dev --verbose
uv venv
uv pip install -r requirements/requirements.linux.generated.txt

- name: Run tests
run: |
pipenv run pytest
source .venv/bin/activate
.venv/bin/dotenv -f .env.test run -- pytest
env:
PIPENV_DOTENV_LOCATION: .env.test
DOMAIN_SNAPSHOT_BUCKET: ${{ secrets.TESTING_DOMAIN_SNAPSHOT_BUCKET }}
DATABASE_URL_READ_ONLY: ${{ secrets.TESTING_DATABASE_URL_READ_ONLY }}
OBJECT_STORAGE_ACCESS_KEY_ID: ${{ secrets.TESTING_OBJECT_STORAGE_ACCESS_KEY_ID }}
Expand Down
11 changes: 6 additions & 5 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ tasks:
init: |
cp ./.env.gitpod ./.env
mysqladmin create greencheck
python -m pipenv install --dev
python -m pipenv run python ./manage.py migrate
python -m pipenv run python ./manage.py tailwind install
python -m pipenv run python ./manage.py tailwind build
source .venv/bin/activate
dotenv run -- python -m pip install -r requirements/requirements.linux.generated.txt
dotenv run -- ./manage.py migrate
dotenv run -- ./manage.py tailwind install
dotenv run -- ./manage.py tailwind build
cd ./apps/theme/static_src/
npx rollup --config
cd ../../../
python -m pipenv run python ./manage.py collectstatic --no-input
dotenv run -- ./manage.py collectstatic --no-input
command: ls

- name: rabbitmq
Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python 3.11.9
34 changes: 0 additions & 34 deletions Dockerfile

This file was deleted.

105 changes: 0 additions & 105 deletions Pipfile

This file was deleted.

Loading
Loading