file utils: introduce get_host_tool_path() to find commands on host (#3244)
A counterpart to get_snap_tool_path() for finding commands inside of
snapcraft snap, this finds tools required on the host.
Raises snapcraft.internal.errors.SnapcraftHostToolNotFoundError if not found.
- Renames HostToolNotFoundError -> SnapcraftHostToolNotFoundError
- Uses this new method for lifecycle finding snapd.
- Update tests (and minor refactor to import 'errors' rather
than continue cherry-picking each exception import.)
Signed-off-by: Chris Patterson <email address hidden>
plugins v2: quote python packages argument for pip (#3246)
If using a python package with conditionals, e.g.:
python-packages:
- ibm-db-sa; platform_machine == 'x86_64'
- ibm-db-sa; platform_machine == 'ppc64le'
- ibm-db-sa; platform_machine == 's390x'
Then snapcraft would pass the python packages unquoted to pip,
resulting in build errors. Ensure the packages are quoted
safely using shlex.quote() when building the command string.
Update existing python-package spread test and python-package
unit test to cover this case.
When using package-repositories, additional repositories may
be used that require HTTPS. Install apt-transport-https
as a required package, if not already available.
Signed-off-by: Chris Patterson <email address hidden>
- Add is_experimental() interface to extension to
allow extension to indicate it is experimental, conditional
to the base.
- Require --enable-experimental-extensions for user to
acknowledge unstable extension usage.
- Raise (new) SnapcraftExperimentalExtensionsRequiredError
if user configures an experimental extension without the
--enable-experimental-extensions flag.
Signed-off-by: Chris Patterson <email address hidden>