Skip to content

Commit 005a4dc

Browse files
authored
Merge branch 'main' into feat/translation-graph-render
2 parents 81f7cb0 + c487789 commit 005a4dc

15 files changed

+56
-23
lines changed

.all-contributorsrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,16 @@
905905
"contributions": [
906906
"code"
907907
]
908+
},
909+
{
910+
"login": "chendaniely",
911+
"name": "Daniel Chen",
912+
"avatar_url": "https://avatars.githubusercontent.com/u/5782147?v=4",
913+
"profile": "http://chendaniely.github.io",
914+
"contributions": [
915+
"ideas",
916+
"review"
917+
]
908918
}
909919
],
910920
"contributorsPerLine": 7,

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ jobs:
55
- image: cimg/python:3.13
66
steps:
77
- checkout
8+
- run:
9+
name: Restore mtimes from git history
10+
command: |
11+
sudo apt-get update
12+
sudo apt-get install git-restore-mtime
13+
git restore-mtime
814
- run:
915
name: setup environment
1016
command: |

.github/workflows/build-book.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ jobs:
1616
runs-on: ubuntu-latest
1717
steps:
1818
- uses: actions/checkout@v4
19+
with:
20+
fetch_depth: 0
21+
22+
- name: Restore mtimes from git history
23+
run: |
24+
sudo apt-get install git-restore-mtime
25+
git restore-mtime
1926
2027
- name: Setup Python
2128
uses: actions/setup-python@v5

README.md

Lines changed: 12 additions & 11 deletions
Large diffs are not rendered by default.

_ext/rss.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,26 @@ class RSSItem:
3333
def from_meta(cls, page_name: str, meta: dict, app: "Sphinx") -> "RSSItem":
3434
"""Create from a page's metadata"""
3535
url = urljoin(app.config.html_baseurl, app.builder.get_target_uri(page_name))
36+
3637
# purposely don't use `get` here because we want to error if these fields are absent
3738
return RSSItem(
3839
title=meta[":og:title"],
3940
description=meta[":og:description"],
40-
date=datetime.fromisoformat(meta["date"]),
41+
date=cls.get_date_updated(page_name, meta, app),
4142
author=meta.get(":og:author", "pyOpenSci"),
4243
url=url,
4344
)
4445

46+
@staticmethod
47+
def get_date_updated(page_name: str, meta: dict, app: "Sphinx") -> datetime:
48+
"""if the page has an explicit date_updated, use that, otherwise get mtime"""
49+
if 'date_updated' in meta:
50+
return datetime.fromisoformat(meta['date_updated'])
51+
else:
52+
page_path = app.srcdir / (page_name + ".md")
53+
mtime = page_path.stat().st_mtime
54+
return datetime.fromtimestamp(mtime)
55+
4556
def render(self) -> str:
4657
return f"""\
4758
<item>
@@ -61,7 +72,7 @@ class RSSFeed:
6172
title: str = "pyOpenSci Tutorials"
6273
link: str = "https://www.pyopensci.org/python-package-guide/tutorials/intro.html"
6374
self_link: str = "https://www.pyopensci.org/python-package-guide/tutorials.rss"
64-
description: str = "Tutorials for learning python i guess!!!"
75+
description: str = "A tutorial feed that lists metadata for the pyOpenSci Python packaging tutorials so we can automatically list them on our website."
6576
language: str = "en"
6677

6778
def render(self) -> str:

tutorials/add-license-coc.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
:og:description: Learn how to add a LICENSE and CODE_OF_CONDUCT file to your Python package. This lesson covers choosing a permissive license, placing key files for visibility on GitHub and PyPI, and adopting the Contributor Covenant to support an inclusive community.
33
:og:title: Add a License and Code of Conduct to your python package
4-
date: 1970-01-02
54
---
65

76
# Add a `LICENSE` & `CODE_OF_CONDUCT` to your Python package

tutorials/add-readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
:og:description: Learn how to create a clear, effective README file for your Python package. This lesson covers what to include, why each section matters, and how a well-structured README improves usability and discoverability on GitHub and PyPI.
33
:og:title: Add a README file to your Python package
4-
date: 1970-01-03
54
---
65

76
# Add a README file to your Python package

tutorials/command-line-reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
:og:description: Learn how to add a command-line interface (CLI) to your Python package using the argparse library. This lesson walks you through creating a CLI entry point so users can run your package directly from the terminal.
33
:og:title: Command Line Reference Guide
4-
date: 1970-01-04
54
---
65

76
# Command Line Reference Guide

tutorials/get-to-know-hatch.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
:og:description: Get started with Hatch, a modern Python packaging tool. This lesson introduces Hatch’s features and shows how it simplifies environment management, project scaffolding, and building your package.
33
:og:title: Get to Know Hatch
4-
date: 1970-01-05
54
---
65

76
# Get to Know Hatch

tutorials/installable-code.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
:og:description: Learn how to make your code installable as a Python package using Hatch. This lesson walks you through structuring your code and configuring pyproject.toml so others can easily install and use your package.
33
:og:title: Make your Python code installable so it can be used across projects
4-
date: 1970-01-01
54
---
65

76
# Make your Python code installable

0 commit comments

Comments
 (0)