Skip to content

Commit a7cf58d

Browse files
Refer to component plugins rather than package plugins throughout.
1 parent 796d269 commit a7cf58d

33 files changed

+239
-237
lines changed

doc/sysroot.rst

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ develop a plugin for a commonly used component then please consider
3131
contributing it so that it can be included in a future release of
3232
:program:`pyqtdeploy`.
3333

34-
TODO - building a spec file from scratch
35-
3634

3735
Standard Component Plugins
3836
--------------------------
3937

4038
TODO - describe what comes as standard
4139

40+
TODO - building a spec file from scratch
41+
4242

4343
The :program:`pyqt-demo` Sysroot
4444
--------------------------------
@@ -55,29 +55,29 @@ The full set of command line options is:
5555

5656
This will display a summary of the command line options.
5757

58+
.. option:: --component COMPONENT
59+
60+
``COMPONENT`` is the name of the component (specified in the JSON file)
61+
that will be built. It may be used more than once to build multiple
62+
components. If the option is not specified then all components specified
63+
in the JSON file will be built.
64+
5865
.. option:: --no-clean
5966

6067
A temporary build directory (called ``build`` in the sysroot) is created in
61-
order to build the required packages. Normally this is removed
62-
automatically after all packages have been built. Specifying this option
63-
leaves the build directory as it is to make debugging package plugins
68+
order to build the required components. Normally this is removed
69+
automatically after all components have been built. Specifying this option
70+
leaves the build directory as it is to make debugging component plugins
6471
easier.
6572

6673
.. option:: --options
6774

68-
This causes the configurable options of each package specified in the JSON
69-
file to be displayed on ``stdout``. The program will then terminate.
70-
71-
.. option:: --package PACKAGE
72-
73-
``PACKAGE`` is the name of the package (specified in the JSON file) that
74-
will be built. It may be used more than once to build multiple packages.
75-
If the option is not specified then all packages specified in the JSON file
76-
will be built.
75+
This causes the configurable options of each component specified in the
76+
JSON file to be displayed on ``stdout``. The program will then terminate.
7777

7878
.. option:: --plugin-dir DIR
7979

80-
``DIR`` is added to the list of directories that are searched for package
80+
``DIR`` is added to the list of directories that are searched for component
8181
plugins. It may be used more than once to search multiple directories.
8282
All directories specified in this way will be searched before those
8383
directories (internal to :program:`pyqtdeploy-sysroot`) searched by
@@ -86,14 +86,14 @@ The full set of command line options is:
8686
.. option:: --source-dir DIR
8787

8888
``DIR`` is the name of the directory containing the source archives used to
89-
build the packages specified in the JSON file.
89+
build the components specified in the JSON file.
9090

9191
.. option:: --sysroot DIR
9292

9393
``DIR`` is the name of the system root directory. The default value is
9494
``sysroot-`` followed by a target-specific suffix. Unless the
95-
:option:`--package` option is specified any existing sysroot will first be
96-
removed and re-created.
95+
:option:`--component` option is specified any existing sysroot will first
96+
be removed and re-created.
9797

9898
.. option:: --target TARGET
9999

@@ -113,10 +113,11 @@ The full set of command line options is:
113113
This specifies that the version number should be displayed on ``stdout``.
114114
The program will then terminate.
115115

116-
.. option:: json
116+
.. option:: specification
117117

118-
``json`` is the name of a JSON specification file that defines each package
119-
to be included in the sysroot and how each is to be configured.
118+
``specification`` is the name of a JSON specification file that defines
119+
each component to be included in the sysroot and how each is to be
120+
configured.
120121

121122

122123
Writing A Component Plugin

pyqtdeploy/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, Riverbank Computing Limited
1+
# Copyright (c) 2018, Riverbank Computing Limited
22
# All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
@@ -33,5 +33,5 @@
3333
from .version import PYQTDEPLOY_RELEASE
3434

3535

36-
# These are for the package plugins.
37-
from .sysroot import AbstractPackage, PackageOption
36+
# These are for the component plugins.
37+
from .sysroot import AbstractComponent, ComponentOption

