File tree Expand file tree Collapse file tree 5 files changed +25
-9
lines changed Expand file tree Collapse file tree 5 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 1- Add ``--exclude-newer-than `` option to exclude packages uploaded after a given date.
1+ Add ``--exclude-newer-than `` option to exclude packages uploaded after a given date,
2+ only effective with indexes that provide upload-time metadata.
Original file line number Diff line number Diff line change @@ -846,6 +846,10 @@ def _handle_exclude_newer_than(
846846
847847 Parses an ISO 8601 datetime string. If no timezone is specified in the string,
848848 local timezone is used.
849+
850+ Note: This option only works with indexes that provide upload-time metadata
851+ as specified in the simple repository API:
852+ https://packaging.python.org/en/latest/specifications/simple-repository-api/
849853 """
850854 if value is None :
851855 return None
@@ -874,10 +878,9 @@ def _handle_exclude_newer_than(
874878 callback = _handle_exclude_newer_than ,
875879 type = "str" ,
876880 help = (
877- "Exclude packages newer than given time. This should be an ISO 8601 string. "
878- "If no timezone is specified, local time is used. "
879- "For consistency across environments, specify the timezone explicitly "
880- "e.g., '2023-01-01T00:00:00Z' for UTC or '2023-01-01T00:00:00-05:00' for UTC-5."
881+ "Exclude packages newer than given time. Accepts ISO 8601 strings "
882+ "(e.g., '2023-01-01T00:00:00Z'). Uses local timezone if none specified. "
883+ "Only effective when installing from indexes that provide upload-time metadata."
881884 ),
882885)
883886
Original file line number Diff line number Diff line change 1- """Tests for pip install --exclude-newer-than."""
1+ """Tests for pip install --exclude-newer-than.
2+
3+ Only effective with indexes that provide upload-time metadata.
4+ """
25
36from __future__ import annotations
47
811
912
1013class TestExcludeNewer :
11- """Test --exclude-newer-than functionality."""
14+ """Test --exclude-newer-than functionality.
15+
16+ Only effective with indexes that provide upload-time metadata.
17+ """
1218
1319 def test_exclude_newer_than_invalid_date (
1420 self , script : PipTestEnvironment , data : TestData
Original file line number Diff line number Diff line change @@ -579,7 +579,10 @@ def test_find_all_candidates_find_links_and_index(data: TestData) -> None:
579579
580580
581581class TestPackageFinderExcludeNewerThan :
582- """Test PackageFinder integration with exclude_newer_than functionality."""
582+ """Test PackageFinder integration with exclude_newer_than functionality.
583+
584+ Only effective with indexes that provide upload-time metadata.
585+ """
583586
584587 def test_package_finder_create_with_exclude_newer_than (self ) -> None :
585588 """Test that PackageFinder.create() accepts exclude_newer_than parameter."""
Original file line number Diff line number Diff line change @@ -367,7 +367,10 @@ def test_filter_unallowed_hashes__log_message_with_no_match(
367367
368368
369369class TestLinkEvaluatorExcludeNewerThan :
370- """Test the exclude_newer_than functionality in LinkEvaluator."""
370+ """Test the exclude_newer_than functionality in LinkEvaluator.
371+
372+ Only effective with indexes that provide upload-time metadata.
373+ """
371374
372375 def make_test_link_evaluator (
373376 self , exclude_newer_than : datetime .datetime | None = None
You can’t perform that action at this time.
0 commit comments