Skip to content

Commit

Permalink
Merge branch 'main' into add-latest-link
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobCoffee authored Sep 19, 2024
2 parents 9983627 + dc57cd2 commit 31e6f83
Show file tree
Hide file tree
Showing 14 changed files with 318 additions and 77 deletions.
119 changes: 119 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: "Bug Report"
description: Report a bug with pyton.org website to help us improve
title: "Bug: <title>"
labels: ["bug", "Triage Required"]

body:
- type: markdown
attributes:
value: |
This is the repository and issue tracker for the https://www.pyton.org website.
If you're looking to file an issue with CPython itself, please click here: [CPython Issues](https://github.com/python/cpython/issues/new/choose).
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).
- type: textarea
id: description
attributes:
label: "Describe the bug"
description: A clear and concise description of what the bug is.
validations:
required: true

- type: textarea
id: reproduction
attributes:
label: "To Reproduce"
description: Steps to reproduce the behavior
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true

- type: textarea
id: expected
attributes:
label: "Expected behavior"
description: A clear and concise description of what you expected to happen.
validations:
required: true

- type: input
id: reprod-url
attributes:
label: "URL to the issue"
description: Please enter the URL to provide a reproduction of the issue, if applicable
placeholder: ex. https://python.org/my-issue/here
validations:
required: false

- type: textarea
id: screenshot
attributes:
label: "Screenshots"
description: If applicable, add screenshots to help explain your problem.
value: |
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
render: bash
validations:
required: false

- type: dropdown
id: browsers
attributes:
label: "Browsers"
description: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- Other
validations:
required: true

- type: dropdown
id: os
attributes:
label: "Operating System"
description: What operating system are you using?
options:
- Windows
- macOS
- Linux
- iOS
- Android
- Other
validations:
required: true

- type: input
id: version
attributes:
label: "Browser Version"
description: What version of the browser are you using?
placeholder: "e.g. 22"
validations:
required: false

- type: textarea
id: logs
attributes:
label: "Relevant log output"
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: false

- type: textarea
id: additional
attributes:
label: "Additional context"
description: Add any other context about the problem here.
validations:
required: false
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/DOCS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Documentation Update"
description: Create an issue for documentation changes
title: "Docs: <title>"
labels: ["documentation"]

body:
- type: markdown
attributes:
value: |
This is the repository and issue tracker for the https://www.pyton.org website.
If you're looking to file an issue with CPython itself, please click here: [CPython Issues](https://github.com/python/cpython/issues/new/choose).
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).
- type: textarea
id: summary
attributes:
label: "Summary"
description: Provide a brief summary of your request
placeholder: We need to update the documentation to include information about...
validations:
required: true
66 changes: 66 additions & 0 deletions .github/ISSUE_TEMPLATE/REQUEST.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "Feature Request"
description: Suggest an idea for www.pyton.org
title: "Enhancement: <title>"
labels: ["enhancement"]

body:
- type: markdown
attributes:
value: |
This is the repository and issue tracker for the https://www.pyton.org website.
If you're looking to file an issue with CPython itself, please click here: [CPython Issues](https://github.com/python/cpython/issues/new/choose).
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).
- type: textarea
id: problem
attributes:
label: "Is your feature request related to a problem? Please describe."
description: A clear and concise description of what the problem is.
placeholder: Ex. I'm always frustrated when [...]
validations:
required: true

- type: textarea
id: solution
attributes:
label: "Describe the solution you'd like"
description: A clear and concise description of what you want to happen.
placeholder: Ex. It would be great if [...]
validations:
required: true

- type: textarea
id: basic_example
attributes:
label: "Basic Example"
description: Provide some basic examples of your feature request.
placeholder: Describe how your feature would work with a simple example.
validations:
required: false

- type: textarea
id: alternatives
attributes:
label: "Describe alternatives you've considered"
description: A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false

