生成环境.yml从pyproject.toml项目

beni的Python项目详细描述


beni

Code style: black.github/workflows/pythonpackage.ymlPyPi Package

Common names: Bolivian anaconda, Beni anaconda

Eunectes beniensis is a non-venomous boa species known only from the northeastern parts of Bolivia.

The four-metre long Eunectes beniensis was initially believed to be the result of hybridization between green and yellow anacondas, but was later determined to be a distinct species. The taxonomic status is not clear, due to lack of information and the appearance similarity to Eunectes notaeus. It is closely related to Eunectes notaeus and Eunectes deschauenseei.

beni^{}+^{}

什么?在

这是一个特定的工具,可以将flit和conda结合使用。假设如下:

  1. 您的存储库至少包含一个Python包
  2. 使用flit和{}来描述依赖关系
  3. 您希望使用Conda来管理本地开发,但您希望在PyPi上发布您的包。在
  4. 您希望为本地开发生成一个environment.yml,它将通过Conda安装尽可能多的Pypi依赖项。在

如果没有此工具,您必须手动使您的environment.yml与所有的pyproject.toml文件保持最新,这很容易出错,而且非常耗时。在

未解决的问题

  1. 如果conda forge的名称与pypi的名称不同呢?我们应该保留这些映射的列表。在
  2. 我们如何使用pyproject.toml自动生成conda forge配方?在
  3. 将来,conda是否可以从pyproject.toml文件中读取数据来创建一个环境?在

使用

  1. pip install beni
  2. 运行beni <path to pyproject.toml> [<another path to pyproject.toml>] > binder/environment.yml生成一个环境文件。它将condaforge包的所有需求添加到此环境中,并以第一个pyproject.toml模块命名。 你的每一个要求,看看是否有一个等效的康达锻造包
  3. conda env create -f bind/environment.yml && conda activate <module name> && flit install --symlink添加到自述文件中作为开发人员设置。在

示例

$ beni -h
usage: beni [-h][--deps {all,production,develop,extras}][--extras extra1,...][--ignore [foo [bar ...]]]
            pyproject.toml [pyproject.toml ...]

Generate an environment.yml.

positional arguments:
  pyproject.toml        flit config files

optional arguments:
  -h, --help            show this help message and exit
  --deps {all,production,develop,extras}
                        Which dependencies to emit. 'develop' means the extras 'test', 'doc', and 'dev',
                        'all' means all extras, and 'extras' means the ones specified in `--extras` or all
                        extras if`--extras` is not specified.
  --extras extra1,...   Install the dependencies of these (comma separated) extras additionally to the ones
                        implied by --deps. --extras=all can be useful in combination with --deps=production.
  --ignore [foo [bar ...]]
                        Conda packages to ignore

$ cat pyproject.toml
[tool.flit.metadata]requires=["typing_extensions",
    "typing_inspect",
    "python-igraph=0.8.0"]
requires-python =">=3.7"[tool.flit.metadata.requires-extra]test=["pytest",
    "pytest-cov",
    "pytest-mypy",
    "pytest-randomly",
    "pytest-xdist",
    "pytest-testmon",
    "pytest-pudb",
    "mypy"]doc=["sphinx",
    "sphinx-autodoc-typehints",
    "sphinx_rtd_theme",
    'recommonmark',
    "nbsphinx",
    "ipykernel",
    "IPython",
    "sphinx-autobuild"]dev=["jupyterlab>=1.0.0",
    "nbconvert",
    "pudb"]

$ beni pyproject.toml
name: metadsl
channels:
  - conda-forge
dependencies:
  - python>=3.7
  - pip
  - pip:
    - flit
  - typing_extensions
  - typing_inspect
  - python-igraph=0.8.0
  - pytest
  - pytest-cov
  - pytest-mypy
  - pytest-randomly
  - pytest-xdist
  - pytest-testmon
  - pytest-pudb
  - mypy
  - jupyterlab>=1.0.0
  - nbconvert
  - pudb

发展

^{pr2}$

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java在列表视图中插入调用按钮   java公开类别ID   java在使用JSch通过jumphost连接到远程主机时“拒绝主机密钥”   java连接。在Hibernate中为每个select查询调用getMetaData()   java如何在安卓 studio的文本监听器上突出显示过滤列表视图中的文本?   安卓应用程序、进程和Java虚拟机之间的对应关系是什么?   java如何使用Android在应用程序标签中添加这两个名称   java框架来衡量花费的时间和内存   java自动将字符串缩放到屏幕的宽度   在eclipse导出中创建jar文件时发生java错误   java Spring Web应用程序已初始化两次   java将数据插入数据库“表产品没有名为accFor(代码1)的列”   运行时如何执行。通过java中的Jruby使用带参数的rb   java Android:将视图从父视图转移到另一个视图   java如何在具有依赖关系的nexus中部署springboot maven项目   Google Java style:checkstyle文件与Visual Studio代码的相应编辑器配置文件   java以exif格式从jpeg或png文件中提取元数据