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 @@ -808,6 +808,10 @@ def _handle_exclude_newer_than(
808808
809809 Parses an ISO 8601 datetime string. If no timezone is specified in the string,
810810 local timezone is used.
811+
812+ Note: This option only works with indexes that provide upload-time metadata
813+ as specified in the simple repository API:
814+ https://packaging.python.org/en/latest/specifications/simple-repository-api/
811815 """
812816 if value is None :
813817 return None
@@ -836,10 +840,9 @@ def _handle_exclude_newer_than(
836840 callback = _handle_exclude_newer_than ,
837841 type = "str" ,
838842 help = (
839- "Exclude packages newer than given time. This should be an ISO 8601 string. "
840- "If no timezone is specified, local time is used. "
841- "For consistency across environments, specify the timezone explicitly "
842- "e.g., '2023-01-01T00:00:00Z' for UTC or '2023-01-01T00:00:00-05:00' for UTC-5."
843+ "Exclude packages newer than given time. Accepts ISO 8601 strings "
844+ "(e.g., '2023-01-01T00:00:00Z'). Uses local timezone if none specified. "
845+ "Only effective when installing from indexes that provide upload-time metadata."
843846 ),
844847)
845848
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 @@ -578,7 +578,10 @@ def test_find_all_candidates_find_links_and_index(data: TestData) -> None:
578578
579579
580580class TestPackageFinderExcludeNewerThan :
581- """Test PackageFinder integration with exclude_newer_than functionality."""
581+ """Test PackageFinder integration with exclude_newer_than functionality.
582+
583+ Only effective with indexes that provide upload-time metadata.
584+ """
582585
583586 def test_package_finder_create_with_exclude_newer_than (self ) -> None :
584587 """Test that PackageFinder.create() accepts exclude_newer_than parameter."""
Original file line number Diff line number Diff line change @@ -366,7 +366,10 @@ def test_filter_unallowed_hashes__log_message_with_no_match(
366366
367367
368368class TestLinkEvaluatorExcludeNewerThan :
369- """Test the exclude_newer_than functionality in LinkEvaluator."""
369+ """Test the exclude_newer_than functionality in LinkEvaluator.
370+
371+ Only effective with indexes that provide upload-time metadata.
372+ """
370373
371374 def make_test_link_evaluator (
372375 self , exclude_newer_than : datetime .datetime | None = None
You can’t perform that action at this time.
0 commit comments