Skip to content

Commit

Permalink
37309790 pkg(7) utilities to switch to Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
kulikjak committed Nov 25, 2024
1 parent a8807d0 commit 7605072
Show file tree
Hide file tree
Showing 31 changed files with 42 additions and 41 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The above will run all test cases in 8 parallel processes. Other options are als
Tests running can also be done by using make:
> $cd src; sudo make test
Make targets test-37 and test-39 are available for testing specific Python versions.
Make targets test-39 and test-311 are available for testing specific Python versions.

IPS applications and libraries can be packaged and published into an IPS repository using:
> $cd src; make packages;
Expand Down Expand Up @@ -85,7 +85,7 @@ security vulnerability reporting and disclosure process.

## License

Copyright (c) 2010, 2023, Oracle and/or its affiliates.
Copyright (c) 2010, 2024, Oracle and/or its affiliates.

The Image Packaging System is primarily distributed under the terms of the CDDL (Common Development and Distribution License), with a few portions covered by BSD-style or MIT-style licenses.

Expand Down
10 changes: 5 additions & 5 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ INSTALL = $(STASH) file -v
MKDIR = mkdir -p

PROTO_AREA:sh = echo $(dirname $(pwd))/proto/root_$(uname -p)
PROTO_VENDOR_PACKAGES = $(PROTO_AREA)/usr/lib/python3.9/vendor-packages
PROTO_VENDOR_PACKAGES = $(PROTO_AREA)/usr/lib/python3.11/vendor-packages

RESOURCE_DIR = $(PROTO_AREA)/usr/share/lib/pkg
TRANSFORM_DIR = $(PROTO_AREA)/usr/share/pkg/transforms
Expand Down Expand Up @@ -209,7 +209,7 @@ $(LINT)CLINT = lint
CLINT = $(LINT)

CLINT_FLAGS = -m64 -u -axms -erroff=E_NAME_DEF_NOT_USED2
CLINT_INCLUDES = -Imodules -I/usr/include/python3.9
CLINT_INCLUDES = -Imodules -I/usr/include/python3.11

# Runs lint tools over IPS C extension source code.
clint: cffi_src modules
Expand All @@ -227,18 +227,18 @@ clint: cffi_src modules
#
pylint:
PYTHONPATH=$(PROTO_VENDOR_PACKAGES):tests \
$(PYTHON39) -m pylint --rcfile tests/pylintrc $(PYLINT_TARGETS)
$(PYTHON311) -m pylint --rcfile tests/pylintrc $(PYLINT_TARGETS)

# A note about bandit baselines: bandit will report new errors but it
# will not fail on a new duplicate issues (bandit bugs: 466 and 558)

bandit:
$(PYTHON39) -m bandit -r -q -c tests/banditrc . -b tests/bandit-baseline.json
$(PYTHON311) -m bandit -r -q -c tests/banditrc . -b tests/bandit-baseline.json

# When generating a baseline, if there are warnings/errors
# bandit will exit with a value of 1.
regen-bandit:
$(PYTHON39) -m bandit -r -q -c tests/banditrc . -o tests/bandit-baseline.json -f json || true
$(PYTHON311) -m bandit -r -q -c tests/banditrc . -o tests/bandit-baseline.json -f json || true

check: $(SUBDIRS)
$(PYCODESTYLE) --statistics --count `cat tests/pycodestyle-whitelist.txt`
Expand Down
2 changes: 1 addition & 1 deletion src/cffi_src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $(LINT)CLINT = lint
CLINT = $(LINT)

CLINT_FLAGS = -m64 -u -axms -erroff=E_NAME_DEF_NOT_USED2
CLINT_INCLUDES = -I/usr/include/python3.9
CLINT_INCLUDES = -I/usr/include/python3.11

clint: all
$(CLINT) $(CLINT_FLAGS) $(CLINT_INCLUDES) _arch.c
Expand Down
2 changes: 1 addition & 1 deletion src/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/depot-config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/depot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ $(LINT)CLINT = lint
CLINT = $(LINT)

CLINT_FLAGS = -m64 -u -axms -erroff=E_NAME_DEF_NOT_USED2
CLINT_INCLUDES = -I/usr/include/python3.9 -I.
CLINT_INCLUDES = -I/usr/include/python3.11 -I.

clint: all
$(CLINT) $(CLINT_FLAGS) $(CLINT_INCLUDES) -lelf -lmd elf.c elfextract.c liblist.c
Expand Down
6 changes: 3 additions & 3 deletions src/pkg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
# CDDL HEADER END
#
# Copyright (c) 2010, 2023, Oracle and/or its affiliates.
# Copyright (c) 2010, 2024, Oracle and/or its affiliates.
#

PKGVERS_BUILTON = 5.11
Expand Down Expand Up @@ -97,11 +97,11 @@ PYTHON311 = python3.11
PY311DIR = usr/lib/$(PYTHON311)
PY311DIRVP = $(PY311DIR)/vendor-packages

