python-update-checker 0.7__tar.gz → 0.9.0__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.7 → python_update_checker-0.9.0}/Makefile +11 -10
- {python_update_checker-0.7 → python_update_checker-0.9.0}/PKG-INFO +1 -1
- {python_update_checker-0.7 → python_update_checker-0.9.0}/pyproject.toml +4 -3
- {python_update_checker-0.7 → python_update_checker-0.9.0}/pyproject.toml.orig +5 -3
- {python_update_checker-0.7 → python_update_checker-0.9.0}/scripts/install_dev.sh +12 -7
- {python_update_checker-0.7 → python_update_checker-0.9.0}/src/puc/__init__.py +2 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/src/puc/cli.py +13 -1
- {python_update_checker-0.7 → python_update_checker-0.9.0}/src/puc/uvlock.py +14 -6
- {python_update_checker-0.7 → python_update_checker-0.9.0}/tests/data/uv.lock +10 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/tests/test_uv_lock.py +2 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/.gitignore +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/.ruff.toml +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/README.md +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/src/puc/dependencies.py +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/src/puc/logging.py +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/src/puc/pyprojecttoml.py +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/src/puc/requirementstxt.py +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/tests/__init__.py +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/tests/data/other-requirements.txt +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/tests/data/pyproject.toml +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/tests/data/pyproject_compatible.toml +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/tests/data/requirements.txt +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/tests/test_latest.py +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/tests/test_pyproject_toml.py +0 -0
- {python_update_checker-0.7 → python_update_checker-0.9.0}/tests/test_requirements_txt.py +0 -0
|
@@ -19,8 +19,6 @@ MAKEFLAGS += --no-builtin-rules
|
|
|
19
19
|
PROJECT:=$(shell egrep "^name[[:space:]]*=" pyproject.toml | cut -d'"' -f2)
|
|
20
20
|
VERSION:=$(shell egrep "^version[[:space:]]*=" pyproject.toml | cut -d'"' -f2)
|
|
21
21
|
|
|
22
|
-
# exclude packages that are newer than this
|
|
23
|
-
EXCLUDE_NEWER:="7 days"
|
|
24
22
|
# Pytest options:
|
|
25
23
|
# --full-trace: print full stacktrace on errors
|
|
26
24
|
PYTESTOPTS?=--full-trace
|
|
@@ -57,6 +55,15 @@ init: ## install python virtual env and required development packages
|
|
|
57
55
|
uv sync
|
|
58
56
|
|
|
59
57
|
|
|
58
|
+
############ Versioning ############
|
|
59
|
+
|
|
60
|
+
bumpversion-major: _bumpversion-major ## bump major version
|
|
61
|
+
bumpversion-minor: _bumpversion-minor ## bump minor version
|
|
62
|
+
|
|
63
|
+
_bumpversion-%: ## shortcut target for bumpversion
|
|
64
|
+
bumpversion $*
|
|
65
|
+
|
|
66
|
+
|
|
60
67
|
############ Linting and syntax checks ############
|
|
61
68
|
|
|
62
69
|
.PHONY: lint
|
|
@@ -91,8 +98,6 @@ checkoutdated: checkoutdated-py checkoutdated-gh
|
|
|
91
98
|
|
|
92
99
|
checkoutdated-py: ## Check for outdated package requirements
|
|
93
100
|
uv run puc \
|
|
94
|
-
--exclude-newer $(EXCLUDE_NEWER) \
|
|
95
|
-
--exclude-newer-package "python-update-checker=1 minute" \
|
|
96
101
|
check pyproject.toml uv.lock
|
|
97
102
|
|
|
98
103
|
checkoutdated-gh: checkratelimit-gh ## check for outdated github projects
|
|
@@ -124,13 +129,9 @@ upgradeoutdated-gh: checkratelimit-gh
|
|
|
124
129
|
.PHONY: upgradeoutdated-py
|
|
125
130
|
upgradeoutdated-py: ## upgrade dependencies in pyproject.toml and uv.lock
|
|
126
131
|
# upgrade pyproject.toml dependencies
|
|
127
|
-
uv run puc
|
|
128
|
-
--exclude-newer $(EXCLUDE_NEWER) \
|
|
129
|
-
update pyproject.toml
|
|
132
|
+
uv run puc update pyproject.toml
|
|
130
133
|
# upgrade depencencies in uv lock file
|
|
131
|
-
uv lock
|
|
132
|
-
--exclude-newer $(EXCLUDE_NEWER) \
|
|
133
|
-
--upgrade
|
|
134
|
+
uv lock --upgrade
|
|
134
135
|
# install upgraded package versions in virtual environment
|
|
135
136
|
$(MAKE) init
|
|
136
137
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-update-checker"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.9.0"
|
|
4
4
|
readme = "README.md"
|
|
5
5
|
requires-python = ">=3.11"
|
|
6
6
|
license = "GPL-3.0-only"
|
|
@@ -24,9 +24,10 @@ puc = "puc:cli.main"
|
|
|
24
24
|
|
|
25
25
|
[dependency-groups]
|
|
26
26
|
dev = [
|
|
27
|
+
"bump2version==1.0.1",
|
|
27
28
|
"pytest==9.1.1",
|
|
28
|
-
"ruff==0.16.
|
|
29
|
-
"rumdl==0.2.
|
|
29
|
+
"ruff==0.16.5",
|
|
30
|
+
"rumdl==0.2.62",
|
|
30
31
|
"tombi==1.4.1",
|
|
31
32
|
"ty==0.0.75",
|
|
32
33
|
"zizmor==1.29.0",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-update-checker"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.9.0"
|
|
4
4
|
readme = "README.md"
|
|
5
5
|
requires-python = ">=3.11"
|
|
6
6
|
license = "GPL-3.0-only"
|
|
@@ -31,12 +31,14 @@ puc = "puc:cli.main"
|
|
|
31
31
|
[dependency-groups]
|
|
32
32
|
# these packages are only needed for development
|
|
33
33
|
dev = [
|
|
34
|
+
# for upgrading the version number
|
|
35
|
+
"bump2version==1.0.1",
|
|
34
36
|
# for testing
|
|
35
37
|
"pytest==9.1.1",
|
|
36
38
|
# for python code linting
|
|
37
|
-
"ruff==0.16.
|
|
39
|
+
"ruff==0.16.5",
|
|
38
40
|
# Markdown style checking and formatting
|
|
39
|
-
"rumdl==0.2.
|
|
41
|
+
"rumdl==0.2.62",
|
|
40
42
|
# reformat toml files
|
|
41
43
|
"tombi==1.4.1",
|
|
42
44
|
# for python type checking
|
|
@@ -36,13 +36,12 @@ DOWNLOAD_URL_UV=https://github.com/astral-sh/uv/releases/download/${UV_VER}/uv-x
|
|
|
36
36
|
CURL_OPTS=("--location" "--silent" "--show-error" "--retry" "2" "--fail" "--tlsv1.2" "--proto" "=https")
|
|
37
37
|
REINSTALL_PYTHON=0
|
|
38
38
|
|
|
39
|
-
|
|
40
39
|
#### helper functions
|
|
41
40
|
|
|
42
41
|
# Install a debian package
|
|
43
42
|
install_package() {
|
|
44
43
|
local pkg=$1
|
|
45
|
-
if ! dpkg --status "${pkg}"
|
|
44
|
+
if ! dpkg --status "${pkg}" > /dev/null 2>&1; then
|
|
46
45
|
echo "Installing ${pkg}"
|
|
47
46
|
sudo apt-get install --assume-yes "${pkg}"
|
|
48
47
|
fi
|
|
@@ -70,16 +69,22 @@ if [ ! -d bin ]; then
|
|
|
70
69
|
fi
|
|
71
70
|
if [ ! -f bin/uv ]; then
|
|
72
71
|
echo "Install uv ${UV_VER} from ${DOWNLOAD_URL_UV}"
|
|
73
|
-
(
|
|
72
|
+
(
|
|
73
|
+
cd bin
|
|
74
|
+
curl "${CURL_OPTS[@]}" "${DOWNLOAD_URL_UV}" | tar xzv --strip-components 1
|
|
75
|
+
)
|
|
74
76
|
elif [ "$(bin/uv --version | cut -d" " -f2)" != "${UV_VER}" ]; then
|
|
75
77
|
echo "Updating $(bin/uv --version) to ${UV_VER} from ${DOWNLOAD_URL_UV}"
|
|
76
|
-
(
|
|
78
|
+
(
|
|
79
|
+
cd bin
|
|
80
|
+
curl "${CURL_OPTS[@]}" "${DOWNLOAD_URL_UV}" | tar xzv --strip-components 1
|
|
81
|
+
)
|
|
77
82
|
# new uv versions might use new versions from python-build-standalone
|
|
78
83
|
REINSTALL_PYTHON=1
|
|
79
84
|
fi
|
|
80
85
|
|
|
81
86
|
# add local development environment for direnv
|
|
82
|
-
if ! declare -F _direnv_hook
|
|
87
|
+
if ! declare -F _direnv_hook > /dev/null; then
|
|
83
88
|
eval "$(direnv hook bash)"
|
|
84
89
|
fi
|
|
85
90
|
if [ ! -f .envrc ]; then
|
|
@@ -87,7 +92,7 @@ if [ ! -f .envrc ]; then
|
|
|
87
92
|
echo "# to find local tools"
|
|
88
93
|
echo "export PATH=${PROJECTDIR}/bin\${PATH:+:\$PATH}"
|
|
89
94
|
echo "export PATH=${PROJECTDIR}/.venv/bin\${PATH:+:\$PATH}"
|
|
90
|
-
|
|
95
|
+
) > .envrc
|
|
91
96
|
direnv allow .
|
|
92
97
|
source .envrc
|
|
93
98
|
fi
|
|
@@ -97,7 +102,7 @@ if [ ! -f .python-version ]; then
|
|
|
97
102
|
echo "Generating $PROJECTDIR/.python-version"
|
|
98
103
|
echo "${PY_VER}" > .python-version
|
|
99
104
|
else
|
|
100
|
-
PROJ_PY_VER=$(
|
|
105
|
+
PROJ_PY_VER=$(< .python-version)
|
|
101
106
|
if [ ".$PROJ_PY_VER" != ".$PY_VER" ]; then
|
|
102
107
|
echo "Updating $PROJECTDIR/.python-version (${PROJ_PY_VER} -> ${PY_VER})"
|
|
103
108
|
echo "${PY_VER}" >| .python-version
|
|
@@ -21,6 +21,7 @@ from .logging import logger
|
|
|
21
21
|
from .pyprojecttoml import handle_pyproject_toml
|
|
22
22
|
from .requirementstxt import handle_requirements_txt
|
|
23
23
|
from .uvlock import handle_uv_lock
|
|
24
|
+
from . import __version__
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
def usage(msg: str | None = None) -> None:
|
|
@@ -94,6 +95,13 @@ def get_option_parser() -> argparse.ArgumentParser:
|
|
|
94
95
|
default=False,
|
|
95
96
|
help="Print debug messages.",
|
|
96
97
|
)
|
|
98
|
+
parser.add_argument(
|
|
99
|
+
"--version",
|
|
100
|
+
action="store_true",
|
|
101
|
+
dest="version",
|
|
102
|
+
default=False,
|
|
103
|
+
help="Print version and exit.",
|
|
104
|
+
)
|
|
97
105
|
subparsers = parser.add_subparsers(help='commands', dest='command')
|
|
98
106
|
parser_check = subparsers.add_parser('check', help='check for updated versions')
|
|
99
107
|
parser_check.add_argument(
|
|
@@ -174,7 +182,6 @@ def handle_dependency_file(dep_file: str, optargs, constraint_file):
|
|
|
174
182
|
|
|
175
183
|
def main() -> int:
|
|
176
184
|
"""Parse options and check or update dependencies."""
|
|
177
|
-
logger.info(f"{shlex.join(sys.argv)}")
|
|
178
185
|
# parse options
|
|
179
186
|
try:
|
|
180
187
|
optargs = get_option_parser().parse_args(sys.argv[1:])
|
|
@@ -182,8 +189,13 @@ def main() -> int:
|
|
|
182
189
|
logger.exception(exc)
|
|
183
190
|
usage()
|
|
184
191
|
# handle options
|
|
192
|
+
if optargs.version:
|
|
193
|
+
print(__version__)
|
|
194
|
+
return 0
|
|
185
195
|
if optargs.debug:
|
|
186
196
|
logger.setLevel(logging.DEBUG)
|
|
197
|
+
logger.info(f"{shlex.join(sys.argv)}")
|
|
198
|
+
logger.debug(f"puc version {__version__}")
|
|
187
199
|
remove_constraint_file = False
|
|
188
200
|
constraints = optargs.constraints
|
|
189
201
|
constraint_file = None
|
|
@@ -49,12 +49,25 @@ def handle_uv_lock(
|
|
|
49
49
|
if version is None:
|
|
50
50
|
logger.warning(f"missing version in package {uvpackage}")
|
|
51
51
|
continue
|
|
52
|
+
# respect package filter
|
|
53
|
+
if packages and canonicalize_name(name) not in packages:
|
|
54
|
+
logger.info(f"skip package {name} due to package filter")
|
|
55
|
+
continue
|
|
56
|
+
# skip virtual packages (ie. the project itself)
|
|
57
|
+
source = uvpackage.get("source", {})
|
|
58
|
+
# skip virtual packages (ie. the project itself)
|
|
59
|
+
if "virtual" in source:
|
|
60
|
+
logger.info(f"skip virtual package {name}")
|
|
61
|
+
continue
|
|
62
|
+
# skip editable packages
|
|
63
|
+
if "editable" in source:
|
|
64
|
+
logger.info(f"skip editable package {name}")
|
|
65
|
+
continue
|
|
52
66
|
updatable += update_uvlock_dependency(
|
|
53
67
|
name,
|
|
54
68
|
version,
|
|
55
69
|
project_dir,
|
|
56
70
|
command=command,
|
|
57
|
-
packages=packages,
|
|
58
71
|
exclude_newer=exclude_newer,
|
|
59
72
|
exclude_newer_package=exclude_newer_package,
|
|
60
73
|
constraint_file=constraint_file,
|
|
@@ -70,17 +83,12 @@ def update_uvlock_dependency(
|
|
|
70
83
|
version,
|
|
71
84
|
project_dir: str,
|
|
72
85
|
command: str | None = None,
|
|
73
|
-
packages=None,
|
|
74
86
|
exclude_newer: str | None = None,
|
|
75
87
|
exclude_newer_package: str | None = None,
|
|
76
88
|
constraint_file: str | None = None,
|
|
77
89
|
color: bool = True,
|
|
78
90
|
) -> int:
|
|
79
91
|
"""Update uv lock dependency."""
|
|
80
|
-
# respect optional package filter
|
|
81
|
-
if packages and canonicalize_name(package) not in packages:
|
|
82
|
-
return 0
|
|
83
|
-
|
|
84
92
|
try:
|
|
85
93
|
latest_version = get_latest_version(
|
|
86
94
|
package,
|
|
@@ -50,3 +50,13 @@ wheels = [
|
|
|
50
50
|
{ url = "https://files.pythonhosted.org/packages/d2/ef/3ef01c17785ff9a69378465c7d0faccd48a07b163554db0995e5d65a5a23/ty-0.0.29-py3-none-win_amd64.whl", hash = "sha256:fc1294200226b91615acbf34e0a9ad81caf98c081e9c6a912a31b0a7b603bc3f", size = 11023644, upload-time = "2026-04-05T15:01:04.432Z" },
|
|
51
51
|
{ url = "https://files.pythonhosted.org/packages/2c/55/87280a994d6a2d2647c65e12abbc997ed49835794366153c04c4d9304d76/ty-0.0.29-py3-none-win_arm64.whl", hash = "sha256:f9794bbd1bb3ce13f78c191d0c89ae4c63f52c12b6daa0c6fe220b90d019d12c", size = 10428165, upload-time = "2026-04-05T15:01:34.665Z" },
|
|
52
52
|
]
|
|
53
|
+
|
|
54
|
+
[[package]]
|
|
55
|
+
name = "imadoofus"
|
|
56
|
+
version = "1.1.1"
|
|
57
|
+
source = { virtual = "." }
|
|
58
|
+
|
|
59
|
+
[[package]]
|
|
60
|
+
name = "imabellend"
|
|
61
|
+
version = "1.1.1"
|
|
62
|
+
source = { editable = "." }
|
|
@@ -34,6 +34,8 @@ class UvLockTest(unittest.TestCase):
|
|
|
34
34
|
self.assertTrue(result.returncode > 0)
|
|
35
35
|
self.assertIn("found update 'ty==", output)
|
|
36
36
|
self.assertIn("found update 'ruff==", output)
|
|
37
|
+
self.assertIn("skip virtual package imadoofus", output)
|
|
38
|
+
self.assertIn("skip editable package imabellend", output)
|
|
37
39
|
|
|
38
40
|
@needs_program('uv')
|
|
39
41
|
def test_uvlock_check_package(self):
|
|
File without changes
|
|
File without changes
|
|
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.7 → python_update_checker-0.9.0}/tests/data/pyproject_compatible.toml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|