Skip to content

Commit 04fd246

Browse files
committed
feat: restructure app
1 parent dc57cd2 commit 04fd246

File tree

990 files changed

+10561
-10691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

990 files changed

+10561
-10691
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ jobs:
3838
cache-name: pythondotorg-cache-pip
3939
with:
4040
path: ~/.cache/pip
41-
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', '*-requirements.txt') }}
41+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements/requirements.txt', 'requirements/*-requirements.txt') }}
4242
restore-keys: |
4343
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
4444
${{ runner.os }}-${{ github.job }}-
4545
${{ runner.os }}-
4646
- name: Install Python dependencies
4747
run: |
4848
pip install -U pip setuptools wheel
49-
pip install -r dev-requirements.txt
49+
pip install -r requirements/dev-requirements.txt
5050
- name: Check for ungenerated database migrations
5151
run: |
5252
python manage.py makemigrations --check --dry-run

.github/workflows/static.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
cache-name: pythondotorg-cache-pip
1616
with:
1717
path: ~/.cache/pip
18-
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', '*-requirements.txt') }}
18+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements/requirements.txt', 'requirements/*-requirements.txt') }}
1919
restore-keys: |
2020
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
2121
${{ runner.os }}-${{ github.job }}-
2222
${{ runner.os }}-
2323
- name: Install Python dependencies
2424
run: |
2525
pip install -U pip setuptools wheel
26-
pip install -r requirements.txt -r prod-requirements.txt
26+
pip install -r requirements/requirements.txt -r requirements/prod-requirements.txt
2727
- name: Run Tests
2828
run: |
2929
DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
.sass-cache/
1313
docs/build
14-
media/*
14+
app/media/*
1515
static-root/
1616
static/stylesheets/mq.css
1717
static/stylesheets/no-mq.css

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ build:
1010
python: "3"
1111

1212
commands:
13-
- python -m pip install -r docs-requirements.txt
13+
- python -m pip install -r requirements/docs-requirements.txt
1414
- make -C docs html JOBS=$(nproc) BUILDDIR=_readthedocs
1515
- mv docs/_readthedocs _readthedocs

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ RUN case $(uname -m) in \
3232
RUN mkdir /code
3333
WORKDIR /code
3434

35-
COPY dev-requirements.txt /code/
36-
COPY base-requirements.txt /code/
37-
COPY prod-requirements.txt /code/
38-
COPY requirements.txt /code/
35+
COPY requirements/dev-requirements.txt /code/
36+
COPY requirements/base-requirements.txt /code/
37+
COPY requirements/prod-requirements.txt /code/
38+
COPY requirements/requirements.txt /code/
3939

4040
RUN pip --no-cache-dir --disable-pip-version-check install --upgrade pip setuptools wheel
4141

Dockerfile.cabotage

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ RUN case $(uname -m) in \
3333
RUN mkdir /code
3434
WORKDIR /code
3535

36-
COPY dev-requirements.txt /code/
37-
COPY base-requirements.txt /code/
38-
COPY prod-requirements.txt /code/
39-
COPY requirements.txt /code/
36+
COPY requirements/dev-requirements.txt /code/
37+
COPY requirements/base-requirements.txt /code/
38+
COPY requirements/prod-requirements.txt /code/
39+
COPY requirements/requirements.txt /code/
4040

4141
RUN pip --no-cache-dir --disable-pip-version-check install --upgrade pip setuptools wheel
4242

@@ -46,4 +46,4 @@ RUN --mount=type=cache,target=/root/.cache/pip \
4646
install \
4747
-r requirements.txt -r prod-requirements.txt
4848
COPY . /code/
49-
RUN DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput
49+
RUN DJANGO_SETTINGS_MODULE=pydotorg.settings.static python app/manage.py collectstatic --noinput

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ default:
88
@echo
99
@exit 1
1010

11-
.state/docker-build-web: Dockerfile dev-requirements.txt base-requirements.txt
11+
.state/docker-build-web: Dockerfile requirements/dev-requirements.txt requirements/base-requirements.txt
1212
# Build web container for this project
1313
docker compose build --force-rm web
1414

@@ -24,7 +24,7 @@ default:
2424

2525
.state/db-initialized: .state/docker-build-web .state/db-migrated
2626
# Load all fixtures
27-
docker compose run --rm web ./manage.py loaddata fixtures/*.json
27+
docker compose run --rm web ./app/manage.py loaddata fixtures/*.json
2828

2929
# Mark the state so we don't rebuild this needlessly.
3030
mkdir -p .state && touch .state/db-initialized
@@ -34,25 +34,25 @@ serve: .state/db-initialized
3434

3535
migrations: .state/db-initialized
3636
# Run Django makemigrations
37-
docker compose run --rm web ./manage.py makemigrations
37+
docker compose run --rm web ./app/manage.py makemigrations
3838

3939
migrate: .state/docker-build-web
4040
# Run Django migrate
41-
docker compose run --rm web ./manage.py migrate
41+
docker compose run --rm web ./app/manage.py migrate
4242

4343
manage: .state/db-initialized
4444
# Run Django manage to accept arbitrary arguments
45-
docker compose run --rm web ./manage.py $(filter-out $@,$(MAKECMDGOALS))
45+
docker compose run --rm web ./app/manage.py $(filter-out $@,$(MAKECMDGOALS))
4646

4747
shell: .state/db-initialized
48-
docker compose run --rm web ./manage.py shell
48+
docker compose run --rm web ./app/manage.py shell
4949

5050
clean:
5151
docker compose down -v
5252
rm -f .state/docker-build-web .state/db-initialized .state/db-migrated
5353

5454
test: .state/db-initialized
55-
docker compose run --rm web ./manage.py test
55+
docker compose run --rm web ./app/manage.py test
5656

5757
docker_shell: .state/db-initialized
5858
docker compose run --rm web /bin/bash

Procfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
release: python manage.py migrate --noinput
1+
release: python app/manage.py migrate --noinput
22
web: bin/start-nginx gunicorn -c gunicorn.conf pydotorg.wsgi
3-
worker: celery -A pydotorg worker -l INFO
3+
worker: celery -A app.pydotorg worker -l INFO
44
worker-beat: celery -A pydotorg beat -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)