python-update-checker 0.5__py3-none-any.whl → 0.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
puc/cli.py CHANGED
@@ -9,6 +9,7 @@ import argparse
9
9
  import sys
10
10
  import logging
11
11
  import os
12
+ import shlex
12
13
  import tempfile
13
14
  from packaging.utils import canonicalize_name
14
15
  from typing import TextIO, Any
@@ -63,6 +64,11 @@ def get_option_parser() -> argparse.ArgumentParser:
63
64
  dest="exclude_newer",
64
65
  help="Limit package versions to those that were uploaded prior to the given date",
65
66
  )
67
+ parser.add_argument(
68
+ "--exclude-newer-package",
69
+ dest="exclude_newer_package",
70
+ help="Limit candidate packages for specific packages to those that were uploaded prior to the given date. Accepts package-date pairs in the format PACKAGE=DATE.",
71
+ )
66
72
  parser.add_argument(
67
73
  "--constraints",
68
74
  dest="constraints",
@@ -133,6 +139,7 @@ def handle_dependency_file(dep_file: str, optargs, constraint_file):
133
139
  packages=packages,
134
140
  command=optargs.command,
135
141
  exclude_newer=optargs.exclude_newer,
142
+ exclude_newer_package=optargs.exclude_newer_package,
136
143
  constraint_file=constraint_file,
137
144
  color=optargs.color,
138
145
  )
@@ -143,6 +150,7 @@ def handle_dependency_file(dep_file: str, optargs, constraint_file):
143
150
  packages=packages,
144
151
  command=optargs.command,
145
152
  exclude_newer=optargs.exclude_newer,
153
+ exclude_newer_package=optargs.exclude_newer_package,
146
154
  constraint_file=constraint_file,
147
155
  color=optargs.color,
148
156
  )
@@ -153,6 +161,7 @@ def handle_dependency_file(dep_file: str, optargs, constraint_file):
153
161
  packages=packages,
154
162
  command=optargs.command,
155
163
  exclude_newer=optargs.exclude_newer,
164
+ exclude_newer_package=optargs.exclude_newer_package,
156
165
  constraint_file=constraint_file,
157
166
  color=optargs.color,
158
167
  )
@@ -165,6 +174,7 @@ def handle_dependency_file(dep_file: str, optargs, constraint_file):
165
174
 
166
175
  def main() -> int:
167
176
  """Parse options and check or update dependencies."""
177
+ logger.info(f"{shlex.join(sys.argv)}")
168
178
  # parse options
169
179
  try:
170
180
  optargs = get_option_parser().parse_args(sys.argv[1:])
@@ -208,7 +218,3 @@ def main() -> int:
208
218
  os.unlink(constraint_file)
209
219
  # check command returns non-zero exit code when updates are available
210
220
  return 1 if optargs.command == "check" and updatable > 0 else 0
