Skip to content

Commit 45df4f5

Browse files
authored
Merge branch 'main' into dependabot/pip/factory-boy-3.3.1
2 parents 3901ee9 + 6b4c681 commit 45df4f5

Some content is hidden

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

55 files changed

+370
-2520
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Notify @EWDurbin for all opened Issues and Pull Requests
2+
* @EWDurbin @JacobCoffee

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!--
2+
By submitting this pull request, you agree to:
3+
- follow the [PSF's Code of Conduct](https://www.python.org/psf/conduct/)
4+
-->
5+
#### Description
6+
7+
-
8+
9+
<!--
10+
If applicable, please add in issue numbers this pull request will close, if applicable
11+
Examples: Fixes #4321 or Closes #1234
12+
13+
Ensure you are using a supported keyword to properly link an issue:
14+
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
15+
-->
16+
#### Closes
17+
18+
-
19+

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
sudo dpkg -i pandoc-2.17.1.1-1-amd64.deb
3232
- uses: actions/setup-python@v5
3333
with:
34-
python-version: 3.9.16
34+
python-version-file: '.python-version'
3535
- name: Cache Python dependencies
3636
uses: actions/cache@v4
3737
env:

.github/workflows/static.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check collectstatic
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Check out repository
8+
uses: actions/checkout@v4
9+
- uses: actions/setup-python@v5
10+
with:
11+
python-version-file: '.python-version'
12+
- name: Cache Python dependencies
13+
uses: actions/cache@v4
14+
env:
15+
cache-name: pythondotorg-cache-pip
16+
with:
17+
path: ~/.cache/pip
18+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', '*-requirements.txt') }}
19+
restore-keys: |
20+
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
21+
${{ runner.os }}-${{ github.job }}-
22+
${{ runner.os }}-
23+
- name: Install Python dependencies
24+
run: |
25+
pip install -U pip setuptools wheel
26+
pip install -r requirements.txt -r prod-requirements.txt
27+
- name: Run Tests
28+
run: |
29+
DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.9.16
1+
3.12.6

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-bookworm
1+
FROM python:3.12.6-bookworm
22
ENV PYTHONUNBUFFERED=1
33
ENV PYTHONDONTWRITEBYTECODE=1
44

Dockerfile.cabotage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9-bullseye
1+
FROM python:3.12.6-bookworm
22
COPY --from=ewdurbin/nginx-static:1.25.x /usr/bin/nginx /usr/bin/nginx
33
ENV PYTHONUNBUFFERED=1
44
ENV PYTHONDONTWRITEBYTECODE=1

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ default:
44
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null\
55
| awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}'\
66
| sort\
7-
| egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
7+
| grep -E -v -e '^[^[:alnum:]]' -e '^$@$$'
88
@echo
99
@exit 1
1010

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

1515
# Mark the state so we don't rebuild this needlessly.
1616
mkdir -p .state && touch .state/docker-build-web
@@ -24,35 +24,35 @@ default:
2424

