生成环境.yml从pyproject.toml项目
beni的Python项目详细描述
beni
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.
什么?在
这是一个特定的工具,可以将flit和conda结合使用。假设如下:
- 您的存储库至少包含一个Python包
- 使用
flit
和{}来描述依赖关系 - 您希望使用Conda来管理本地开发,但您希望在PyPi上发布您的包。在
- 您希望为本地开发生成一个
environment.yml
,它将通过Conda安装尽可能多的Pypi依赖项。在
如果没有此工具,您必须手动使您的environment.yml
与所有的pyproject.toml
文件保持最新,这很容易出错,而且非常耗时。在
未解决的问题
- 如果conda forge的名称与pypi的名称不同呢?我们应该保留这些映射的列表。在
- 我们如何使用
pyproject.toml
自动生成conda forge配方?在 - 将来,conda是否可以从
pyproject.toml
文件中读取数据来创建一个环境?在
使用
pip install beni
- 运行
beni <path to pyproject.toml> [<another path to pyproject.toml>] > binder/environment.yml
生成一个环境文件。它将condaforge包的所有需求添加到此环境中,并以第一个pyproject.toml
模块命名。 你的每一个要求,看看是否有一个等效的康达锻造包 - 将
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}$- 项目
标签: