Skip to content

Commit 65b60e3

Browse files
authored
Merge branch 'main' into main
2 parents 140c42c + d94b133 commit 65b60e3

File tree

118 files changed

+4453
-2181
lines changed

Some content is hidden

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

118 files changed

+4453
-2181
lines changed

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ This is the repository and issue tracker for https://www.python.org
88
website.
99
1010
If you're looking to file an issue with CPython itself, please go to
11-
https://bugs.python.org
11+
https://github.com/python/cpython/issues/new/choose
1212
1313
Issues related to Python's documentation (https://docs.python.org) can
14-
also be filed in https://bugs.python.org, by selecting the
15-
"Documentation" component.
14+
also be filed at https://github.com/python/cpython/issues/new?assignees=&labels=docs&template=documentation.md.
1615
-->
1716

1817
**Is your feature request related to a problem? Please describe.**

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ jobs:
1717
steps:
1818
- name: Check out repository
1919
uses: actions/checkout@v2
20+
- name: Install platform dependencies
21+
run: |
22+
sudo apt -y update
23+
sudo apt -y install --no-install-recommends \
24+
texlive-latex-base \
25+
texlive-latex-recommended \
26+
texlive-plain-generic \
27+
lmodern
28+
- name: Install pandoc
29+
run: |
30+
wget https://github.com/jgm/pandoc/releases/download/2.17.1.1/pandoc-2.17.1.1-1-amd64.deb
31+
sudo dpkg -i pandoc-2.17.1.1-1-amd64.deb
2032
- uses: actions/setup-python@v2
2133
with:
2234
python-version: 3.9.16
@@ -35,6 +47,11 @@ jobs:
3547
run: |
3648
pip install -U pip setuptools wheel
3749
pip install -r dev-requirements.txt
50+
- name: Check for ungenerated database migrations
51+
run: |
52+
python manage.py makemigrations --check --dry-run
53+
env:
54+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/pythonorg
3855
- name: Run Tests
3956
run: |
4057
python -Wd -m coverage run manage.py test -v2

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# $ git config --global core.excludesfile ~/.gitignore_global
1111

