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
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
restore-keys: ${{ runner.os }}-pip-

- name: Install dependencies
run: pip install -e '.[dev]'
run: pip install --group dev -e .

Comment thread
JacobCoffee marked this conversation as resolved.
- name: Check for ungenerated migrations
run: python manage.py makemigrations --check --dry-run
Expand Down Expand Up @@ -82,9 +82,7 @@ jobs:
restore-keys: ${{ runner.os }}-pip-

- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -e '.[dev]'
run: pip install --group dev -e .

Comment thread
JacobCoffee marked this conversation as resolved.
Comment thread
JacobCoffee marked this conversation as resolved.
- name: Run tests
run: python -Wd -m coverage run manage.py test -v2
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ COPY pyproject.toml /code/
RUN --mount=type=cache,target=/root/.cache/pip \
set -x \
&& pip --disable-pip-version-check \
install \
'.[dev]'
install --group dev \
.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

gross


Comment thread
JacobCoffee marked this conversation as resolved.
COPY . /code/

Expand Down
20 changes: 13 additions & 7 deletions pydotorg/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,19 @@
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"


INSTALLED_APPS += [
"debug_toolbar",
]

MIDDLEWARE += [
"debug_toolbar.middleware.DebugToolbarMiddleware",
]
try:
import debug_toolbar # noqa: F401

INSTALLED_APPS += [
"debug_toolbar",
]

MIDDLEWARE += [
"debug_toolbar.middleware.DebugToolbarMiddleware",
]
except ModuleNotFoundError as exc:
Comment thread
JacobCoffee marked this conversation as resolved.
if exc.name != "debug_toolbar":
raise

CACHES = {
"default": {
Expand Down
5 changes: 3 additions & 2 deletions pydotorg/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@

if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
import debug_toolbar
if "debug_toolbar" in settings.INSTALLED_APPS:
import debug_toolbar

urlpatterns = [path("__debug__/", include(debug_toolbar.urls)), *urlpatterns]
urlpatterns = [path("__debug__/", include(debug_toolbar.urls)), *urlpatterns]