File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 9
9
import time
10
10
from bisect import bisect_left
11
11
from collections import defaultdict
12
- from datetime import datetime , timezone
12
+ from datetime import datetime , timedelta , timezone # noqa: F401
13
13
from importlib .metadata import metadata
14
14
from packaging .specifiers import SpecifierSet
15
15
from packaging .version import Version
29
29
from split_tox_gh_actions .split_tox_gh_actions import GROUPS
30
30
31
31
32
+ # Set CUTOFF this to a datetime to ignore packages older than CUTOFF
33
+ CUTOFF = None
34
+ # CUTOFF = datetime.now(tz=timezone.utc) - timedelta(days=365 * 5)
35
+
32
36
TOX_FILE = Path (__file__ ).resolve ().parent .parent .parent / "tox.ini"
33
37
ENV = Environment (
34
38
loader = FileSystemLoader (Path (__file__ ).resolve ().parent ),
@@ -162,9 +166,13 @@ def _prefilter_releases(
162
166
if meta ["yanked" ]:
163
167
continue
164
168
165
- if older_than is not None :
166
- if datetime .fromisoformat (meta ["upload_time_iso_8601" ]) > older_than :
167
- continue
169
+ uploaded = datetime .fromisoformat (meta ["upload_time_iso_8601" ])
170
+
171
+ if older_than is not None and uploaded > older_than :
172
+ continue
173
+
174
+ if CUTOFF is not None and uploaded < CUTOFF :
175
+ continue
168
176
169
177
version = Version (release )
170
178
You can’t perform that action at this time.
0 commit comments