python-update-checker 0.5__tar.gz → 0.6__tar.gz
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.
- {python_update_checker-0.5 → python_update_checker-0.6}/Makefile +14 -6
- {python_update_checker-0.5 → python_update_checker-0.6}/PKG-INFO +3 -6
- {python_update_checker-0.5 → python_update_checker-0.6}/README.md +2 -5
- {python_update_checker-0.5 → python_update_checker-0.6}/pyproject.toml +3 -3
- {python_update_checker-0.5 → python_update_checker-0.6}/src/puc/cli.py +10 -4
- {python_update_checker-0.5 → python_update_checker-0.6}/src/puc/dependencies.py +3 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/src/puc/pyprojecttoml.py +6 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/src/puc/requirementstxt.py +3 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/src/puc/uvlock.py +4 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/.gitignore +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/.ruff.toml +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/scripts/install_dev.sh +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/src/puc/__init__.py +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/src/puc/logging.py +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/tests/__init__.py +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/tests/data/other-requirements.txt +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/tests/data/pyproject.toml +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/tests/data/pyproject_compatible.toml +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/tests/data/requirements.txt +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/tests/data/uv.lock +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/tests/test_latest.py +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/tests/test_pyproject_toml.py +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/tests/test_requirements_txt.py +0 -0
- {python_update_checker-0.5 → python_update_checker-0.6}/tests/test_uv_lock.py +0 -0
|
@@ -16,8 +16,8 @@ MAKEFLAGS += --no-builtin-rules
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
############ Configuration ############
|
|
19
|
-
PROJECT:=$(shell egrep "name[[:space:]]*=" pyproject.toml | cut -d'"' -f2)
|
|
20
|
-
VERSION:=$(shell egrep "version[[:space:]]*=" pyproject.toml | cut -d'"' -f2)
|
|
19
|
+
PROJECT:=$(shell egrep "^name[[:space:]]*=" pyproject.toml | cut -d'"' -f2)
|
|
20
|
+
VERSION:=$(shell egrep "^version[[:space:]]*=" pyproject.toml | cut -d'"' -f2)
|
|
21
21
|
|
|
22
22
|
# exclude packages that are newer than this
|
|
23
23
|
EXCLUDE_NEWER:="7 days"
|
|
@@ -83,7 +83,10 @@ reformat: ## format the python code
|
|
|
83
83
|
checkoutdated: checkoutdated-py checkoutdated-gh
|
|
84
84
|
|
|
85
85
|
checkoutdated-py: ## Check for outdated package requirements
|
|
86
|
-
uv run puc
|
|
86
|
+
uv run puc \
|
|
87
|
+
--exclude-newer $(EXCLUDE_NEWER) \
|
|
88
|
+
--exclude-newer-package "python-update-checker=1 minute" \
|
|
89
|
+
check pyproject.toml uv.lock
|
|
87
90
|
|
|
88
91
|
checkoutdated-gh: ## check for outdated github projects
|
|
89
92
|
# github-check-outdated is a local tool which compares a given version with the latest available github release version
|
|
@@ -105,9 +108,13 @@ upgradeoutdated-gh:
|
|
|
105
108
|
.PHONY: upgradeoutdated-py
|
|
106
109
|
upgradeoutdated-py: ## upgrade dependencies in pyproject.toml and uv.lock
|
|
107
110
|
# upgrade pyproject.toml dependencies
|
|
108
|
-
uv run puc
|
|
111
|
+
uv run puc \
|
|
112
|
+
--exclude-newer $(EXCLUDE_NEWER) \
|
|
113
|
+
update pyproject.toml
|
|
109
114
|
# upgrade depencencies in uv lock file
|
|
110
|
-
uv lock
|
|
115
|
+
uv lock \
|
|
116
|
+
--exclude-newer $(EXCLUDE_NEWER) \
|
|
117
|
+
--upgrade
|
|
111
118
|
# install upgraded package versions in virtual environment
|
|
112
119
|
$(MAKE) init
|
|
113
120
|
|
|
@@ -155,7 +162,8 @@ release-gh: ## upload a new release to github
|
|
|
155
162
|
--prerelease=false \
|
|
156
163
|
--verify-tag \
|
|
157
164
|
"$(RELEASE_TAG)" \
|
|
158
|
-
dist/$(RELEASE_SOURCE)
|
|
165
|
+
dist/$(RELEASE_SOURCE) \
|
|
166
|
+
dist/$(RELEASE_WHEEL)
|
|
159
167
|
|
|
160
168
|
.PHONY: release-pypi
|
|
161
169
|
release-pypi: ## upload a new release to pypi
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-update-checker
|
|
3
|
-
Version: 0.
|
|
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
|
|
80
|
-
especially if your project relies on a [project directory](https://docs.astral.sh/uv/concepts/projects/layout/) (for example to define additional
|
|
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
|
------------
|
|
@@ -58,8 +58,8 @@ Script behaviour
|
|
|
58
58
|
The exit code of `puc check` is non-zero when updates are available.
|
|
59
59
|
|
|
60
60
|
Checking a `pyproject.toml` or `uv.lock`file with `puc` should be done
|
|
61
|
-
from the
|
|
62
|
-
especially if your project relies on a [project directory](https://docs.astral.sh/uv/concepts/projects/layout/) (for example to define additional
|
|
61
|
+
from the directory of the `pyproject.toml` file,
|
|
62
|
+
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).
|
|
63
63
|
|
|
64
64
|
After updating versions in pyproject.toml, run `uv lock --upgrade` to update
|
|
65
65
|
the transitive dependencies in `uv.lock`.
|
|
@@ -90,9 +90,6 @@ Dependencies are
|
|
|
90
90
|
|
|
91
91
|
puc needs Python >= 3.11 since it uses the tomllib Python module.
|
|
92
92
|
|
|
93
|
-
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`.
|
|
94
|
-
This enables simple packaging and installation.
|
|
95
|
-
|
|
96
93
|
|
|
97
94
|
Limitations
|
|
98
95
|
------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-update-checker"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.6"
|
|
4
4
|
requires-python = ">=3.11"
|
|
5
5
|
license = "GPL-3.0-only"
|
|
6
6
|
license_files = [
|
|
@@ -55,5 +55,5 @@ source-include = [
|
|
|
55
55
|
|
|
56
56
|
[tool.project]
|
|
57
57
|
# pin versions of Python and uv for development
|
|
58
|
-
python_version_dev = "3.14.
|
|
59
|
-
uv_version_dev = "0.11.
|
|
58
|
+
python_version_dev = "3.14.5"
|
|
59
|
+
uv_version_dev = "0.11.14"
|
|
@@ -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:]))
|
|
@@ -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:
|
|
@@ -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),
|
|
@@ -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),
|
|
@@ -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:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_update_checker-0.5 → python_update_checker-0.6}/tests/data/pyproject_compatible.toml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|