@@ -134,7 +134,7 @@ def __init__(
134
134
target_python : TargetPython ,
135
135
allow_yanked : bool ,
136
136
ignore_requires_python : bool | None = None ,
137
- exclude_newer_than : datetime .datetime | None = None ,
137
+ uploaded_prior_to : datetime .datetime | None = None ,
138
138
) -> None :
139
139
"""
140
140
:param project_name: The user supplied package name.
@@ -152,7 +152,8 @@ def __init__(
152
152
:param ignore_requires_python: Whether to ignore incompatible
153
153
PEP 503 "data-requires-python" values in HTML links. Defaults
154
154
to False.
155
- :param exclude_newer_than: If set, only allow links prior to the given date.
155
+ :param uploaded_prior_to: If set, only allow links uploaded prior to
156
+ the given datetime.
156
157
"""
157
158
if ignore_requires_python is None :
158
159
ignore_requires_python = False
@@ -162,7 +163,7 @@ def __init__(
162
163
self ._ignore_requires_python = ignore_requires_python
163
164
self ._formats = formats
164
165
self ._target_python = target_python
165
- self ._exclude_newer_than = exclude_newer_than
166
+ self ._uploaded_prior_to = uploaded_prior_to
166
167
167
168
self .project_name = project_name
168
169
@@ -181,10 +182,11 @@ def evaluate_link(self, link: Link) -> tuple[LinkType, str]:
181
182
reason = link .yanked_reason or "<none given>"
182
183
return (LinkType .yanked , f"yanked for reason: { reason } " )
183
184
184
- if link .upload_time is not None and self ._exclude_newer_than is not None :
185
- if link . upload_time > self . _exclude_newer_than :
185
+ if link .upload_time is not None and self ._uploaded_prior_to is not None :
186
+ if self . _uploaded_prior_to < link . upload_time :
186
187
reason = (
187
- f"Upload time { link .upload_time } after { self ._exclude_newer_than } "
188
+ f"Upload time { link .upload_time } not "
189
+ f"prior to { self ._uploaded_prior_to } "
188
190
)
189
191
return (LinkType .upload_too_late , reason )
190
192
@@ -605,7 +607,7 @@ def __init__(
605
607
format_control : FormatControl | None = None ,
606
608
candidate_prefs : CandidatePreferences | None = None ,
607
609
ignore_requires_python : bool | None = None ,
608
- exclude_newer_than : datetime .datetime | None = None ,
610
+ uploaded_prior_to : datetime .datetime | None = None ,
609
611
) -> None :
610
612
"""
611
613
This constructor is primarily meant to be used by the create() class
@@ -627,7 +629,7 @@ def __init__(
627
629
self ._ignore_requires_python = ignore_requires_python
628
630
self ._link_collector = link_collector
629
631
self ._target_python = target_python
630
- self ._exclude_newer_than = exclude_newer_than
632
+ self ._uploaded_prior_to = uploaded_prior_to
631
633
632
634
self .format_control = format_control
633
635
@@ -651,7 +653,7 @@ def create(
651
653
link_collector : LinkCollector ,
652
654
selection_prefs : SelectionPreferences ,
653
655
target_python : TargetPython | None = None ,
654
- exclude_newer_than : datetime .datetime | None = None ,
656
+ uploaded_prior_to : datetime .datetime | None = None ,
655
657
) -> PackageFinder :
656
658
"""Create a PackageFinder.
657
659
@@ -660,7 +662,8 @@ def create(
660
662
:param target_python: The target Python interpreter to use when
661
663
checking compatibility. If None (the default), a TargetPython
662
664
object will be constructed from the running Python.
663
- :param exclude_newer_than: If set, only find links prior to the given date.
665
+ :param uploaded_prior_to: If set, only find links uploaded prior
666
+ to the given datetime.
664
667
"""
665
668
if target_python is None :
666
669
target_python = TargetPython ()
@@ -677,7 +680,7 @@ def create(
677
680
allow_yanked = selection_prefs .allow_yanked ,
678
681
format_control = selection_prefs .format_control ,
679
682
ignore_requires_python = selection_prefs .ignore_requires_python ,
680
- exclude_newer_than = exclude_newer_than ,
683
+ uploaded_prior_to = uploaded_prior_to ,
681
684
)
682
685
683
686
@property
@@ -738,8 +741,8 @@ def set_prefer_binary(self) -> None:
738
741
self ._candidate_prefs .prefer_binary = True
739
742
740
743
@property
741
- def exclude_newer_than (self ) -> datetime .datetime | None :
742
- return self ._exclude_newer_than
744
+ def uploaded_prior_to (self ) -> datetime .datetime | None :
745
+ return self ._uploaded_prior_to
743
746
744
747
def requires_python_skipped_reasons (self ) -> list [str ]:
745
748
reasons = {
@@ -760,7 +763,7 @@ def make_link_evaluator(self, project_name: str) -> LinkEvaluator:
760
763
target_python = self ._target_python ,
761
764
allow_yanked = self ._allow_yanked ,
762
765
ignore_requires_python = self ._ignore_requires_python ,
763
- exclude_newer_than = self ._exclude_newer_than ,
766
+ uploaded_prior_to = self ._uploaded_prior_to ,
764
767
)
765
768
766
769
def _sort_links (self , links : Iterable [Link ]) -> list [Link ]:
0 commit comments