生成环境.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第三方库


热门话题
@SpringBootTest的java一次性配置   java如何在JSF中使用facelets创建左导航窗格?   [Java]检查一个数字是否为素数,使用extra-isPrime标志不起作用   关于java中的单线计算器的一个问题?   Java代码在Java环境中运行良好,但在Android环境中抛出错误   java使用int数组的元素初始化字符串   sqlquery中的mysql Java Hibernate常量   java在使用同一实例时从外部类调用内部类方法   中的java CriteriaBuilder   对JPA实体使用BaseEntity时,Sonar中的java“等于错误”   java获取数组的平均值   java ANDROID:在主细节流布局的另一个活动中更新数据   java如何使用SpringGateway以字符串形式获取响应体?   jsp中分页公告板的javasql