Mon Jul 3 20:58:48 2023 UTC ()
python-versions-check: update to 1.4.

Somenow not all of my intended changes this afternoon
made it into the commit.

Use issuperset() in more places, fix some messages.


(wiz)
diff -r1.4 -r1.5 pkgsrc/pkgtools/python-versions-check/Makefile
diff -r1.4 -r1.5 pkgsrc/pkgtools/python-versions-check/files/python-versions-check

cvs diff -r1.4 -r1.5 pkgsrc/pkgtools/python-versions-check/Makefile (expand / switch to unified diff)

--- pkgsrc/pkgtools/python-versions-check/Makefile 2023/07/03 17:40:11 1.4
+++ pkgsrc/pkgtools/python-versions-check/Makefile 2023/07/03 20:58:48 1.5
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1# $NetBSD: Makefile,v 1.4 2023/07/03 17:40:11 wiz Exp $ 1# $NetBSD: Makefile,v 1.5 2023/07/03 20:58:48 wiz Exp $
2 2
3PKGNAME= python-versions-check-1.3 3PKGNAME= python-versions-check-1.4
4CATEGORIES= pkgtools 4CATEGORIES= pkgtools
5 5
6MAINTAINER= wiz@NetBSD.org 6MAINTAINER= wiz@NetBSD.org
7HOMEPAGE= https://www.pkgsrc.org/ 7HOMEPAGE= https://www.pkgsrc.org/
8COMMENT= Tool for checking Python versions in dependencies 8COMMENT= Tool for checking Python versions in dependencies
9LICENSE= 2-clause-bsd 9LICENSE= 2-clause-bsd
10 10
11WRKSRC= ${WRKDIR} 11WRKSRC= ${WRKDIR}
12USE_LANGUAGES= # empty 12USE_LANGUAGES= # empty
13INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 13INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
14REPLACE_PYTHON+= python-versions-check 14REPLACE_PYTHON+= python-versions-check
15 15
16PYTHON_VERSIONS_INCOMPATIBLE= 27 16PYTHON_VERSIONS_INCOMPATIBLE= 27

cvs diff -r1.4 -r1.5 pkgsrc/pkgtools/python-versions-check/files/python-versions-check (expand / switch to unified diff)

