如何用插件包抓取一个python包?

How to snap a python package with plugin packages?

我想捆绑提供命令行界面 (kedro) 的 Python 软件包 kedro。此外,我还想将 Python 包 kedro-docker 放入 snap 中。第二个包扩展了第一个包的命令行界面 (kedro docker)。但是当我使用下面的 snapcraft.yaml 创建快照时,我只得到第一个包的命令行界面:

name: kedro
base: core18
version: latest
description: |
    Kedro is a development workflow framework that implements software
    engineering best-practice for data pipelines with an eye towards
    productionising machine learning models.

grade: devel
confinement: devmode

architectures:
  - build-on: [amd64]

apps:
  kedro:
    command: kedro
    plugs:
      - home
      - network
      - network-bind
      - docker
    environment: {
      LANG: C.UTF-8,
      LC_ALL: C.UTF-8
    }

parts:
  kedro:
    plugin: python
    python-version: python3
    python-packages:
      - kedro==0.15.9
      - kedro-docker==0.1.1

如何将扩展命令行界面 (kedro docker) 放入 snap 中?

我不是专家,也从未使用过 snapcraft,因此这里只是一个假设。 Kedro-Docker 仅公开特定于项目的命令,除非您位于项目的根目录中,否则这些命令不会显示。因此,如果您 运行 kedro new 然后 cd <project-dir> && kedro,您应该(理想情况下)看到一组 docker 命令:

Global commands from Kedro
Commands:
  docs  See the kedro API docs and introductory tutorial.
  info  Get more information about kedro.
  new   Create a new kedro project.

Project specific commands from Docker
Commands:
  docker  Dockerize your Kedro project.

Project specific commands from <project-dir>/kedro_cli.py
Commands:
  activate-nbstripout  Install the nbstripout git hook to automatically...
  build-docs           Build the project documentation.
  build-reqs           Build the project dependency requirements.
  install              Install project dependencies from both...
  ipython              Open IPython with project specific variables loaded.
  jupyter              Open Jupyter Notebook / Lab with project specific...
  lint                 Run flake8, isort and (on Python >=3.6) black.
  package              Package the project as a Python egg and wheel.
  run                  Run the pipeline.
  test                 Run the test suite.