python-update-checker 0.7__tar.gz → 0.8.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.
Files changed (25) hide show
  1. {python_update_checker-0.7 → python_update_checker-0.8.0}/Makefile +11 -10
  2. {python_update_checker-0.7 → python_update_checker-0.8.0}/PKG-INFO +1 -1
  3. {python_update_checker-0.7 → python_update_checker-0.8.0}/pyproject.toml +2 -1
  4. {python_update_checker-0.7 → python_update_checker-0.8.0}/pyproject.toml.orig +3 -1
  5. {python_update_checker-0.7 → python_update_checker-0.8.0}/scripts/install_dev.sh +12 -7
  6. {python_update_checker-0.7 → python_update_checker-0.8.0}/src/puc/uvlock.py +9 -6
  7. {python_update_checker-0.7 → python_update_checker-0.8.0}/tests/data/uv.lock +5 -0
  8. {python_update_checker-0.7 → python_update_checker-0.8.0}/tests/test_uv_lock.py +1 -0
  9. {python_update_checker-0.7 → python_update_checker-0.8.0}/.gitignore +0 -0
  10. {python_update_checker-0.7 → python_update_checker-0.8.0}/.ruff.toml +0 -0
  11. {python_update_checker-0.7 → python_update_checker-0.8.0}/README.md +0 -0
  12. {python_update_checker-0.7 → python_update_checker-0.8.0}/src/puc/__init__.py +0 -0
  13. {python_update_checker-0.7 → python_update_checker-0.8.0}/src/puc/cli.py +0 -0
  14. {python_update_checker-0.7 → python_update_checker-0.8.0}/src/puc/dependencies.py +0 -0
  15. {python_update_checker-0.7 → python_update_checker-0.8.0}/src/puc/logging.py +0 -0
  16. {python_update_checker-0.7 → python_update_checker-0.8.0}/src/puc/pyprojecttoml.py +0 -0
  17. {python_update_checker-0.7 → python_update_checker-0.8.0}/src/puc/requirementstxt.py +0 -0
  18. {python_update_checker-0.7 → python_update_checker-0.8.0}/tests/__init__.py +0 -0
  19. {python_update_checker-0.7 → python_update_checker-0.8.0}/tests/data/other-requirements.txt +0 -0
  20. {python_update_checker-0.7 → python_update_checker-0.8.0}/tests/data/pyproject.toml +0 -0
  21. {python_update_checker-0.7 → python_update_checker-0.8.0}/tests/data/pyproject_compatible.toml +0 -0
  22. {python_update_checker-0.7 → python_update_checker-0.8.0}/tests/data/requirements.txt +0 -0
  23. {python_update_checker-0.7 → python_update_checker-0.8.0}/tests/test_latest.py +0 -0
  24. {python_update_checker-0.7 → python_update_checker-0.8.0}/tests/test_pyproject_toml.py +0 -0
  25. {python_update_checker-0.7 → python_update_checker-0.8.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
  Metadata-Version: 2.4
2
2
  Name: python-update-checker
3
- Version: 0.7
3
+ Version: 0.8.0
4
4
  License-Expression: GPL-3.0-only
5
5
  Classifier: Development Status :: 4 - Beta
6
6
  Classifier: Environment :: Console
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-update-checker"
3
- version = "0.7"
3
+ version = "0.8.0"
4
4
  readme = "README.md"
5
5
  requires-python = ">=3.11"
6
6
  license = "GPL-3.0-only"
@@ -24,6 +24,7 @@ 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
29
  "ruff==0.16.4",
29
30
  "rumdl==0.2.61",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-update-checker"
3
- version = "0.7"
3
+ version = "0.8.0"
4
4
  readme = "README.md"
5
5
  requires-python = ">=3.11"
6
6
  license = "GPL-3.0-only"
@@ -31,6 +31,8 @@ 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
@@ -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}" >/dev/null 2>&1; then
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
- (cd bin; curl "${CURL_OPTS[@]}" "${DOWNLOAD_URL_UV}" | tar xzv --strip-components 1)
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
- (cd bin; curl "${CURL_OPTS[@]}" "${DOWNLOAD_URL_UV}" | tar xzv --strip-components 1)
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 >/dev/null; then
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
- ) > .envrc
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=$(<.python-version)
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
@@ -49,12 +49,20 @@ 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
+ if "virtual" in source:
59
+ logger.info(f"skip virtual package {name}")
60
+ continue
52
61
  updatable += update_uvlock_dependency(
53
62
  name,
54
63
  version,
55
64
  project_dir,
56
65
  command=command,
57
- packages=packages,
58
66
  exclude_newer=exclude_newer,
59
67
  exclude_newer_package=exclude_newer_package,
60
68
  constraint_file=constraint_file,
@@ -70,17 +78,12 @@ def update_uvlock_dependency(
70
78
  version,
71
79
  project_dir: str,
72
80
  command: str | None = None,
73
- packages=None,
74
81
  exclude_newer: str | None = None,
75
82
  exclude_newer_package: str | None = None,
76
83
  constraint_file: str | None = None,
77
84
  color: bool = True,
78
85
  ) -> int:
79
86
  """Update uv lock dependency."""
80
- # respect optional package filter
81
- if packages and canonicalize_name(package) not in packages:
82
- return 0
83
-
84
87
  try:
85
88
  latest_version = get_latest_version(
86
89
  package,
@@ -50,3 +50,8 @@ 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 = "." }
@@ -34,6 +34,7 @@ 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)
37
38
 
38
39
  @needs_program('uv')
39
40
  def test_uvlock_check_package(self):