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(
808
808
809
809
Parses an ISO 8601 datetime string. If no timezone is specified in the string,
810
810
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/
811
815
"""
812
816
if value is None :
813
817
return None
@@ -836,10 +840,9 @@ def _handle_exclude_newer_than(
836
840
callback = _handle_exclude_newer_than ,
837
841
type = "str" ,
838
842
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."
843
846
),
844
847
)
845
848
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
+ """
2
5
3
6
from __future__ import annotations
4
7
8
11
9
12
10
13
class 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
+ """
12
18
13
19
def test_exclude_newer_than_invalid_date (
14
20
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:
578
578
579
579
580
580
class 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
+ """
582
585
583
586
def test_package_finder_create_with_exclude_newer_than (self ) -> None :
584
587
"""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(
366
366
367
367
368
368
class 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
+ """
370
373
371
374
def make_test_link_evaluator (
372
375
self , exclude_newer_than : datetime .datetime | None = None
You can’t perform that action at this time.
0 commit comments