211
-
212
-
213
- # if __name__ == "__main__":
214
- # sys.exit(main(sys.argv[1:]))
puc/dependencies.py CHANGED
@@ -13,6 +13,7 @@ from .logging import logger
13
13
  def get_latest_version(
14
14
  package: str,
15
15
  exclude_newer: None | str = None,
16
+ exclude_newer_package: None | str = None,
16
17
  constraint_file: None | str = None,
17
18
  python_platform: str | None = None,
18
19
  python_version: str | None = None,
@@ -35,6 +36,8 @@ def get_latest_version(
35
36
  ]
36
37
  if exclude_newer:
37
38
  cmd.extend(("--exclude-newer", exclude_newer))
39
+ if exclude_newer_package:
40
+ cmd.extend(("--exclude-newer-package", exclude_newer_package))
38
41
  if constraint_file:
39
42
  cmd.extend(("--constraints", constraint_file))
40
43
  if python_platform:
puc/pyprojecttoml.py CHANGED
@@ -22,6 +22,7 @@ def handle_pyproject_toml(
22
22
  command: None | str = None,
23
23
  packages=None,
24
24
  exclude_newer: None | str = None,
25
+ exclude_newer_package: None | str = None,
25
26
  constraint_file: None | str = None,
26
27
  color: bool = True,
27
28
  ) -> int:
@@ -53,6 +54,7 @@ def handle_pyproject_toml(
53
54
  command=command,
54
55
  packages=packages,
55
56
  exclude_newer=exclude_newer,
57
+ exclude_newer_package=exclude_newer_package,
56
58
  constraint_file=constraint_file,
57
59
  color=color,
58
60
  )
@@ -67,6 +69,7 @@ def handle_pyproject_toml(
67
69
  command=command,
68
70
  packages=packages,
69
71
  exclude_newer=exclude_newer,
72
+ exclude_newer_package=exclude_newer_package,
70
73
  constraint_file=constraint_file,
71
74
  color=color,
72
75
  )
@@ -80,6 +83,7 @@ def handle_pyproject_toml(
80
83
  command=command,
81
84
  packages=packages,
82
85
  exclude_newer=exclude_newer,
86
+ exclude_newer_package=exclude_newer_package,
83
87
  constraint_file=constraint_file,
84
88
  color=color,
85
89
  )
@@ -97,6 +101,7 @@ def update_pyproject_dependencies(
97
101
  command: None | str = None,
98
102
  packages=None,
99
103
  exclude_newer: None | str = None,
104
+ exclude_newer_package: None | str = None,
100
105
  constraint_file: None | str = None,
101
106
  color: bool = True,
102
107
  ) -> int:
@@ -122,6 +127,7 @@ def update_pyproject_dependencies(
122
127
  latest_version = get_latest_version(
123
128
  pkg_req.name,
124
129
  exclude_newer=exclude_newer,
130
+ exclude_newer_package=exclude_newer_package,
125
131
  constraint_file=constraint_file,
126
132
  python_platform=get_python_platform_from_req(pkg_req),
127
133
  python_version=get_min_python_version_from_req(pkg_req),
puc/requirementstxt.py CHANGED
@@ -26,6 +26,7 @@ def handle_requirements_txt(
26
26
  command: None | str = None,
27
27
  packages=None,
28
28
  exclude_newer: None | str = None,
29
+ exclude_newer_package: None | str = None,
29
30
  constraint_file: None | str = None,
30
31
  color: bool = True,
31
32
  rec_level: int = 0,
@@ -62,6 +63,7 @@ def handle_requirements_txt(
62
63
  command,
63
64
  packages=packages,
64
65
  exclude_newer=exclude_newer,
66
+ exclude_newer_package=exclude_newer_package,
65
67
  constraint_file=constraint_file,
66
68
  color=color,
67
69
  rec_level=rec_level + 1,
@@ -72,6 +74,7 @@ def handle_requirements_txt(
72
74
  latest_version = get_latest_version(
73
75
  pkg_req.name,
74
76
  exclude_newer=exclude_newer,
77
+ exclude_newer_package=exclude_newer_package,
75
78
  constraint_file=constraint_file,
76
79
  python_platform=get_python_platform_from_req(pkg_req),
77
80
  python_version=get_min_python_version_from_req(pkg_req),
puc/uvlock.py CHANGED
@@ -19,6 +19,7 @@ def handle_uv_lock(
19
19
  command: None | str = None,
20
20
  packages=None,
21
21
  exclude_newer: None | str = None,
22
+ exclude_newer_package: None | str = None,
22
23
  constraint_file: None | str = None,
23
24
  color: bool = True,
24
25
  ) -> int:
@@ -55,6 +56,7 @@ def handle_uv_lock(
55
56
  command=command,
56
57
  packages=packages,
57
58
  exclude_newer=exclude_newer,
59
+ exclude_newer_package=exclude_newer_package,
58
60
  constraint_file=constraint_file,
59
61
  color=color,
60
62
  )
@@ -70,6 +72,7 @@ def update_uvlock_dependency(
70
72
  command: None | str = None,
71
73
  packages=None,
72
74
  exclude_newer: None | str = None,
75
+ exclude_newer_package: None | str = None,
73
76
  constraint_file: None | str = None,
74
77
  color: bool = True,
75
78
  ) -> int:
@@ -82,6 +85,7 @@ def update_uvlock_dependency(
82
85
  latest_version = get_latest_version(
83
86
  package,
84
87
  exclude_newer=exclude_newer,
88
+ exclude_newer_package=exclude_newer_package,
85
89
  constraint_file=constraint_file,
86
90
  )
87
91
  except subprocess.CalledProcessError as exc:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-update-checker
3
- Version: 0.5
3
+ Version: 0.6
4
4
  License-Expression: GPL-3.0-only
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
@@ -76,8 +76,8 @@ Script behaviour
76
76
  The exit code of `puc check` is non-zero when updates are available.
77
77
 
78
78
  Checking a `pyproject.toml` or `uv.lock`file with `puc` should be done
79
- from the project of the `pyproject.toml` file,
80
- especially if your project relies on a [project directory](https://docs.astral.sh/uv/concepts/projects/layout/) (for example to define additional packages index in pyproject.toml).
79
+ from the directory of the `pyproject.toml` file,
80
+ especially if your project relies on a [project directory](https://docs.astral.sh/uv/concepts/projects/layout/) (for example to define additional package indexes in pyproject.toml).
81
81
 
82
82
  After updating versions in pyproject.toml, run `uv lock --upgrade` to update
83
83
  the transitive dependencies in `uv.lock`.
@@ -108,9 +108,6 @@ Dependencies are
108
108
 
109
109
  puc needs Python >= 3.11 since it uses the tomllib Python module.
110
110
 
111
- puc consists of a single python script. The script uses [inline script metadata](https://peps.python.org/pep-0723/) to be executed directly with `uv run --script`.
112
- This enables simple packaging and installation.
113
-
114
111
 
115
112
  Limitations
116
113
  ------------
@@ -0,0 +1,11 @@
1
+ puc/__init__.py,sha256=QCJeo6rsztgAeIuufaaId2f-x_XYLjs4UywOPp4w7ks,67
2
+ puc/cli.py,sha256=mzbs7TZsuI0_PgRgIAzHRxmKDa02cBrLjtn7qTE2wwQ,7417
3
+ puc/dependencies.py,sha256=RySjC6TLJVypWBQpiW-7RmoKm1qGbb_4eR-3C3UtEkw,6597
4
+ puc/logging.py,sha256=VBojYqr7-l-aLeNqrBqTJyHuEINzdBx1CObQg5XiC-k,2222
5
+ puc/pyprojecttoml.py,sha256=EgcJrKU4oz5sa16PyARKacjSL9AJt7xaXkv8lOVk4OA,6515
6
+ puc/requirementstxt.py,sha256=Tv6-b14ko9HLmaYRanqtH7y0WSXUxNi8I5QqzbbjbyY,4788
7
+ puc/uvlock.py,sha256=NCrottrNvId2Klwt4eI9Gi8ZIVQ_3pEC_uYLM-nqDW4,4154
8
+ python_update_checker-0.6.dist-info/WHEEL,sha256=fWriCkzqm-pffF5af4gJC9iI5FMFaJTuN9UxxxzOmdY,81
9
+ python_update_checker-0.6.dist-info/entry_points.txt,sha256=mQuGfBukyjyo7ssOHSIycAlRdQkrA1ewAth6tsV_T60,38
10
+ python_update_checker-0.6.dist-info/METADATA,sha256=bEEB2OTxGN15FAeGv-JY57FT_nXkVerT1dfxQd8Sa2s,4350
11
+ python_update_checker-0.6.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.11.11
2
+ Generator: uv 0.11.14
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,11 +0,0 @@
1
- puc/__init__.py,sha256=QCJeo6rsztgAeIuufaaId2f-x_XYLjs4UywOPp4w7ks,67
2
- puc/cli.py,sha256=aLQ52sA59lc8xAK7gjR36nTqUYxZvkvh467i0cx8Zso,6956
3
- puc/dependencies.py,sha256=7MY8fyGGGayztpQfPAyCKXnlPUABXJDF9mwqmeMEjZs,6450
4
- puc/logging.py,sha256=VBojYqr7-l-aLeNqrBqTJyHuEINzdBx1CObQg5XiC-k,2222
5
- puc/pyprojecttoml.py,sha256=TMhNEWqlRfjichuU0nVGHbBHFhYALu12DuOSyobT5oE,6179
6
- puc/requirementstxt.py,sha256=V075kYSuD35cGJ8XGdjq_24_aSUcJi43KH9ALov4rSQ,4604
7
- puc/uvlock.py,sha256=mKc3x2RhcmHzYe8PHfUQZBkJI0DzN4qpDCmOQzrYnAE,3948
8
- python_update_checker-0.5.dist-info/WHEEL,sha256=iCTolw4aw2dP3yfM-EQCGTDsFCXL_ymmbYnBRVH7plA,81
9
- python_update_checker-0.5.dist-info/entry_points.txt,sha256=mQuGfBukyjyo7ssOHSIycAlRdQkrA1ewAth6tsV_T60,38
10
- python_update_checker-0.5.dist-info/METADATA,sha256=RgatXY5cl_Oy8z2NisqECNj5msIVOv2VlEsBKdQA5Eo,4562
11
- python_update_checker-0.5.dist-info/RECORD,,