Skip to content

Commit 74b0693

Browse files
authored
Merge branch 'main' into mal/fix-2021
2 parents 7701d25 + d38d0f5 commit 74b0693

File tree

253 files changed

+75417
-3312
lines changed

Some content is hidden

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

253 files changed

+75417
-3312
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+2-3
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
**Describe the bug**

.github/ISSUE_TEMPLATE/feature_request.md

+2-3
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/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ updates:
1919
- dependency-name: lxml
2020
versions:
2121
- 4.6.2
22+
- package-ecosystem: github-actions
23+
directory: "/"
24+
groups:
25+
github-actions:
26+
patterns:
27+
- "*" # Group all Actions updates into a single larger pull request
28+
schedule:
29+
interval: daily

.github/workflows/ci.yml

+22-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
runs-on: ubuntu-latest
66
services:
77
postgres:
8-
image: postgres:10.1
8+
image: postgres:15.3
99
env:
1010
POSTGRES_USER: postgres
1111
POSTGRES_PASSWORD: postgres
@@ -16,12 +16,24 @@ jobs:
1616
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
1717
steps:
1818
- name: Check out repository
19-
uses: actions/checkout@v2
20-
- uses: actions/setup-python@v2
19+
uses: actions/checkout@v4
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
32+
- uses: actions/setup-python@v5
2133
with:
22-
python-version: 3.9.6
34+
python-version: 3.9.16
2335
- name: Cache Python dependencies
24-
uses: actions/cache@v2
36+
uses: actions/cache@v4
2537
env:
2638
cache-name: pythondotorg-cache-pip
2739
with:
@@ -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

+2
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/

.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.9.16

.readthedocs.yaml

+15
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

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM python:3.9-bookworm
2+
ENV PYTHONUNBUFFERED=1
3+
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+
32+
RUN mkdir /code
33+
WORKDIR /code
34+
35+
COPY dev-requirements.txt /code/
36+
COPY base-requirements.txt /code/
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+
48+
COPY . /code/

Dockerfile.cabotage

