Skip to content

Commit 2621470

Browse files
authored
Use pyproject.toml (#2894)
1 parent e5a8d8e commit 2621470

15 files changed

Lines changed: 197 additions & 194 deletions

.coveragerc

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ jobs:
2828
uses: actions/cache@v5
2929
with:
3030
path: ~/.cache/pip
31-
key: ${{ runner.os }}-pip-${{ hashFiles('*-requirements.txt') }}
31+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
3232
restore-keys: ${{ runner.os }}-pip-
3333

3434
- name: Install dependencies
35-
run: pip install -r dev-requirements.txt
35+
run: pip install -e '.[dev]'
3636

3737
- name: Check for ungenerated migrations
3838
run: python manage.py makemigrations --check --dry-run
@@ -78,13 +78,13 @@ jobs:
7878
uses: actions/cache@v5
7979
with:
8080
path: ~/.cache/pip
81-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt', '*-requirements.txt') }}
81+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
8282
restore-keys: ${{ runner.os }}-pip-
8383

8484
- name: Install dependencies
8585
run: |
8686
pip install -U pip setuptools wheel
87-
pip install -r dev-requirements.txt
87+
pip install -e '.[dev]'
8888
8989
- name: Run tests
9090
run: python -Wd -m coverage run manage.py test -v2

.github/workflows/static.yml

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

.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 '.[docs]'
1414
- make -C docs html JOBS=$(nproc) BUILDDIR=_readthedocs
1515
- mv docs/_readthedocs _readthedocs

Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,16 @@ 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/
39-
4035
RUN pip --no-cache-dir --disable-pip-version-check install --upgrade pip setuptools wheel
4136

37+
COPY pyproject.toml /code/
38+
4239
RUN --mount=type=cache,target=/root/.cache/pip \
4340
set -x \
4441
&& pip --disable-pip-version-check \
4542
install \
46-
-r dev-requirements.txt
43+
'.[dev]'
4744

4845
COPY . /code/
46+
47+
RUN pip --disable-pip-version-check install --no-deps -e '.'

Dockerfile.cabotage

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ 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/
40-
4136
RUN pip --no-cache-dir --disable-pip-version-check install --upgrade pip setuptools wheel
4237

38+
COPY pyproject.toml /code/
39+
4340
RUN --mount=type=cache,target=/root/.cache/pip \
4441
set -x \
4542
&& pip --disable-pip-version-check \
4643
install \
47-
-r requirements.txt -r prod-requirements.txt
44+
'.[prod]'
45+
4846
COPY . /code/
47+
48+
RUN pip --disable-pip-version-check install --no-deps '.'
4949
RUN DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput

Makefile

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

88
default: help
99

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

base-requirements.txt

Lines changed: 0 additions & 56 deletions
This file was deleted.

dev-requirements.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs-requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)