如何使用插件包捕捉python包?

2024-05-29 10:54:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我想捆绑Python包kedro,它提供了一个命令行接口(kedro)。此外,我还想将Python包kedro-docker放入快照中。第二个包扩展了第一个包的命令行接口(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)放入快照中


Tags: docker命令行nameyamlbase界面versionnetwork
1条回答
网友
1楼 · 发布于 2024-05-29 10:54:51

我不是专家,也从来没有使用过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.

相关问题 更多 >

    热门问题