Skip to content

Commit 2bcff2d

Browse files
authored
Merge branch 'main' into ci/autoupdate-translation-stats
2 parents ea17753 + c487789 commit 2bcff2d

16 files changed

+118
-40
lines changed

.all-contributorsrc

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,55 @@
866866
"code",
867867
"review"
868868
]
869+
},
870+
{
871+
"login": "akhilkrishnar0",
872+
"name": "Akhil Krishna R",
873+
"avatar_url": "https://avatars.githubusercontent.com/u/164136572?v=4",
874+
"profile": "https://sites.google.com/res.christuniversity.in/akhilkrishnar/about?pli=1",
875+
"contributions": [
876+
"ideas",
877+
"review"
878+
]
879+
},
880+
{
881+
"login": "yngvem",
882+
"name": "Yngve Mardal Moe",
883+
"avatar_url": "https://avatars.githubusercontent.com/u/3531982?v=4",
884+
"profile": "https://github.com/yngvem",
885+
"contributions": [
886+
"code",
887+
"review"
888+
]
889+
},
890+
{
891+
"login": "ZacWarham",
892+
"name": "Zac Warham",
893+
"avatar_url": "https://avatars.githubusercontent.com/u/48937711?v=4",
894+
"profile": "https://github.com/ZacWarham",
895+
"contributions": [
896+
"ideas",
897+
"review"
898+
]
899+
},
900+
{
901+
"login": "SanketKumarKar",
902+
"name": "Sanket Kumar Kar",
903+
"avatar_url": "https://avatars.githubusercontent.com/u/197726103?v=4",
904+
"profile": "https://github.com/SanketKumarKar",
905+
"contributions": [
906+
"code"
907+
]
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+
]
869918
}
870919
],
871920
"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: 28 additions & 21 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:

package-structure-code/python-package-build-tools.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,15 @@ is currently undocumented. Thus, we don't recommend using Poetry for more comple
389389
:widths: 20,5,50
390390
:delim: "|"
391391
392-
Add dependencies to your pyproject.toml file |✅|Poetry helps you add dependencies to your `pyproject.toml` metadata. _NOTE: currently Poetry adds dependencies using an approach that is slightly out of alignment with current Python peps - however there is a plan to fix this in an upcoming release._ Poetry also allows you to organize dependencies in groups such as documentation, packaging and tests.
392+
Add dependencies to your pyproject.toml file |✅|Poetry helps you add dependencies to your `pyproject.toml` metadata.
393393
Dependency specification |✅ |Poetry allows you to be specific about version of dependencies that you add to your package's pyproject.toml file. However, it's default upper bound approach can be problematic for some packages (We suggest you override the default setting when adding dependencies). Read below for more.
394394
Environment management |✅ | Poetry allows you to either use its built in environment or you can select the environment type that you want to use for managing your package. [Read more about its built in environment management options](https://python-poetry.org/docs/basic-usage/#using-your-virtual-environment).
395395
Lock files| ✅ | Poetry creates a **poetry.lock** file that you can use if you need a lock file for your build.
396396
Publish to PyPI and test PyPI|✅|Poetry supports publishing to both test PyPI and PyPI
397397
Version Control based versioning|✅ | The plugin [Poetry dynamic versioning](https://github.com/mtkennerly/poetry-dynamic-versioning) supports versioning using git tags with Poetry.
398398
Version bumping| ✅ | Poetry supports you bumping the version of your package using standard semantic version terms patch; minor; major
399-
Follows current packaging standards|✖✅|Poetry does not quite support current packaging standards for adding metadata to the **pyproject.toml** file but plans to fix this in an upcoming release.
400-
Install your package in editable mode|✅|Poetry supports installing your package in editable mode using `--editable`
399+
Follows current packaging standards|✅|Since version 2.0, Poetry supports most current project metadata standards. However, not all standards are supported, and it also supports the legacy Poetry format. Read below for more.
400+
Install your package in editable mode|✅|Poetry supports installing your package in editable mode.
401401
Build your sdist and wheel distributions|✅|Poetry will build your sdist and wheel distributions using `poetry build`
402402
```
403403

@@ -408,11 +408,11 @@ Build your sdist and wheel distributions|✅|Poetry will build your sdist and wh
408408

409409
Some challenges of Poetry include:
410410

411-
- Poetry, by default, pins dependencies using an "upper bound" limit specified with the `^` symbol by default. However, this behavior can be over-written by specifying the dependency when you use `Poetry add` as follows: `poetry add "requests>=2.1"` See breakout below for more discussion on issues surrounding upper-bounds pinning.
412-
- _Minor Challenge:_ The way Poetry currently adds metadata to your pyproject.toml file does not follow current Python standards. However, this is going to be addressed with Poetry release version 2.0.
411+
- Poetry has its own concept of grouped dependencies (`poetry add --group=GROUP_NAME DEPENDENCY`). Dependencies added as grouped dependencies are not optional and there is no Python standard for this type of dependency. This should not be confused with "optional" dependencies (`poetry add --optional=GROUP_NAME DEPENDENCY`), which is standardised and lets you group your dependencies into several optional groups.
412+
- While Poetry supports "development" dependencies (i.e. dependencies you use for development but not running the code, such as `pytest`), Poetry does not yet follow the standardised format for specifying such dependencies.
413+
- Poetry, by default, pins dependencies using an "upper bound" limit (which is specified with the `^` symbol in the legacy format). However, this behavior can be over-written by specifying the dependency when you use `poetry add` as follows: `poetry add "requests>=2.1"` See breakout below for more discussion on issues surrounding upper-bounds pinning.
413414

414-
Poetry is an excellent tool. Use caution when using it to pin dependencies as
415-
Poetry's approach to pinning can be problematic for many builds. If you use Poetry, we strongly suggest that you override the default upper bound dependency option.
415+
Poetry is a popular packaging tool and introduced many very useful features. However, if you decide to use it, then use caution when adding dependencies as Poetry's approach to pinning can be problematic for many builds. If you use Poetry, we strongly suggest that you override the default upper bound dependency option.
416416

417417
<!--https://github.com/py-pkgs/py-pkgs/issues/95#issuecomment-1035584750
418418
discusses the slight differences in how poetry adds deps....-->

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

0 commit comments

Comments
 (0)