--- pkgsrc/pkgtools/python-versions-check/files/python-versions-check 2023/07/03 17:40:11 1.4
+++ pkgsrc/pkgtools/python-versions-check/files/python-versions-check 2023/07/03 20:58:48 1.5
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1#!/usr/bin/env python3 1#!/usr/bin/env python3
2# 2#
3# $NetBSD: python-versions-check,v 1.4 2023/07/03 17:40:11 wiz Exp $ 3# $NetBSD: python-versions-check,v 1.5 2023/07/03 20:58:48 wiz Exp $
4# 4#
5# Copyright (c) 2023 The NetBSD Foundation, Inc. 5# Copyright (c) 2023 The NetBSD Foundation, Inc.
6# All rights reserved. 6# All rights reserved.
7# 7#
8# This code is derived from software contributed to The NetBSD Foundation 8# This code is derived from software contributed to The NetBSD Foundation
9# by Thomas Klausner. 9# by Thomas Klausner.
10# 10#
11# Redistribution and use in source and binary forms, with or without 11# Redistribution and use in source and binary forms, with or without
12# modification, are permitted provided that the following conditions 12# modification, are permitted provided that the following conditions
13# are met: 13# are met:
14# 1. Redistributions of source code must retain the above copyright 14# 1. Redistributions of source code must retain the above copyright
15# notice, this list of conditions and the following disclaimer. 15# notice, this list of conditions and the following disclaimer.
16# 2. Redistributions in binary form must reproduce the above copyright 16# 2. Redistributions in binary form must reproduce the above copyright
@@ -203,27 +203,27 @@ while searchlist: @@ -203,27 +203,27 @@ while searchlist:
203 if entry in result: 203 if entry in result:
204 continue 204 continue
205 result.add(entry) 205 result.add(entry)
206 searchlist |= extract_includes(args.pkgsrcdir + '/' + entry + '/Makefile') 206 searchlist |= extract_includes(args.pkgsrcdir + '/' + entry + '/Makefile')
207 207
208# print(f"dependencies for {args.package}: {sorted(result)}") 208# print(f"dependencies for {args.package}: {sorted(result)}")
209print(f"Supported Python versions for {args.package}: {sorted([int(x) for x in supported_versions(args.package)])}") 209print(f"Supported Python versions for {args.package}: {sorted([int(x) for x in supported_versions(args.package)])}")
210print(f"Checking packages used by {args.package}:") 210print(f"Checking packages used by {args.package}:")
211for entry in result: 211for entry in result:
212 entry_versions = supported_versions(entry) 212 entry_versions = supported_versions(entry)
213 if args.debug: 213 if args.debug:
214 print(f"DEBUG: comparing to {entry} - supports {entry_versions}") 214 print(f"DEBUG: comparing to {entry} - supports {entry_versions}")
215 if not entry_versions.issuperset(supported_versions(args.package)): 215 if not entry_versions.issuperset(supported_versions(args.package)):
216 report_problem(entry, entry_versions, entry_versions, supported_versions(args.package)) 216 report_problem(entry, entry_versions, supported_versions(args.package), entry_versions)
217 217
218makefiles = glob.glob(args.pkgsrcdir + '/*/*/Makefile*') 218makefiles = glob.glob(args.pkgsrcdir + '/*/*/Makefile*')
219makefiles.extend(glob.glob(args.pkgsrcdir + '/*/*/*.mk')) 219makefiles.extend(glob.glob(args.pkgsrcdir + '/*/*/*.mk'))
220makefiles = list(filter(lambda name: name.find('/mk/') == -1 220makefiles = list(filter(lambda name: name.find('/mk/') == -1
221 and not name.endswith('buildlink3.mk') 221 and not name.endswith('buildlink3.mk')
222 and not name.endswith('cargo-depends.mk') 222 and not name.endswith('cargo-depends.mk')
223 and not name.endswith('go-modules.mk'), 223 and not name.endswith('go-modules.mk'),
224 makefiles)) 224 makefiles))
225if not args.wip: 225if not args.wip:
226 makefiles = list(filter(lambda name: name.find('/wip/') == -1, makefiles)) 226 makefiles = list(filter(lambda name: name.find('/wip/') == -1, makefiles))
227 227
228print(f"Checking packages using {args.package}:") 228print(f"Checking packages using {args.package}:")
229checked_packages = set([]) 229checked_packages = set([])
@@ -233,17 +233,17 @@ for makefile in makefiles: @@ -233,17 +233,17 @@ for makefile in makefiles:
233 233
234searchlist = set([args.package]) 234searchlist = set([args.package])
235handled = set([]) 235handled = set([])
236while searchlist: 236while searchlist:
237 entry = searchlist.pop() 237 entry = searchlist.pop()
238 if entry in handled: 238 if entry in handled:
239 continue 239 continue
240 handled.add(entry) 240 handled.add(entry)
241 241
242 entry_versions = supported_versions(entry) 242 entry_versions = supported_versions(entry)
243 for package, dependencies in includes.items(): 243 for package, dependencies in includes.items():
244 if entry in dependencies: 244 if entry in dependencies:
245 package_versions = supported_versions(package) 245 package_versions = supported_versions(package)
246 if entry_versions < package_versions: 246 if not entry_versions.issuperset(package_versions):
247 report_problem(package, package_versions, package_versions, entry_versions) 247 report_problem(package, package_versions, entry_versions. package_versions)
248 python_versions[package] = entry_versions 248 python_versions[package] = entry_versions
249 searchlist.add(package) 249 searchlist.add(package)