Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
ewdurbin committed Sep 16, 2024
2 parents 4857d9b + 7eac335 commit 6773814
Show file tree
Hide file tree
Showing 41 changed files with 118 additions and 2,491 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Notify @EWDurbin for all opened Issues and Pull Requests
* @EWDurbin @JacobCoffee
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--
By submitting this pull request, you agree to:
- follow the [PSF's Code of Conduct](https://www.python.org/psf/conduct/)
-->
#### Description

-

<!--
If applicable, please add in issue numbers this pull request will close, if applicable
Examples: Fixes #4321 or Closes #1234
Ensure you are using a supported keyword to properly link an issue:
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
-->
#### Closes

-

2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
sudo dpkg -i pandoc-2.17.1.1-1-amd64.deb
- uses: actions/setup-python@v5
with:
python-version: 3.12.6
python-version-file: '.python-version'
- name: Cache Python dependencies
uses: actions/cache@v4
env:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check collectstatic
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version-file: '.python-version'
- name: Cache Python dependencies
uses: actions/cache@v4
env:
cache-name: pythondotorg-cache-pip
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', '*-requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
${{ runner.os }}-${{ github.job }}-
${{ runner.os }}-
- name: Install Python dependencies
run: |
pip install -U pip setuptools wheel
pip install -r requirements.txt -r prod-requirements.txt
- name: Run Tests
run: |
DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-bookworm
FROM python:3.12.6-bookworm
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.cabotage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-bookworm
FROM python:3.12.6-bookworm
COPY --from=ewdurbin/nginx-static:1.25.x /usr/bin/nginx /usr/bin/nginx
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ default:

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

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

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

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

serve: .state/db-initialized
docker-compose up --remove-orphans
docker compose up --remove-orphans

migrations: .state/db-initialized
# Run Django makemigrations
docker-compose run --rm web ./manage.py makemigrations
docker compose run --rm web ./manage.py makemigrations

migrate: .state/docker-build-web
# Run Django migrate
docker-compose run --rm web ./manage.py migrate
docker compose run --rm web ./manage.py migrate

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

shell: .state/db-initialized
docker-compose run --rm web ./manage.py shell
docker compose run --rm web ./manage.py shell

clean:
docker-compose down -v
docker compose down -v
rm -f .state/docker-build-web .state/db-initialized .state/db-migrated

test: .state/db-initialized
docker-compose run --rm web ./manage.py test
docker compose run --rm web ./manage.py test

docker_shell: .state/db-initialized
docker-compose run --rm web /bin/bash
docker compose run --rm web /bin/bash
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@

### General information

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

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

Expand All @@ -19,5 +21,4 @@ https://github.com/python/cpython/issues/.
* Documentation: https://pythondotorg.readthedocs.io/
* Mailing list: [pydotorg-www](https://mail.python.org/mailman/listinfo/pydotorg-www)
* IRC: `#pydotorg` on Freenode
* Staging site: https://staging.python.org/ (`main` branch)
* License: Apache License
6 changes: 3 additions & 3 deletions base-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ python-decouple==3.4
# lxml used by BeautifulSoup.
lxml==5.2.2
cssselect==1.1.0
feedparser==6.0.8
beautifulsoup4==4.11.2
feedparser==6.0.11
beautifulsoup4==4.12.3
icalendar==4.0.7
chardet==4.0.0
celery[redis]==5.3.6
Expand All @@ -43,7 +43,7 @@ django-waffle==2.2.1
djangorestframework==3.14.0 # 3.14.0 is first version that supports Django 4.1, 4.2 support hasnt been "released"
django-filter==2.4.0
django-ordered-model==3.4.3
django-widget-tweaks==1.4.8
django-widget-tweaks==1.5.0
django-countries==7.2.1
num2words==0.5.10
django-polymorphic==3.1.0 # 3.1.0 is first version that supports Django 4.0, unsure if it fully supports 4.2
Expand Down
3 changes: 1 addition & 2 deletions downloads/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
from django.urls import reverse
from django.test import TestCase, override_settings

from rest_framework.authtoken.models import Token
from rest_framework.test import APITestCase

from .base import BaseDownloadTests, DownloadMixin
from ..models import OS, Release
from ..models import Release
from pages.factories import PageFactory
from pydotorg.drf import BaseAPITestCase
from users.factories import UserFactory
Expand Down
8 changes: 7 additions & 1 deletion events/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ def import_occurrence(self, event, event_data):
# but won't add any timezone information. We will convert them to
# aware datetime objects manually.
dt_start = extract_date_or_datetime(event_data['DTSTART'].dt)
dt_end = extract_date_or_datetime(event_data['DTEND'].dt)
if 'DTEND' in event_data:
# DTEND is not always set on events, in particular it seems that
# events which have the same start and end time, don't provide
# DTEND. See #2021.
dt_end = extract_date_or_datetime(event_data['DTEND'].dt)
else:
dt_end = dt_start

# Let's mark those occurrences as 'all-day'.
all_day = (
Expand Down
6 changes: 3 additions & 3 deletions events/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class OccurringRule(RuleMixin, models.Model):

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

@property
def begin(self):
Expand Down Expand Up @@ -283,8 +283,8 @@ class RecurringRule(RuleMixin, models.Model):
all_day = models.BooleanField(default=False)

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

def to_rrule(self):
return rrule(
Expand Down
4 changes: 2 additions & 2 deletions fixtures/boxes.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@
"created": "2014-02-13T17:37:50.862Z",
"updated": "2014-02-16T23:01:04.762Z",
"label": "widget-weneedyou",
"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>",
"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>",
"content_markup_type": "html",
"_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>"
"_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>"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.2.16 on 2024-09-13 17:30

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('jobs', '0021_alter_job_creator_alter_job_last_modified_by_and_more'),
]

operations = [
migrations.AlterModelOptions(
name='jobtype',
options={'ordering': ('name',), 'verbose_name': 'job types', 'verbose_name_plural': 'job types'},
),
migrations.AlterField(
model_name='job',
name='job_types',
field=models.ManyToManyField(blank=True, limit_choices_to={'active': True}, related_name='jobs', to='jobs.jobtype', verbose_name='Job types'),
),
migrations.AlterField(
model_name='job',
name='other_job_type',
field=models.CharField(blank=True, max_length=100, verbose_name='Other job types'),
),
]
8 changes: 4 additions & 4 deletions jobs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class JobType(NameSlugModel):
objects = JobTypeQuerySet.as_manager()

class Meta:
verbose_name = 'job technologies'
verbose_name_plural = 'job technologies'
verbose_name = 'job types'
verbose_name_plural = 'job types'
ordering = ('name', )


Expand Down Expand Up @@ -59,11 +59,11 @@ class Job(ContentManageable):
JobType,
related_name='jobs',
blank=True,
verbose_name='Job technologies',
verbose_name='Job types',
limit_choices_to={'active': True},
)
other_job_type = models.CharField(
verbose_name='Other job technologies',
verbose_name='Other job types',
max_length=100,
blank=True,
)
Expand Down
Empty file removed peps/__init__.py
Empty file.
6 changes: 0 additions & 6 deletions peps/apps.py

This file was deleted.

Loading

0 comments on commit 6773814

Please sign in to comment.