Skip to content

Commit 31e6f83

Browse files
authored
Merge branch 'main' into add-latest-link
2 parents 9983627 + dc57cd2 commit 31e6f83

File tree

14 files changed

+318
-77
lines changed

14 files changed

+318
-77
lines changed

.github/ISSUE_TEMPLATE/BUG.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: "Bug Report"
2+
description: Report a bug with pyton.org website to help us improve
3+
title: "Bug: <title>"
4+
labels: ["bug", "Triage Required"]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
This is the repository and issue tracker for the https://www.pyton.org website.
11+
12+
If you're looking to file an issue with CPython itself, please click here: [CPython Issues](https://github.com/python/cpython/issues/new/choose).
13+
14+
Issues related to [Python's documentation](https://docs.python.org) can also be filed [here](https://github.com/python/cpython/issues/new?assignees=&labels=docs&template=documentation.md).
15+
16+
- type: textarea
17+
id: description
18+
attributes:
19+
label: "Describe the bug"
20+
description: A clear and concise description of what the bug is.
21+
validations:
22+
required: true
23+
24+
- type: textarea
25+
id: reproduction
26+
attributes:
27+
label: "To Reproduce"
28+
description: Steps to reproduce the behavior
29+
placeholder: |
30+
1. Go to '...'
31+
2. Click on '....'
32+
3. Scroll down to '....'
33+
4. See error
34+
validations:
35+
required: true
36+
37+
- type: textarea
38+
id: expected
39+
attributes:
40+
label: "Expected behavior"
41+
description: A clear and concise description of what you expected to happen.
42+
validations:
43+
required: true
44+
45+
- type: input
46+
id: reprod-url
47+
attributes:
48+
label: "URL to the issue"
49+
description: Please enter the URL to provide a reproduction of the issue, if applicable
50+
placeholder: ex. https://python.org/my-issue/here
51+
validations:
52+
required: false
53+
54+
- type: textarea
55+
id: screenshot
56+
attributes:
57+
label: "Screenshots"
58+
description: If applicable, add screenshots to help explain your problem.
59+
value: |
60+
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
61+
render: bash
62+
validations:
63+
required: false
64+
65+
- type: dropdown
66+
id: browsers
67+
attributes:
68+
label: "Browsers"
69+
description: What browsers are you seeing the problem on?
70+
multiple: true
71+
options:
72+
- Firefox
73+
- Chrome
74+
- Safari
75+
- Microsoft Edge
76+
- Other
77+
validations:
78+
required: true
79+
80+
- type: dropdown
81+
id: os
82+
attributes:
83+
label: "Operating System"
84+
description: What operating system are you using?
85+
options:
86+
- Windows
87+
- macOS
88+
- Linux
89+
- iOS
90+
- Android
91+
- Other
92+
validations:
93+
required: true
94+
95+
- type: input
96+
id: version
97+
attributes:
98+
label: "Browser Version"
99+
description: What version of the browser are you using?
100+
placeholder: "e.g. 22"
101+
validations:
102+
required: false
103+
104+
- type: textarea
105+
id: logs
106+
attributes:
107+
label: "Relevant log output"
108+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
109+
render: shell
110+
validations:
111+
required: false
112+
113+
- type: textarea
114+
id: additional
115+
attributes:
116+
label: "Additional context"
117+
description: Add any other context about the problem here.
118+
validations:
119+
required: false

.github/ISSUE_TEMPLATE/DOCS.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Documentation Update"
2+
description: Create an issue for documentation changes
3+
title: "Docs: <title>"
4+
labels: ["documentation"]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
This is the repository and issue tracker for the https://www.pyton.org website.
11+
12+
If you're looking to file an issue with CPython itself, please click here: [CPython Issues](https://github.com/python/cpython/issues/new/choose).
13+
14+
Issues related to [Python's documentation](https://docs.python.org) can also be filed [here](https://github.com/python/cpython/issues/new?assignees=&labels=docs&template=documentation.md).
15+
16+
- type: textarea
17+
id: summary
18+
attributes:
19+
label: "Summary"
20+
description: Provide a brief summary of your request
21+
placeholder: We need to update the documentation to include information about...
22+
validations:
23+
required: true

.github/ISSUE_TEMPLATE/REQUEST.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: "Feature Request"
2+
description: Suggest an idea for www.pyton.org
3+
title: "Enhancement: <title>"
4+
labels: ["enhancement"]
5+
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
This is the repository and issue tracker for the https://www.pyton.org website.
11+
12+
If you're looking to file an issue with CPython itself, please click here: [CPython Issues](https://github.com/python/cpython/issues/new/choose).
13+
14+
Issues related to [Python's documentation](https://docs.python.org) can also be filed [here](https://github.com/python/cpython/issues/new?assignees=&labels=docs&template=documentation.md).
15+
16+
- type: textarea
17+
id: problem
18+
attributes:
19+
label: "Is your feature request related to a problem? Please describe."
20+
description: A clear and concise description of what the problem is.
21+
placeholder: Ex. I'm always frustrated when [...]
22+
validations:
23+
required: true
24+
25+
- type: textarea
26+
id: solution
27+
attributes:
28+
label: "Describe the solution you'd like"
29+
description: A clear and concise description of what you want to happen.
30+
placeholder: Ex. It would be great if [...]
31+
validations:
32+
required: true
33+
34+
- type: textarea
35+
id: basic_example
36+
attributes:
37+
label: "Basic Example"
38+
description: Provide some basic examples of your feature request.
39+
placeholder: Describe how your feature would work with a simple example.
40+
validations:
41+
required: false
42+
43+
- type: textarea
44+
id: alternatives
45+
attributes:
46+
label: "Describe alternatives you've considered"
47+
description: A clear and concise description of any alternative solutions or features you've considered.
48+
validations:
49+
required: false
50+
51+
- type: textarea
52+
id: drawbacks
53+
attributes:
54+
label: "Drawbacks and Impact"
55+
description: What are the drawbacks or impacts of your feature request?
56+
placeholder: Describe any potential drawbacks or impacts of implementing this feature.
57+
validations:
58+
required: false
59+
60+
- type: textarea
61+
id: additional_context
62+
attributes:
63+
label: "Additional context"
64+
description: Add any other context or screenshots about the feature request here.
65+
validations:
66+
required: false

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: CPython Documentation
4+
url: https://docs.python.org/
5+
about: Official CPython documentation - please check here before opening an issue.
6+
- name: Python Website
7+
url: https://python.org/
8+
about: For all things Python
9+
- name: PyPI Issues / Support
10+
url: https://github.com/pypi/support
11+
about: For issues with PyPI itself, PyPI accounts, or with packages hosted on PyPI.
12+
- name: CPython Issues
13+
url: https://github.com/python/cpython/issues
14+
about: For issues with the CPython interpreter itself.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

base-requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ feedparser==6.0.11
1919
beautifulsoup4==4.12.3
2020
icalendar==4.0.7
2121
chardet==4.0.0
22-
celery[redis]==5.3.6
22+
celery[redis]==5.4.0
2323
django-celery-beat==2.5.0
2424
# TODO: We may drop 'django-imagekit' completely.
2525
django-imagekit==5.0 # 5.0 is first version that supports Django 4.2
@@ -42,10 +42,10 @@ 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
45+
django-ordered-model==3.7.4
4646
django-widget-tweaks==1.5.0
4747
django-countries==7.2.1
48-
num2words==0.5.10
48+
num2words==0.5.13
4949
django-polymorphic==3.1.0 # 3.1.0 is first version that supports Django 4.0, unsure if it fully supports 4.2
5050
sorl-thumbnail==12.7.0
5151
django-extensions==3.1.4

downloads/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ def purge_fastly_download_pages(sender, instance, **kwargs):
272272
if instance.is_published:
273273
# Purge our common pages
274274
purge_url('/downloads/')
275+
purge_url('/downloads/feed.rss')
275276
purge_url('/downloads/latest/python2/')
276277
purge_url('/downloads/latest/python3/')
277278
purge_url('/downloads/macos/')

downloads/tests/test_views.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,3 +554,45 @@ def test_filter_release_file_delete_by_release(self):
554554
headers={"authorization": self.Authorization}
555555
)
556556
self.assertEqual(response.status_code, 405)
557+
558+
class ReleaseFeedTests(BaseDownloadTests):
559+
"""Tests for the downloads/feed.rss endpoint.
560+
561+
Content is ensured via setUp in BaseDownloadTests.
562+
"""
563+
564+
url = reverse("downloads:feed")
565+
566+
567+
def test_endpoint_reachable(self) -> None:
568+
response = self.client.get(self.url)
569+
self.assertEqual(response.status_code, 200)
570+
571+
def test_feed_content(self) -> None:
572+
"""Ensure feed content is as expected.
573+
574+
Some things we want to check:
575+
- Feed title, description, pubdate
576+
- Feed items (releases) are in the correct order
577+
- We get the expected number of releases (10)
578+
"""
579+
response = self.client.get(self.url)
580+
content = response.content.decode()
581+
582+
self.assertIn("Python 2.7.5", content)
583+
self.assertIn("Python 3.10", content)
584+
# Published but hidden show up in the API and thus the feed
585+
self.assertIn("Python 0.0.0", content)
586+
587+
# No unpublished releases
588+
self.assertNotIn("Python 9.7.2", content)
589+
590+
# Pre-releases are shown
591+
self.assertIn("Python 3.9.90", content)
592+
593+
def test_feed_item_count(self) -> None:
594+
response = self.client.get(self.url)
595+
content = response.content.decode()
596+
597+
# In BaseDownloadTests, we create 5 releases, 4 of which are published, 1 of those published are hidden..
598+
self.assertEqual(content.count("<item>"), 4)

downloads/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
path('release/<slug:release_slug>/', views.DownloadReleaseDetail.as_view(), name='download_release_detail'),
1111
path('<slug:slug>/', views.DownloadOSList.as_view(), name='download_os_list'),
1212
path('', views.DownloadHome.as_view(), name='download'),
13+
path("feed.rss", views.ReleaseFeed(), name="feed"),
1314
]

0 commit comments

Comments
 (0)