1212
.sass-cache/
13+
docs/build
1314
media/*
1415
static-root/
1516
static/stylesheets/mq.css
@@ -25,3 +26,4 @@ __pycache__
2526
.env
2627
.DS_Store
2728
.envrc
29+
.state/

.readthedocs.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
# Project page: https://readthedocs.org/projects/pythondotorg/
4+
5+
version: 2
6+
7+
build:
8+
os: ubuntu-22.04
9+
tools:
10+
python: "3"
11+
12+
commands:
13+
- python -m pip install -r docs-requirements.txt
14+
- make -C docs html JOBS=$(nproc) BUILDDIR=_readthedocs
15+
- mv docs/_readthedocs _readthedocs

Aptfile

Whitespace-only changes.

Dockerfile

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,48 @@
1-
FROM python:3.9-bullseye
1+
FROM python:3.9-bookworm
22
ENV PYTHONUNBUFFERED=1
33
ENV PYTHONDONTWRITEBYTECODE=1
4+
5+
# By default, Docker has special steps to avoid keeping APT caches in the layers, which
6+
# is good, but in our case, we're going to mount a special cache volume (kept between
7+
# builds), so we WANT the cache to persist.
8+
RUN set -eux; \
9+
rm -f /etc/apt/apt.conf.d/docker-clean; \
10+
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache;
11+
12+
# Install System level build requirements, this is done before
13+
# everything else because these are rarely ever going to change.
14+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
15+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
16+
set -x \
17+
&& apt-get update \
18+
&& apt-get install --no-install-recommends -y \
19+
texlive-latex-base \
20+
texlive-latex-recommended \
21+
texlive-fonts-recommended \
22+
texlive-plain-generic \
23+
lmodern
24+
25+
RUN case $(uname -m) in \
26+
"x86_64") ARCH=amd64 ;; \
27+
"aarch64") ARCH=arm64 ;; \
28+
esac \
29+
&& wget --quiet https://github.com/jgm/pandoc/releases/download/2.17.1.1/pandoc-2.17.1.1-1-${ARCH}.deb \
30+
&& dpkg -i pandoc-2.17.1.1-1-${ARCH}.deb
31+
432
RUN mkdir /code
533
WORKDIR /code
34+
635
COPY dev-requirements.txt /code/
736
COPY base-requirements.txt /code/
8-
RUN pip install -r dev-requirements.txt
37+
COPY prod-requirements.txt /code/
38+
COPY requirements.txt /code/
39+
40+
RUN pip --no-cache-dir --disable-pip-version-check install --upgrade pip setuptools wheel
41+
42+
RUN --mount=type=cache,target=/root/.cache/pip \
43+
set -x \
44+
&& pip --disable-pip-version-check \
45+
install \
46+
-r dev-requirements.txt
47+
948
COPY . /code/

Dockerfile.cabotage

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM python:3.9-bullseye
2+
COPY --from=ewdurbin/nginx-static:1.25.x /usr/bin/nginx /usr/bin/nginx
3+
ENV PYTHONUNBUFFERED=1
4+
ENV PYTHONDONTWRITEBYTECODE=1
5+
6+
# By default, Docker has special steps to avoid keeping APT caches in the layers, which
7+
# is good, but in our case, we're going to mount a special cache volume (kept between
8+
# builds), so we WANT the cache to persist.
9+
RUN set -eux; \
10+
rm -f /etc/apt/apt.conf.d/docker-clean; \
11+
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache;
12+
13+
# Install System level build requirements, this is done before
14+
# everything else because these are rarely ever going to change.
15+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
16+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
17+
set -x \
18+
&& apt-get update \
19+
&& apt-get install --no-install-recommends -y \
20+
texlive-latex-base \
21+
texlive-latex-recommended \
22+
texlive-fonts-recommended \
23+
texlive-plain-generic \
24+
lmodern
25+
26+
RUN case $(uname -m) in \
27+
"x86_64") ARCH=amd64 ;; \
28+
"aarch64") ARCH=arm64 ;; \
29+
esac \
30+
&& wget --quiet https://github.com/jgm/pandoc/releases/download/2.17.1.1/pandoc-2.17.1.1-1-${ARCH}.deb \
31+
&& dpkg -i pandoc-2.17.1.1-1-${ARCH}.deb
32+
33+
RUN mkdir /code
34+
WORKDIR /code
35+
36+
COPY dev-requirements.txt /code/
37+
COPY base-requirements.txt /code/
38+
COPY prod-requirements.txt /code/
39+
COPY requirements.txt /code/
40+
41+
RUN pip --no-cache-dir --disable-pip-version-check install --upgrade pip setuptools wheel
42+
43+
RUN --mount=type=cache,target=/root/.cache/pip \
44+
set -x \
45+
&& pip --disable-pip-version-check \
46+
install \
47+
-r requirements.txt -r prod-requirements.txt
48+
COPY . /code/
49+
RUN DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,9 @@ shell: .state/db-initialized
5050
clean:
5151
docker-compose down -v
5252
rm -f .state/docker-build-web .state/db-initialized .state/db-migrated
53+
54+
test: .state/db-initialized
55+
docker-compose run --rm web ./manage.py test
56+
57+
docker_shell: .state/db-initialized
58+
docker-compose run --rm web /bin/bash

Procfile

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

base-requirements.txt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
dj-database-url==0.5.0
22
django-pipeline==2.0.6
33
django-sitetree==1.17.0
4+
django-apptemplates==1.5
5+
django-admin-interface==0.24.2
6+
django-translation-aliases==0.1.0
47
Django==2.2.24
58
docutils==0.12
69
Markdown==3.3.4
710
cmarkgfm==0.6.0
8-
Pillow==8.3.1
11+
Pillow==9.4.0
912
psycopg2-binary==2.8.6
1013
python3-openid==3.2.0
1114
python-decouple==3.4
1215
# lxml used by BeautifulSoup.
13-
lxml==4.6.3
16+
lxml==4.9.2
1417
cssselect==1.1.0
1518
feedparser==6.0.8
16-
beautifulsoup4==4.9.3
19+
beautifulsoup4==4.11.2
1720
icalendar==4.0.7
1821
chardet==4.0.0
22+
celery[redis]==5.3.6
23+
django-celery-beat==2.5.0
1924
# TODO: We may drop 'django-imagekit' completely.
2025
django-imagekit==4.0.2
21-
django-haystack==3.0
22-
elasticsearch>=5,<6
26+
django-haystack==3.2.1
27+
elasticsearch>=7,<8
2328
# TODO: 0.14.0 only supports Django 1.8 and 1.11.
2429
django-tastypie==0.14.3
2530

@@ -41,11 +46,11 @@ django-filter==2.4.0
4146
django-ordered-model==3.4.3
4247
django-widget-tweaks==1.4.8
4348
django-countries==7.2.1
44-
xhtml2pdf==0.2.5
45-
django-easy-pdf3==0.1.2
4649
num2words==0.5.10
4750
django-polymorphic==3.0.0
4851
sorl-thumbnail==12.7.0
49-
docxtpl==0.12.0
50-
reportlab==3.6.6
5152
django-extensions==3.1.4
53+
django-import-export==2.7.1
54+
55+
pypandoc==1.12
56+
panflute==2.3.0

0 commit comments

Comments
 (0)