- type: textarea
id: drawbacks
attributes:
label: "Drawbacks and Impact"
description: What are the drawbacks or impacts of your feature request?
placeholder: Describe any potential drawbacks or impacts of implementing this feature.
validations:
required: false

- type: textarea
id: additional_context
attributes:
label: "Additional context"
description: Add any other context or screenshots about the feature request here.
validations:
required: false
45 changes: 0 additions & 45 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
blank_issues_enabled: false
contact_links:
- name: CPython Documentation
url: https://docs.python.org/
about: Official CPython documentation - please check here before opening an issue.
- name: Python Website
url: https://python.org/
about: For all things Python
- name: PyPI Issues / Support
url: https://github.com/pypi/support
about: For issues with PyPI itself, PyPI accounts, or with packages hosted on PyPI.
- name: CPython Issues
url: https://github.com/python/cpython/issues
about: For issues with the CPython interpreter itself.
27 changes: 0 additions & 27 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

6 changes: 3 additions & 3 deletions base-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ feedparser==6.0.11
beautifulsoup4==4.12.3
icalendar==4.0.7
chardet==4.0.0
celery[redis]==5.3.6
celery[redis]==5.4.0
django-celery-beat==2.5.0
# TODO: We may drop 'django-imagekit' completely.
django-imagekit==5.0 # 5.0 is first version that supports Django 4.2
Expand All @@ -42,10 +42,10 @@ 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-ordered-model==3.7.4
django-widget-tweaks==1.5.0
django-countries==7.2.1
num2words==0.5.10
num2words==0.5.13
django-polymorphic==3.1.0 # 3.1.0 is first version that supports Django 4.0, unsure if it fully supports 4.2
sorl-thumbnail==12.7.0
django-extensions==3.1.4
Expand Down
1 change: 1 addition & 0 deletions downloads/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def purge_fastly_download_pages(sender, instance, **kwargs):
if instance.is_published:
# Purge our common pages
purge_url('/downloads/')
purge_url('/downloads/feed.rss')
purge_url('/downloads/latest/python2/')
purge_url('/downloads/latest/python3/')
purge_url('/downloads/macos/')
Expand Down
42 changes: 42 additions & 0 deletions downloads/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,3 +554,45 @@ def test_filter_release_file_delete_by_release(self):
headers={"authorization": self.Authorization}
)
self.assertEqual(response.status_code, 405)

class ReleaseFeedTests(BaseDownloadTests):
"""Tests for the downloads/feed.rss endpoint.
Content is ensured via setUp in BaseDownloadTests.
"""

url = reverse("downloads:feed")


def test_endpoint_reachable(self) -> None:
response = self.client.get(self.url)
self.assertEqual(response.status_code, 200)

def test_feed_content(self) -> None:
"""Ensure feed content is as expected.
Some things we want to check:
- Feed title, description, pubdate
- Feed items (releases) are in the correct order
- We get the expected number of releases (10)
"""
response = self.client.get(self.url)
content = response.content.decode()

self.assertIn("Python 2.7.5", content)
self.assertIn("Python 3.10", content)
# Published but hidden show up in the API and thus the feed
self.assertIn("Python 0.0.0", content)

# No unpublished releases
self.assertNotIn("Python 9.7.2", content)

# Pre-releases are shown
self.assertIn("Python 3.9.90", content)

def test_feed_item_count(self) -> None:
response = self.client.get(self.url)
content = response.content.decode()

# In BaseDownloadTests, we create 5 releases, 4 of which are published, 1 of those published are hidden..
self.assertEqual(content.count("<item>"), 4)
1 change: 1 addition & 0 deletions downloads/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
path('release/<slug:release_slug>/', views.DownloadReleaseDetail.as_view(), name='download_release_detail'),
path('<slug:slug>/', views.DownloadOSList.as_view(), name='download_os_list'),
path('', views.DownloadHome.as_view(), name='download'),
path("feed.rss", views.ReleaseFeed(), name="feed"),
]
Loading

0 comments on commit 31e6f83

Please sign in to comment.