PYDIR = usr/lib/$(PYTHON39)
PYDIR = usr/lib/$(PYTHON311)
PYDIRVP = $(PYDIR)/vendor-packages
PKGCMDENV = \
PATH=$(PKGROOT)/usr/bin:/usr/sbin:/usr/bin \
PYTHONPATH=$(PKGROOT)/$(PYDIRVP) $(PYTHON39) $(PKGROOT)/usr/bin/
PYTHONPATH=$(PKGROOT)/$(PYDIRVP) $(PYTHON311) $(PKGROOT)/usr/bin/
PKG = $(PKGCMDENV)/pkg
PKGDEPEND = $(PKGCMDENV)/pkgdepend
PKGDIFF = $(PKGCMDENV)/pkgdiff
Expand Down
1 change: 1 addition & 0 deletions src/pkg/external_deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
# Only the variant used by pkg(7) utilities is listed here;
# this is to avoid unnecessary circular dependencies with ON.
pkg:/system/library/python/solaris-core-39
pkg:/system/library/python/solaris-core-311
pkg:/system/library/security/crypto
pkg:/system/library/smf
pkg:/system/linker
Expand Down
4 changes: 2 additions & 2 deletions src/pkg/manifests/package:pkg.p5m
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,12 @@ license lic_minisat license="MIT (MiniSAT)" com.oracle.info.baid=17890 \
com.oracle.info.description="MiniSAT 1.14.1" com.oracle.info.name=MiniSAT \
com.oracle.info.version=1.14.1
license cr_Oracle license=cr_Oracle
depend type=conditional fmri=package/pkg-311 predicate=runtime/python-311
depend type=conditional fmri=package/pkg-39 predicate=runtime/python-39
depend type=group fmri=package/pkg/zones-proxy \
variant.opensolaris.zone=nonglobal
# cross zone dependency on linked image metadata
depend type=parent fmri=feature/package/dependency/self \
variant.opensolaris.zone=nonglobal
depend type=require fmri=crypto/ca-certificates
# CFFI import is done in C code, so it isn't picked up by pkgdepend
depend type=require fmri=library/python/cffi-39@1.15.1
depend type=require fmri=library/python/cffi-311@1.15.1
4 changes: 2 additions & 2 deletions src/pkg/manifests/package:pkg:depot.p5m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
# CDDL HEADER END
#
# Copyright (c) 2013, 2023, Oracle and/or its affiliates.
# Copyright (c) 2013, 2024, Oracle and/or its affiliates.
#

set name=pkg.fmri value=pkg:/package/pkg/depot@$(PKGVERS)
Expand Down Expand Up @@ -71,4 +71,4 @@ license cr_Oracle license=cr_Oracle
depend type=require fmri=web/server/apache-24
depend type=require fmri=web/server/apache-24/module/apache-ssl
# p5p support in the system repository requires mod_wsgi
depend type=require fmri=web/server/apache-24/module/apache-wsgi-39
depend type=require fmri=web/server/apache-24/module/apache-wsgi-311
2 changes: 1 addition & 1 deletion src/pkg/manifests/package:pkg:system-repository.p5m
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ depend type=conditional fmri=web/server/apache-24/module/apache-ssl-fips-140 \
depend type=require fmri=web/server/apache-24
depend type=require fmri=web/server/apache-24/module/apache-ssl
# p5p support in the system repository requires mod_wsgi
depend type=require fmri=web/server/apache-24/module/apache-wsgi-39
depend type=require fmri=web/server/apache-24/module/apache-wsgi-311
2 changes: 1 addition & 1 deletion src/pkgdep.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/pkgrepo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/publish.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/pull.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/rad-invoke.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/sign.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/svc/svc-pkg-auto-update
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -uEs
#!/usr/bin/python3.11 -uEs
#
# CDDL HEADER START
#
Expand Down
4 changes: 2 additions & 2 deletions src/svc/svc-pkg-auto-update-cleanup
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -uEs
#!/usr/bin/python3.11 -uEs
#
# CDDL HEADER START
#
Expand All @@ -20,7 +20,7 @@
# CDDL HEADER END
#
#
# Copyright (c) 2019, 2023, Oracle and/or its affiliates.
# Copyright (c) 2019, 2024, Oracle and/or its affiliates.
#

import pkg.no_site_packages
Expand Down
2 changes: 1 addition & 1 deletion src/sysrepo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/util/log-scripts/log.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/util/publish/pkgdiff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/util/publish/pkgfmt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/util/publish/pkglint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -BEs
#!/usr/bin/python3.11 -BEs
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/util/publish/pkgmerge.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/util/publish/pkgmogrify.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/util/publish/pkgsurf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9 -Es
#!/usr/bin/python3.11 -Es
#
# CDDL HEADER START
#
Expand Down
2 changes: 1 addition & 1 deletion src/util/publish/update_file_layout.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9
#!/usr/bin/python3.11
#
# CDDL HEADER START
#
Expand Down
4 changes: 2 additions & 2 deletions src/util/qual-simulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
# CDDL HEADER END
#

# Copyright (c) 2009, 2023, Oracle and/or its affiliates.
# Copyright (c) 2009, 2024, Oracle and/or its affiliates.
#

run: stats.py
python3.9 scenario.py
python3.11 scenario.py

stats.py:
cp ../../modules/client/transport/stats.py .
Expand Down
2 changes: 1 addition & 1 deletion src/util/qual-simulator/scenario.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.9
#!/usr/bin/python3.11
#
# CDDL HEADER START
#
Expand Down

0 comments on commit 7605072

Please sign in to comment.