Skip to content

Commit f764757

Browse files
authored
Merge branch 'main' into dependabot/pip/factory-boy-3.2.0
2 parents ed0cee3 + d94b133 commit f764757

File tree

487 files changed

+87185
-16343
lines changed

Some content is hidden

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

487 files changed

+87185
-16343
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

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
ignore:
9+
- dependency-name: docutils
10+
versions:
11+
- "0.16"
12+
- "0.17"
13+
- dependency-name: responses
14+
versions:
15+
- 0.12.1
16+
- 0.13.0
17+
- 0.13.1
18+
- 0.13.2
19+
- dependency-name: lxml
20+
versions:
21+
- 4.6.2

.github/workflows/ci.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
services:
7+
postgres:
8+
image: postgres:10.1
9+
env:
10+
POSTGRES_USER: postgres
11+
POSTGRES_PASSWORD: postgres
12+
POSTGRES_DB: pythonorg
13+
ports:
14+
- 5432:5432
15+
# needed because the postgres container does not provide a healthcheck
16+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
17+
steps:
18+
- name: Check out repository
19+
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
32+
- uses: actions/setup-python@v2
33+
with:
34+
python-version: 3.9.16
35+
- name: Cache Python dependencies
36+
uses: actions/cache@v2
37+
env:
38+
cache-name: pythondotorg-cache-pip
39+
with:
40+
path: ~/.cache/pip
41+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', '*-requirements.txt') }}
42+
restore-keys: |
43+
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
44+
${{ runner.os }}-${{ github.job }}-
45+
${{ runner.os }}-
46+
- name: Install Python dependencies
47+
run: |
48+
pip install -U pip setuptools wheel
49+
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
55+
- name: Run Tests
56+
run: |
57+
python -Wd -m coverage run manage.py test -v2
58+
env:
59+
DATABASE_URL: postgres://postgres:postgres@localhost:5432/pythonorg
60+
- name: Coverage
61+
run: |
62+
coverage report -m --fail-under=75

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,20 @@
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
1617
static/stylesheets/no-mq.css
1718
static/stylesheets/style.css
1819
__pycache__
1920
*.db
21+
*.py[co]
22+
.vscode
23+
.~lock.*
24+
.idea
25+
.coverage
26+
.env
27+
.DS_Store
28+
.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

.travis.yml

-22
This file was deleted.

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,16 +1,16 @@
11
# python.org
22

3-
[![Build Status](https://travis-ci.org/python/pythondotorg.svg?branch=master)](https://travis-ci.org/python/pythondotorg)
3+
[![Build Status](https://travis-ci.org/python/pythondotorg.svg?branch=main)](https://travis-ci.org/python/pythondotorg)
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

@@ -19,5 +19,5 @@ https://bugs.python.org.
1919
* Documentation: https://pythondotorg.readthedocs.org/
2020
* Mailing list: [pydotorg-www](https://mail.python.org/mailman/listinfo/pydotorg-www)
2121
* IRC: `#pydotorg` on Freenode
22-
* Staging site: https://staging.python.org/ (`master` branch)
22+
* Staging site: https://staging.python.org/ (`main` branch)
2323
* License: Apache License

Vagrantfile

-21
This file was deleted.

banners/__init__.py

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

banners/apps.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from django.apps import AppConfig
2+
3+
4+
class BannersAppConfig(AppConfig):
5+
6+
name = 'banners'

0 commit comments

Comments
 (0)