diff --git a/src/modules/actions/__init__.py b/src/modules/actions/__init__.py index e85e625e8..4c00c6010 100644 --- a/src/modules/actions/__init__.py +++ b/src/modules/actions/__init__.py @@ -253,7 +253,7 @@ def __str__(self): # This must be imported *after* all of the exception classes are defined as # _actions module init needs the exception objects. -from ._actions import fromstr +from pkg.actions._actions import fromstr def attrsfromstr(string): diff --git a/src/modules/actions/attribute.py b/src/modules/actions/attribute.py index aa5125e12..5d29582b2 100644 --- a/src/modules/actions/attribute.py +++ b/src/modules/actions/attribute.py @@ -30,7 +30,7 @@ attribute of a package (package metadata). Attributes are typed, and the possible types are: XXX.""" -from . import generic +from pkg.actions import generic import pkg.fmri import pkg.actions diff --git a/src/modules/actions/depend.py b/src/modules/actions/depend.py index 841e1927b..723caa06b 100644 --- a/src/modules/actions/depend.py +++ b/src/modules/actions/depend.py @@ -31,7 +31,7 @@ relationship between the package containing the action and another package. """ -from . import generic +from pkg.actions import generic import re import pkg.actions diff --git a/src/modules/actions/directory.py b/src/modules/actions/directory.py index 0f420476d..d1e226a71 100644 --- a/src/modules/actions/directory.py +++ b/src/modules/actions/directory.py @@ -30,7 +30,7 @@ directory-type packaging object.""" import errno -from . import generic +from pkg.actions import generic import os import pkg.portable as portable import pkg.actions diff --git a/src/modules/actions/driver.py b/src/modules/actions/driver.py index eb9660a84..315641b78 100644 --- a/src/modules/actions/driver.py +++ b/src/modules/actions/driver.py @@ -31,7 +31,7 @@ """ import os -from . import generic +from pkg.actions import generic from tempfile import mkstemp diff --git a/src/modules/actions/file.py b/src/modules/actions/file.py index 22362507f..80b70522f 100644 --- a/src/modules/actions/file.py +++ b/src/modules/actions/file.py @@ -30,7 +30,7 @@ packaging object.""" import errno -from . import generic +from pkg.actions import generic import os import stat import tempfile @@ -38,7 +38,7 @@ import zlib import time -from . import _common +from pkg.actions import _common import pkg.actions import pkg.client.api_errors as api_errors import pkg.digest as digest diff --git a/src/modules/actions/generic.py b/src/modules/actions/generic.py index 47f4ac388..33d1f3bc5 100644 --- a/src/modules/actions/generic.py +++ b/src/modules/actions/generic.py @@ -47,7 +47,7 @@ import pkg.portable as portable import pkg.variant as variant -from . import _common +from pkg.actions import _common from pkg.misc import EmptyDict, CMP_ALL, CMP_UNSIGNED # Directories must precede all filesystem object actions; hardlinks must follow diff --git a/src/modules/actions/group.py b/src/modules/actions/group.py index 6881f8cce..b4ed1aec8 100644 --- a/src/modules/actions/group.py +++ b/src/modules/actions/group.py @@ -30,7 +30,7 @@ packaging object. This contains the attributes necessary to create a new user.""" -from . import generic +from pkg.actions import generic try: from pkg.cfgfiles import * diff --git a/src/modules/actions/hardlink.py b/src/modules/actions/hardlink.py index 9d3e95950..db4e424f2 100644 --- a/src/modules/actions/hardlink.py +++ b/src/modules/actions/hardlink.py @@ -30,7 +30,7 @@ packaging object.""" import errno -from . import generic, link +from pkg.actions import generic, link import os import stat diff --git a/src/modules/actions/legacy.py b/src/modules/actions/legacy.py index a151c5449..86c06a10f 100644 --- a/src/modules/actions/legacy.py +++ b/src/modules/actions/legacy.py @@ -36,7 +36,7 @@ import itertools import time -from . import generic +from pkg.actions import generic from pkg import misc diff --git a/src/modules/actions/license.py b/src/modules/actions/license.py index 95ccb2302..e5fea1cb1 100644 --- a/src/modules/actions/license.py +++ b/src/modules/actions/license.py @@ -35,7 +35,7 @@ import os from stat import S_IWRITE, S_IREAD -from . import generic +from pkg.actions import generic import pkg.digest as digest import pkg.misc as misc import pkg.portable as portable diff --git a/src/modules/actions/link.py b/src/modules/actions/link.py index ccd4bbd68..56eace556 100644 --- a/src/modules/actions/link.py +++ b/src/modules/actions/link.py @@ -33,7 +33,7 @@ import os import stat -from . import generic +from pkg.actions import generic import pkg.actions import pkg.mediator as med diff --git a/src/modules/actions/signature.py b/src/modules/actions/signature.py index 24133e212..53629d45d 100644 --- a/src/modules/actions/signature.py +++ b/src/modules/actions/signature.py @@ -37,7 +37,7 @@ from cryptography.hazmat.primitives import serialization, hashes from cryptography.hazmat.primitives.asymmetric import padding -from . import generic +from pkg.actions import generic import pkg.actions import pkg.client.api_errors as apx import pkg.digest as digest diff --git a/src/modules/actions/unknown.py b/src/modules/actions/unknown.py index b27babef9..3098a43c9 100644 --- a/src/modules/actions/unknown.py +++ b/src/modules/actions/unknown.py @@ -31,7 +31,7 @@ publishing transaction is not given enough information to determine what type of object it is. No datastreams or attributes aside from a path are stored.""" -from . import generic +from pkg.actions import generic class UnknownAction(generic.Action): diff --git a/src/modules/actions/user.py b/src/modules/actions/user.py index 938a78730..d1c318086 100644 --- a/src/modules/actions/user.py +++ b/src/modules/actions/user.py @@ -30,7 +30,7 @@ packaging object. This contains the attributes necessary to create a new user.""" -from . import generic +from pkg.actions import generic try: from pkg.cfgfiles import * diff --git a/src/modules/client/linkedimage/system.py b/src/modules/client/linkedimage/system.py index 2cc44ae62..8682cef5e 100644 --- a/src/modules/client/linkedimage/system.py +++ b/src/modules/client/linkedimage/system.py @@ -21,7 +21,7 @@ # # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2024, Oracle and/or its affiliates. # """ @@ -34,7 +34,7 @@ import pkg.client.pkgdefs as pkgdefs # import linked image common code -from . import common as li # Relative import; pylint: disable=W0403 +from pkg.client.linkedimage import common as li class LinkedImageSystemPlugin(li.LinkedImagePlugin): diff --git a/src/modules/client/linkedimage/zone.py b/src/modules/client/linkedimage/zone.py index 8ec564ece..00608b632 100644 --- a/src/modules/client/linkedimage/zone.py +++ b/src/modules/client/linkedimage/zone.py @@ -45,11 +45,7 @@ from pkg.client.debugvalues import DebugValues # import linked image common code -from . import common as li # Relative import; pylint: disable=W0403 - -# W0511 XXX / FIXME Comments; pylint: disable=W0511 -# XXX: should be defined by libzonecfg python wrapper -# pylint: enable=W0511 +from pkg.client.linkedimage import common as li ZONE_GLOBAL = "global" diff --git a/src/modules/portable/__init__.py b/src/modules/portable/__init__.py index e08493165..d3ac212c8 100644 --- a/src/modules/portable/__init__.py +++ b/src/modules/portable/__init__.py @@ -289,7 +289,7 @@ def get_sysattr_dict(): PD_BYPASS_GENERATE = "pkg.depend.bypass-generate" import platform -from . import util as os_util +from pkg.portable import util as os_util osname = os_util.get_canonical_os_name() ostype = os_util.get_canonical_os_type() @@ -302,7 +302,7 @@ def get_sysattr_dict(): # then try the more generic OS Name module (e.g. os_linux), # then the OS type module (e.g. os_unix) try: - exec("from .{0} import *".format(modname)) + exec("from pkg.portable.{0} import *".format(modname)) break except ImportError: pass diff --git a/src/modules/portable/os_aix.py b/src/modules/portable/os_aix.py index da2109674..2b7db32a2 100644 --- a/src/modules/portable/os_aix.py +++ b/src/modules/portable/os_aix.py @@ -29,7 +29,7 @@ import os import errno -from .os_unix import ( +from pkg.portable.os_unix import ( get_isainfo, get_release, get_platform, diff --git a/src/modules/portable/os_darwin.py b/src/modules/portable/os_darwin.py index fd4e672f4..83051ced5 100644 --- a/src/modules/portable/os_darwin.py +++ b/src/modules/portable/os_darwin.py @@ -28,7 +28,7 @@ below override the definitions from os_unix """ -from .os_unix import ( +from pkg.portable.os_unix import ( get_isainfo, get_release, get_platform, diff --git a/src/modules/portable/os_sunos.py b/src/modules/portable/os_sunos.py index fae7494a5..04f0a04ed 100644 --- a/src/modules/portable/os_sunos.py +++ b/src/modules/portable/os_sunos.py @@ -34,7 +34,7 @@ import subprocess import tempfile -from .os_unix import ( +from pkg.portable.os_unix import ( get_group_by_name, get_user_by_name, get_name_by_gid, diff --git a/src/modules/portable/os_unix.py b/src/modules/portable/os_unix.py index eaa600cf7..210d2ab9d 100644 --- a/src/modules/portable/os_unix.py +++ b/src/modules/portable/os_unix.py @@ -40,7 +40,7 @@ import stat import sys import tempfile -from . import util as os_util +from pkg.portable import util as os_util # used to cache contents of passwd and group files users = {} diff --git a/src/modules/portable/os_windows.py b/src/modules/portable/os_windows.py index 3786f1294..d5aaaa7ae 100644 --- a/src/modules/portable/os_windows.py +++ b/src/modules/portable/os_windows.py @@ -39,7 +39,7 @@ import stat import tempfile import threading -from . import util as os_util +from pkg.portable import util as os_util def get_isainfo(): diff --git a/src/pkg/manifests/package:pkg.p5m b/src/pkg/manifests/package:pkg.p5m index 55122ea9b..6dd3064ff 100644 --- a/src/pkg/manifests/package:pkg.p5m +++ b/src/pkg/manifests/package:pkg.p5m @@ -22,16 +22,6 @@ # Copyright (c) 2012, OmniTI Computer Consulting, Inc. All rights reserved. # Copyright 2024 OmniOS Community Edition (OmniOSce) Association. # -# -# pkgdepend doesn't understand the relative import syntax "from .x import y", -# so we have to bypass generating dependencies on those files. - \ - set pkg.depend.bypass-generate .*> - \ - set pkg.depend.bypass-generate .*> - \ - set pkg.depend.bypass-generate .*> -# # When packaging for aarch64, we need to skip the dependency check on libm.so.0 \ set pkg.depend.bypass-generate libm.so.0> @@ -104,7 +94,7 @@ file path=$(PYDIRVP)/pkg/client/client_api.py file path=$(PYDIRVP)/pkg/client/debugvalues.py file path=$(PYDIRVP)/pkg/client/firmware.py file path=$(PYDIRVP)/pkg/client/history.py -file path=$(PYDIRVP)/pkg/client/image.py pkg.depend.bypass-generate=.* +file path=$(PYDIRVP)/pkg/client/image.py file path=$(PYDIRVP)/pkg/client/imageconfig.py file path=$(PYDIRVP)/pkg/client/imageplan.py file path=$(PYDIRVP)/pkg/client/imagetypes.py @@ -122,7 +112,7 @@ file path=$(PYDIRVP)/pkg/client/pkgremote.py file path=$(PYDIRVP)/pkg/client/plandesc.py file path=$(PYDIRVP)/pkg/client/printengine.py file path=$(PYDIRVP)/pkg/client/progress.py -file path=$(PYDIRVP)/pkg/client/publisher.py pkg.depend.bypass-generate=.* +file path=$(PYDIRVP)/pkg/client/publisher.py file path=$(PYDIRVP)/pkg/client/query_parser.py file path=$(PYDIRVP)/pkg/client/sigpolicy.py dir path=$(PYDIRVP)/pkg/client/transport @@ -133,8 +123,7 @@ file path=$(PYDIRVP)/pkg/client/transport/fileobj.py file path=$(PYDIRVP)/pkg/client/transport/mdetect.py file path=$(PYDIRVP)/pkg/client/transport/repo.py file path=$(PYDIRVP)/pkg/client/transport/stats.py -file path=$(PYDIRVP)/pkg/client/transport/transport.py \ - pkg.depend.bypass-generate=.* +file path=$(PYDIRVP)/pkg/client/transport/transport.py file path=$(PYDIRVP)/pkg/config.py file path=$(PYDIRVP)/pkg/cpiofile.py file path=$(PYDIRVP)/pkg/dependency.py @@ -183,10 +172,12 @@ file path=$(PYDIRVP)/pkg/pkgtarfile.py dir path=$(PYDIRVP)/pkg/portable file path=$(PYDIRVP)/pkg/portable/__init__.py file path=$(PYDIRVP)/pkg/portable/os_aix.py -file path=$(PYDIRVP)/pkg/portable/os_darwin.py +file path=$(PYDIRVP)/pkg/portable/os_darwin.py \ + pkg.depend.bypass-generate=.*macostools.* file path=$(PYDIRVP)/pkg/portable/os_sunos.py file path=$(PYDIRVP)/pkg/portable/os_unix.py -file path=$(PYDIRVP)/pkg/portable/os_windows.py +file path=$(PYDIRVP)/pkg/portable/os_windows.py \ + pkg.depend.bypass-generate=.*win32api.* file path=$(PYDIRVP)/pkg/portable/util.py file path=$(PYDIRVP)/pkg/pspawn.py dir path=$(PYDIRVP)/pkg/publish @@ -201,11 +192,11 @@ file path=$(PYDIRVP)/pkg/server/__init__.py file path=$(PYDIRVP)/pkg/server/api.py file path=$(PYDIRVP)/pkg/server/api_errors.py file path=$(PYDIRVP)/pkg/server/catalog.py -file path=$(PYDIRVP)/pkg/server/depot.py pkg.depend.bypass-generate=.* +file path=$(PYDIRVP)/pkg/server/depot.py file path=$(PYDIRVP)/pkg/server/face.py file path=$(PYDIRVP)/pkg/server/feed.py file path=$(PYDIRVP)/pkg/server/query_parser.py -file path=$(PYDIRVP)/pkg/server/repository.py pkg.depend.bypass-generate=.* +file path=$(PYDIRVP)/pkg/server/repository.py file path=$(PYDIRVP)/pkg/server/transaction.py file path=$(PYDIRVP)/pkg/sha512_t.py dir path=$(PYDIRVP)/pkg/site_paths @@ -215,7 +206,7 @@ file path=$(PYDIRVP)/pkg/solver.cpython$(PYPKGVERS)-$(TRIPLE).so file path=$(PYDIRVP)/pkg/sysattr.py file path=$(PYDIRVP)/pkg/syscallat.py file path=$(PYDIRVP)/pkg/sysvpkg.py -file path=$(PYDIRVP)/pkg/updatelog.py pkg.depend.bypass-generate=.* +file path=$(PYDIRVP)/pkg/updatelog.py file path=$(PYDIRVP)/pkg/variant.py file path=$(PYDIRVP)/pkg/version.py dir path=etc