@@ -134,7 +134,7 @@ def __init__(
134134 target_python : TargetPython ,
135135 allow_yanked : bool ,
136136 ignore_requires_python : bool | None = None ,
137- exclude_newer_than : datetime .datetime | None = None ,
137+ uploaded_prior_to : datetime .datetime | None = None ,
138138 ) -> None :
139139 """
140140 :param project_name: The user supplied package name.
@@ -152,7 +152,8 @@ def __init__(
152152 :param ignore_requires_python: Whether to ignore incompatible
153153 PEP 503 "data-requires-python" values in HTML links. Defaults
154154 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.
156157 """
157158 if ignore_requires_python is None :
158159 ignore_requires_python = False
@@ -162,7 +163,7 @@ def __init__(
162163 self ._ignore_requires_python = ignore_requires_python
163164 self ._formats = formats
164165 self ._target_python = target_python
165- self ._exclude_newer_than = exclude_newer_than
166+ self ._uploaded_prior_to = uploaded_prior_to
166167
167168 self .project_name = project_name
168169
@@ -181,10 +182,11 @@ def evaluate_link(self, link: Link) -> tuple[LinkType, str]:
181182 reason = link .yanked_reason or "<none given>"
182183 return (LinkType .yanked , f"yanked for reason: { reason } " )
183184
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 :
186187 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 } "
188190 )
189191 return (LinkType .upload_too_late , reason )
190192
@@ -605,7 +607,7 @@ def __init__(
605607 format_control : FormatControl | None = None ,
606608 candidate_prefs : CandidatePreferences | None = None ,
607609 ignore_requires_python : bool | None = None ,
608- exclude_newer_than : datetime .datetime | None = None ,
610+ uploaded_prior_to : datetime .datetime | None = None ,
609611 ) -> None :
610612 """
611613 This constructor is primarily meant to be used by the create() class
@@ -627,7 +629,7 @@ def __init__(
627629 self ._ignore_requires_python = ignore_requires_python
628630 self ._link_collector = link_collector
629631 self ._target_python = target_python
630- self ._exclude_newer_than = exclude_newer_than
632+ self ._uploaded_prior_to = uploaded_prior_to
631633
632634 self .format_control = format_control
633635
@@ -651,7 +653,7 @@ def create(
651653 link_collector : LinkCollector ,
652654 selection_prefs : SelectionPreferences ,
653655 target_python : TargetPython | None = None ,
654- exclude_newer_than : datetime .datetime | None = None ,
656+ uploaded_prior_to : datetime .datetime | None = None ,
655657 ) -> PackageFinder :
656658 """Create a PackageFinder.
657659
@@ -660,7 +662,8 @@ def create(
660662 :param target_python: The target Python interpreter to use when
661663 checking compatibility. If None (the default), a TargetPython
662664 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.
664667 """
665668 if target_python is None :
666669 target_python = TargetPython ()
@@ -677,7 +680,7 @@ def create(
677680 allow_yanked = selection_prefs .allow_yanked ,
678681 format_control = selection_prefs .format_control ,
679682 ignore_requires_python = selection_prefs .ignore_requires_python ,
680- exclude_newer_than = exclude_newer_than ,
683+ uploaded_prior_to = uploaded_prior_to ,
681684 )
682685
683686 @property
@@ -738,8 +741,8 @@ def set_prefer_binary(self) -> None:
738741 self ._candidate_prefs .prefer_binary = True
739742
740743 @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
743746
744747 def requires_python_skipped_reasons (self ) -> list [str ]:
745748 reasons = {
@@ -760,7 +763,7 @@ def make_link_evaluator(self, project_name: str) -> LinkEvaluator:
760763 target_python = self ._target_python ,
761764 allow_yanked = self ._allow_yanked ,
762765 ignore_requires_python = self ._ignore_requires_python ,
763- exclude_newer_than = self ._exclude_newer_than ,
766+ uploaded_prior_to = self ._uploaded_prior_to ,
764767 )
765768
766769 def _sort_links (self , links : Iterable [Link ]) -> list [Link ]:
0 commit comments