+49
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

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
default:
2+
@echo "Call a specific subcommand:"
3+
@echo
4+
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null\
5+
| awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}'\
6+
| sort\
7+
| egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
8+
@echo
9+
@exit 1
10+
11+
.state/docker-build-web: Dockerfile dev-requirements.txt base-requirements.txt
12+
# Build web container for this project
13+
docker-compose build --force-rm web
14+
15+
# Mark the state so we don't rebuild this needlessly.
16+
mkdir -p .state && touch .state/docker-build-web
17+
18+
.state/db-migrated:
19+
# Call migrate target
20+
make migrate
21+
22+
# Mark the state so we don't rebuild this needlessly.
23+
mkdir -p .state && touch .state/db-migrated
24+
25+
.state/db-initialized: .state/docker-build-web .state/db-migrated
26+
# Load all fixtures
27+
docker-compose run --rm web ./manage.py loaddata fixtures/*.json
28+
29+
# Mark the state so we don't rebuild this needlessly.
30+
mkdir -p .state && touch .state/db-initialized
31+
32+
serve: .state/db-initialized
33+
docker-compose up --remove-orphans
34+
35+
migrations: .state/db-initialized
36+
# Run Django makemigrations
37+
docker-compose run --rm web ./manage.py makemigrations
38+
39+
migrate: .state/docker-build-web
40+
# Run Django migrate
41+
docker-compose run --rm web ./manage.py migrate
42+
43+
manage: .state/db-initialized
44+
# Run Django manage to accept arbitrary arguments
45+
docker-compose run --rm web ./manage.py $(filter-out $@,$(MAKECMDGOALS))
46+
47+
shell: .state/db-initialized
48+
docker-compose run --rm web ./manage.py shell
49+
50+
clean:
51+
docker-compose down -v
52+
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

+2
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

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
# python.org
22

3-
[![Build Status](https://travis-ci.org/python/pythondotorg.svg?branch=main)](https://travis-ci.org/python/pythondotorg)
3+
[![CI](https://github.com/python/pythondotorg/actions/workflows/ci.yml/badge.svg)](https://github.com/python/pythondotorg/actions/workflows/ci.yml)
44
[![Documentation Status](https://readthedocs.org/projects/pythondotorg/badge/?version=latest)](https://pythondotorg.readthedocs.io/?badge=latest)
55

66
### General information
77

88
This is the repository and issue tracker for [python.org](https://www.python.org).
99
The repository for CPython itself is at https://github.com/python/cpython, and the
10-
issue tracker is at https://bugs.python.org.
10+
issue tracker is at https://github.com/python/cpython/issues/.
1111

1212
Issues related to [Python's documentation](https://docs.python.org) can be filed in
13-
https://bugs.python.org.
13+
https://github.com/python/cpython/issues/.
1414

1515
### Contributing
1616

1717
* Source code: https://github.com/python/pythondotorg
1818
* Issue tracker: https://github.com/python/pythondotorg/issues
19-
* Documentation: https://pythondotorg.readthedocs.org/
19+
* Documentation: https://pythondotorg.readthedocs.io/
2020
* Mailing list: [pydotorg-www](https://mail.python.org/mailman/listinfo/pydotorg-www)
2121
* IRC: `#pydotorg` on Freenode
2222
* Staging site: https://staging.python.org/ (`main` branch)

banners/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
default_app_config = 'banners.apps.BannersAppConfig'

base-requirements.txt

+27-21
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,56 @@
11
dj-database-url==0.5.0
2-
django-pipeline==2.0.6
3-
django-sitetree==1.17.0
4-
Django==2.2.24
2+
django-pipeline==3.0.0 # 3.0.0 is first version that supports Django 4.2
3+
django-sitetree==1.18.0 # >=1.17.1 is (?) first version that supports Django 4.2
4+
django-apptemplates==1.5
5+
django-admin-interface==0.24.2
6+
django-translation-aliases==0.1.0
7+
Django==4.2.16
58
docutils==0.12
69
Markdown==3.3.4
710
cmarkgfm==0.6.0
8-
Pillow==8.3.1
9-
psycopg2==2.8.6
11+
Pillow==9.4.0
12+
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==5.2.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.
20-
django-imagekit==4.0.2
21-
django-haystack==3.0
22-
elasticsearch>=5,<6
25+
django-imagekit==5.0 # 5.0 is first version that supports Django 4.2
26+
django-haystack==3.2.1
27+
elasticsearch>=7,<8
2328
# TODO: 0.14.0 only supports Django 1.8 and 1.11.
24-
django-tastypie==0.14.3
29+
django-tastypie==0.14.6 # 0.14.6 is first version that supports Django 4.2
2530

2631
pytz==2021.1
2732
python-dateutil==2.8.2
2833

2934
requests[security]>=2.26.0
3035

31-
django-honeypot==1.0.1
32-
django-markupfield==2.0.0
33-
django-markupfield-helpers==0.1.1
36+
django-honeypot==1.0.4 # 1.0.4 is first version that supports Django 4.2
37+
django-markupfield==2.0.1
3438

35-
django-allauth==0.41.0
39+
django-allauth==0.57.2 # 0.55.0 is first version that supports Django 4.2
3640

3741
django-waffle==2.2.1
3842

39-
djangorestframework==3.12.2
43+
djangorestframework==3.14.0 # 3.14.0 is first version that supports Django 4.1, 4.2 support hasnt been "released"
4044
django-filter==2.4.0
4145
django-ordered-model==3.4.3
4246
django-widget-tweaks==1.4.8
4347
django-countries==7.2.1
44-
xhtml2pdf==0.2.5
45-
django-easy-pdf3==0.1.2
4648
num2words==0.5.10
47-
django-polymorphic==3.0.0
49+
django-polymorphic==3.1.0 # 3.1.0 is first version that supports Django 4.0, unsure if it fully supports 4.2
4850
sorl-thumbnail==12.7.0
49-
docxtpl==0.12.0
50-
reportlab==3.6.6
51+
django-extensions==3.1.4
52+
django-import-export==2.7.1
53+
54+
pypandoc==1.12
55+
panflute==2.3.0
56+
Unidecode==1.3.8

0 commit comments

Comments
 (0)