pyqtdeploy/pyqtdeploysysroot_main.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, Riverbank Computing Limited
1+
# Copyright (c) 2018, Riverbank Computing Limited
22
# All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
@@ -38,16 +38,16 @@ def main():
3838
# Parse the command line.
3939
parser = argparse.ArgumentParser()
4040

41+
parser.add_argument('--component', help="the component name to build",
42+
action='append')
4143
parser.add_argument('--no-clean',
4244
help="do not remove the temporary build directory",
4345
action='store_true')
4446
parser.add_argument('--options',
45-
help="show the options available for the packages",
47+
help="show the options available for the components",
4648
action='store_true')
47-
parser.add_argument('--package', help="the package name to build",
48-
action='append')
4949
parser.add_argument('--plugin-dir',
50-
help="search a directory for package plugins", metavar="DIR",
50+
help="search a directory for component plugins", metavar="DIR",
5151
action='append')
5252
parser.add_argument('--source-dir',
5353
help="the default directory containing the source archives",
@@ -61,7 +61,7 @@ def main():
6161
action='store_true')
6262
parser.add_argument('-V', '--version', action='version',
6363
version=PYQTDEPLOY_RELEASE)
64-
parser.add_argument('json',
64+
parser.add_argument('specification',
6565
help="JSON specification of the system image root directory")
6666

6767
args = parser.parse_args()
@@ -74,13 +74,13 @@ def main():
7474
if not sysroot_dir:
7575
sysroot_dir = os.environ.get('SYSROOT')
7676

77-
sysroot = Sysroot(sysroot_dir, args.json, args.plugin_path,
77+
sysroot = Sysroot(sysroot_dir, args.specification, args.plugin_path,
7878
args.source_dir, args.target, message_handler)
7979

8080
if args.options:
81-
sysroot.show_options(args.package)
81+
sysroot.show_options(args.component)
8282
else:
83-
sysroot.build_packages(args.package, args.no_clean)
83+
sysroot.build_components(args.component, args.no_clean)
8484
except UserException as e:
8585
message_handler.exception(e)
8686
return 1

pyqtdeploy/sysroot/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, Riverbank Computing Limited
1+
# Copyright (c) 2018, Riverbank Computing Limited
22
# All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
@@ -24,6 +24,6 @@
2424
# POSSIBILITY OF SUCH DAMAGE.
2525

2626

27-
# Publish the sub-package's API.
28-
from .abstract_package import AbstractPackage, PackageOption
27+
# Publish the component API.
28+
from .abstract_component import AbstractComponent, ComponentOption
2929
from .sysroot import Sysroot

pyqtdeploy/sysroot/abstract_package.py renamed to pyqtdeploy/sysroot/abstract_component.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, Riverbank Computing Limited
1+
# Copyright (c) 2018, Riverbank Computing Limited
22
# All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
@@ -27,8 +27,8 @@
2727
from abc import ABC, abstractmethod
2828

2929

30-
class PackageOption:
31-
""" Encapsulate an option for the package in the specification file. """
30+
class ComponentOption:
31+
""" Encapsulate an option for the component in the specification file. """
3232

3333
def __init__(self, name, type, required=False, default=None, values=None, help=None):
3434
""" Initialise the object. """
@@ -59,17 +59,17 @@ def _format_value(self, value):
5959
return value
6060

6161

62-
class AbstractPackage(ABC):
63-
""" The base class for the implementation of a package plugin. """
62+
class AbstractComponent(ABC):
63+
""" The base class for the implementation of a component plugin. """
6464

65-
# A sequence of PackageOption instances describing the options that can be
66-
# specified for the package in the specification file. These are made
65+
# A sequence of ComponentOption instances describing the options that can
66+
# be specified for the component in the specification file. These are made
6767
# available as attributes of the plugin instance.
6868
options = []
6969

7070
@abstractmethod
7171
def build(self, sysroot, debug):
72-
""" Build the package. """
72+
""" Build the component. """
7373

7474
def configure(self, sysroot):
75-
""" Complete the configuration of the package. """
75+
""" Complete the configuration of the component. """

pyqtdeploy/sysroot/packages/openssl.py renamed to pyqtdeploy/sysroot/plugins/openssl.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, Riverbank Computing Limited
1+
# Copyright (c) 2018, Riverbank Computing Limited
22
# All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
@@ -28,17 +28,17 @@
2828
import os
2929
import sys
3030

31-
from ... import AbstractPackage, PackageOption
31+
from ... import AbstractComponent, ComponentOption
3232

3333

34-
class OpenSSLPackage(AbstractPackage):
35-
""" The OpenSSL package. """
34+
class OpenSSLComponent(AbstractComponent):
35+
""" The OpenSSL component. """
3636

37-
# The package-specific options.
37+
# The component options.
3838
options = [
39-
PackageOption('python_source', str,
39+
ComponentOption('python_source', str,
4040
help="The archive of the Python source code containing patches to build OpenSSL on macOS."),
41-
PackageOption('source', str, required=True,
41+
ComponentOption('source', str, required=True,
4242
help="The archive containing the OpenSSL source code."),
4343
]
4444

@@ -51,7 +51,7 @@ def build(self, sysroot):
5151
archive = sysroot.find_file(self.source)
5252
sysroot.unpack_archive(archive)
5353

54-
# We require OpenSSL v1.0.* as Qt does.
54+
# We require OpenSSL v1.0.* as Python does.
5555
major = minor = None
5656
name = os.path.basename(os.getcwd())
5757
name_parts = name.split('-')

pyqtdeploy/sysroot/packages/pip.py renamed to pyqtdeploy/sysroot/plugins/pip.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, Riverbank Computing Limited
1+
# Copyright (c) 2018, Riverbank Computing Limited
22
# All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
@@ -24,15 +24,15 @@
2424
# POSSIBILITY OF SUCH DAMAGE.
2525

2626

27-
from ... import AbstractPackage, PackageOption
27+
from ... import AbstractComponent, ComponentOption
2828

2929

30-
class pipPackage(AbstractPackage):
31-
""" The pip meta-package. """
30+
class pipComponent(AbstractComponent):
31+
""" The pip meta-component. """
3232

33-
# The package-specific options.
33+
# The component options.
3434
options = [
35-
PackageOption('packages', list, required=True,
35+
ComponentOption('packages', list, required=True,
3636
help="The packages to be installed by pip."),
3737
]
3838

pyqtdeploy/sysroot/packages/pyqt3d.py renamed to pyqtdeploy/sysroot/plugins/pyqt3d.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2017, Riverbank Computing Limited
1+
# Copyright (c) 2018, Riverbank Computing Limited
22
# All rights reserved.
33
#
44
# Redistribution and use in source and binary forms, with or without
@@ -26,15 +26,15 @@
2626

2727
import os
2828

29-
from ... import AbstractPackage, PackageOption
29+
from ... import AbstractComponent, ComponentOption
3030

3131

32-
class PyQt3DPackage(AbstractPackage):
33-
""" The PyQt3D package. """
32+
class PyQt3DComponent(AbstractComponent):
33+
""" The PyQt3D component. """
3434

35-
# The package-specific options.
35+
# The component options.
3636
options = [
37-
PackageOption('source', str, required=True,
37+
ComponentOption('source', str, required=True,
3838
help="The archive containing the PyQt3D source code."),
3939
]
4040

@@ -60,7 +60,7 @@ def build(self, sysroot):
6060
sysroot.target_sip_dir,
6161
os.path.join(sysroot.target_sitepackages_dir, 'PyQt5'))
6262

63-
disabled_features = sysroot.find_package('pyqt5').disabled_features
63+
disabled_features = sysroot.find_component('pyqt5').disabled_features
6464
if disabled_features:
6565
cfg += 'pyqt_disabled_features = {0}\n'.format(
6666
' '.join(disabled_features))

0 commit comments

Comments
 (0)