2525
.state/db-initialized: .state/docker-build-web .state/db-migrated
2626
# Load all fixtures
27-
docker-compose run --rm web ./manage.py loaddata fixtures/*.json
27+
docker compose run --rm web ./manage.py loaddata fixtures/*.json
2828

2929
# Mark the state so we don't rebuild this needlessly.
3030
mkdir -p .state && touch .state/db-initialized
3131

3232
serve: .state/db-initialized
33-
docker-compose up --remove-orphans
33+
docker compose up --remove-orphans
3434

3535
migrations: .state/db-initialized
3636
# Run Django makemigrations
37-
docker-compose run --rm web ./manage.py makemigrations
37+
docker compose run --rm web ./manage.py makemigrations
3838

3939
migrate: .state/docker-build-web
4040
# Run Django migrate
41-
docker-compose run --rm web ./manage.py migrate
41+
docker compose run --rm web ./manage.py migrate
4242

4343
manage: .state/db-initialized
4444
# Run Django manage to accept arbitrary arguments
45-
docker-compose run --rm web ./manage.py $(filter-out $@,$(MAKECMDGOALS))
45+
docker compose run --rm web ./manage.py $(filter-out $@,$(MAKECMDGOALS))
4646

4747
shell: .state/db-initialized
48-
docker-compose run --rm web ./manage.py shell
48+
docker compose run --rm web ./manage.py shell
4949

5050
clean:
51-
docker-compose down -v
51+
docker compose down -v
5252
rm -f .state/docker-build-web .state/db-initialized .state/db-migrated
5353

5454
test: .state/db-initialized
55-
docker-compose run --rm web ./manage.py test
55+
docker compose run --rm web ./manage.py test
5656

5757
docker_shell: .state/db-initialized
58-
docker-compose run --rm web /bin/bash
58+
docker compose run --rm web /bin/bash

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55

66
### General information
77

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

12-
Issues related to [Python's documentation](https://docs.python.org) can be filed in
13-
https://github.com/python/cpython/issues/.
10+
> [!NOTE]
11+
> The repository for CPython itself is at https://github.com/python/cpython, and the
12+
> issue tracker is at https://github.com/python/cpython/issues/.
13+
>
14+
> Similarly, issues related to [Python's documentation](https://docs.python.org) can be filed in
15+
> https://github.com/python/cpython/issues/.
1416
1517
### Contributing
1618

@@ -19,5 +21,4 @@ https://github.com/python/cpython/issues/.
1921
* Documentation: https://pythondotorg.readthedocs.io/
2022
* Mailing list: [pydotorg-www](https://mail.python.org/mailman/listinfo/pydotorg-www)
2123
* IRC: `#pydotorg` on Freenode
22-
* Staging site: https://staging.python.org/ (`main` branch)
2324
* License: Apache License

base-requirements.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ django-apptemplates==1.5
55
django-admin-interface==0.24.2
66
django-translation-aliases==0.1.0
77
Django==4.2.16
8-
docutils==0.12
9-
Markdown==3.3.4
8+
docutils==0.21.2
9+
Markdown==3.7
1010
cmarkgfm==0.6.0
11-
Pillow==9.4.0
12-
psycopg2-binary==2.8.6
11+
Pillow==10.4.0
12+
psycopg2-binary==2.9.9
1313
python3-openid==3.2.0
1414
python-decouple==3.4
1515
# lxml used by BeautifulSoup.
1616
lxml==5.2.2
1717
cssselect==1.1.0
18-
feedparser==6.0.8
19-
beautifulsoup4==4.11.2
18+
feedparser==6.0.11
19+
beautifulsoup4==4.12.3
2020
icalendar==4.0.7
2121
chardet==4.0.0
2222
celery[redis]==5.3.6
@@ -36,14 +36,14 @@ requests[security]>=2.26.0
3636
django-honeypot==1.0.4 # 1.0.4 is first version that supports Django 4.2
3737
django-markupfield==2.0.1
3838

39-
django-allauth==0.57.2 # 0.55.0 is first version that supports Django 4.2
39+
django-allauth==64.2.1
4040

4141
django-waffle==2.2.1
4242

4343
djangorestframework==3.14.0 # 3.14.0 is first version that supports Django 4.1, 4.2 support hasnt been "released"
4444
django-filter==2.4.0
45-
django-ordered-model==3.4.3
46-
django-widget-tweaks==1.4.8
45+
django-ordered-model==3.7.4
46+
django-widget-tweaks==1.5.0
4747
django-countries==7.2.1
4848
num2words==0.5.10
4949
django-polymorphic==3.1.0 # 3.1.0 is first version that supports Django 4.0, unsure if it fully supports 4.2
@@ -52,5 +52,5 @@ django-extensions==3.1.4
5252
django-import-export==2.7.1
5353

5454
pypandoc==1.12
55-
panflute==2.3.0
55+
panflute==2.3.1
5656
Unidecode==1.3.8

docs/source/administration.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Pages are individual entire pages of markup content. They are require ``Title``
4646
:Is Published: Controls whether or not the page is visible on the site.
4747
:Template Name: By default Pages use the template ``templates/pages/default.html`` to use a different template enter the template path here.
4848

49-
.. note:: Pages are automatically purge from Fastly.com upon save.
49+
.. note:: Pages are automatically purged from Fastly.com upon save.
5050

5151
.. _boxes:
5252

@@ -82,7 +82,7 @@ Release Files have a checkbox named 'Download button' that determines which bina
8282
Jobs
8383
----
8484

85-
The jobs application is using to display Python jobs on the site. The data items should be fairly self explanatory. There are a couple of things to keep in mind. Logged in users of the site can submit jobs for review.
85+
The jobs application is used to display Python jobs on the site. The data items should be fairly self explanatory. There are a couple of things to keep in mind. Logged in users of the site can submit jobs for review.
8686

8787
:Status: Jobs enter the system in 'review' status after the submitter has entered them. Only jobs in the 'approved' state are displayed on the site.
8888
:Featured: Featured jobs are displayed more prominently on the landing page.

downloads/tests/test_models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ def test_is_version_at_least(self):
8282

8383
release_38 = Release.objects.create(name='Python 3.8.0')
8484
self.assertFalse(release_38.is_version_at_least_3_9)
85-
self.assert_(release_38.is_version_at_least_3_5)
85+
self.assertTrue(release_38.is_version_at_least_3_5)
8686

8787
release_310 = Release.objects.create(name='Python 3.10.0')
88-
self.assert_(release_310.is_version_at_least_3_9)
89-
self.assert_(release_310.is_version_at_least_3_5)
88+
self.assertTrue(release_310.is_version_at_least_3_9)
89+
self.assertTrue(release_310.is_version_at_least_3_5)

downloads/tests/test_views.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
from django.urls import reverse
66
from django.test import TestCase, override_settings
77

8-
from rest_framework.authtoken.models import Token
98
from rest_framework.test import APITestCase
109

1110
from .base import BaseDownloadTests, DownloadMixin
12-
from ..models import OS, Release
11+
from ..models import Release
1312
from pages.factories import PageFactory
1413
from pydotorg.drf import BaseAPITestCase
1514
from users.factories import UserFactory

events/importer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ def import_occurrence(self, event, event_data):
2222
# but won't add any timezone information. We will convert them to
2323
# aware datetime objects manually.
2424
dt_start = extract_date_or_datetime(event_data['DTSTART'].dt)
25-
dt_end = extract_date_or_datetime(event_data['DTEND'].dt)
25+
if 'DTEND' in event_data:
26+
# DTEND is not always set on events, in particular it seems that
27+
# events which have the same start and end time, don't provide
28+
# DTEND. See #2021.
29+
dt_end = extract_date_or_datetime(event_data['DTEND'].dt)
30+
else:
31+
dt_end = dt_start
2632

2733
# Let's mark those occurrences as 'all-day'.
2834
all_day = (

events/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class OccurringRule(RuleMixin, models.Model):
237237

238238
def __str__(self):
239239
strftime = settings.SHORT_DATETIME_FORMAT
240-
return f'{self.event.title} {date(self.dt_start.strftime, strftime)} - {date(self.dt_end.strftime, strftime)}'
240+
return f'{self.event.title} {date(self.dt_start, strftime)} - {date(self.dt_end, strftime)}'
241241

242242
@property
243243
def begin(self):
@@ -283,8 +283,8 @@ class RecurringRule(RuleMixin, models.Model):
283283
all_day = models.BooleanField(default=False)
284284

285285
def __str__(self):
286-
strftime = settings.SHORT_DATETIME_FORMAT
287-
return f'{self.event.title} every {timedelta_nice_repr(self.interval)} since {date(self.dt_start.strftime, strftime)}'
286+
return (f'{self.event.title} every {timedelta_nice_repr(self.freq_interval_as_timedelta)} since '
287+
f'{date(self.dt_start, settings.SHORT_DATETIME_FORMAT)}')
288288

289289
def to_rrule(self):
290290
return rrule(

fixtures/boxes.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@
318318
"created": "2014-02-13T17:37:50.862Z",
319319
"updated": "2014-02-16T23:01:04.762Z",
320320
"label": "widget-weneedyou",
321-
"content": "<h2 class=\"widget-title\"><span class=\"prompt\">&gt;&gt;&gt;</span> <a href=\"#\">Python Needs You</a></h2>\r\n<p>Open source software is made better when users can easily contribute code and documentation to fix bugs and add features. Python strongly encourages community involvement in improving the software. <a href=\"//docs.python.org/devguide\">Learn more</a> about how to make Python better for everyone.</p>\r\n<p class=\"click-these\">\r\n <a class=\"button\" href=\"//docs.python.org/devguide/#contributing\">Contribute to Python</a>\r\n <a class=\"button\" href=\"//bugs.python.org\">Bug Tracker</a>\r\n</p>",
321+
"content": "<h2 class=\"widget-title\"><span class=\"prompt\">&gt;&gt;&gt;</span> <a href=\"#\">Python Needs You</a></h2>\r\n<p>Open source software is made better when users can easily contribute code and documentation to fix bugs and add features. Python strongly encourages community involvement in improving the software. <a href=\"//docs.python.org/devguide\">Learn more</a> about how to make Python better for everyone.</p>\r\n<p class=\"click-these\">\r\n <a class=\"button\" href=\"//docs.python.org/devguide/#contributing\">Contribute to Python</a>\r\n <a class=\"button\" href=\"//github.com/python/cpython/issues\">Bug Tracker</a>\r\n</p>",
322322
"content_markup_type": "html",
323-
"_content_rendered": "<h2 class=\"widget-title\"><span class=\"prompt\">&gt;&gt;&gt;</span> <a href=\"#\">Python Needs You</a></h2>\r\n<p>Open source software is made better when users can easily contribute code and documentation to fix bugs and add features. Python strongly encourages community involvement in improving the software. <a href=\"//docs.python.org/devguide\">Learn more</a> about how to make Python better for everyone.</p>\r\n<p class=\"click-these\">\r\n <a class=\"button\" href=\"//docs.python.org/devguide/#contributing\">Contribute to Python</a>\r\n <a class=\"button\" href=\"//bugs.python.org\">Bug Tracker</a>\r\n</p>"
323+
"_content_rendered": "<h2 class=\"widget-title\"><span class=\"prompt\">&gt;&gt;&gt;</span> <a href=\"#\">Python Needs You</a></h2>\r\n<p>Open source software is made better when users can easily contribute code and documentation to fix bugs and add features. Python strongly encourages community involvement in improving the software. <a href=\"//docs.python.org/devguide\">Learn more</a> about how to make Python better for everyone.</p>\r\n<p class=\"click-these\">\r\n <a class=\"button\" href=\"//docs.python.org/devguide/#contributing\">Contribute to Python</a>\r\n <a class=\"button\" href=\"//github.com/python/cpython/issues\">Bug Tracker</a>\r\n</p>"
324324
}
325325
},
326326
{

infra/.terraform.lock.hcl

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

infra/cdn/README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,29 @@ N/A
2929
## Requirements
3030

3131
Tested on
32-
- Tested on Terraform 1.8.5
33-
- Fastly provider 5.13.0
32+
- Tested on Terraform 1.9.5
33+
- Fastly provider 5.13.0
34+
35+
# Fastly's NGWAF
36+
37+
This module also conditionally can set up the Fastly Next-Gen Web Application Firewall (NGWAF)
38+
for our Fastly services related to python.org / test.python.org.
39+
40+
## Usage
41+
42+
```hcl
43+
module "fastly_production" {
44+
source = "./cdn"
45+
46+
...
47+
activate_ngwaf_service = true
48+
...
49+
}
50+
```
51+
52+
## Requirements
53+
54+
Tested on
55+
- Terraform 1.9.5
56+
- Fastly provider 5.13.0
57+
- SigSci provider 3.3.0

0 commit comments

Comments
 (0)