admin 管理员组文章数量: 1184232
I'm working on a Python CLI application that deals with climate data, using conda as a package manager.
To run the tool locally, I create and activate a conda environment (conda env create --file environment.yaml then conda activate mycli), install the app (pip install .), then run it with mycli --version.
I'd like to share this tool with colleagues. I'm trying to use conda constructor to create an installer for the tool and its dependencies. At the moment, when running constructor ., the result only installs the dependencies, with no trace of my app.
How do I tell constructor to include my Python app? Specifically, how do I make sure my CLI entrypoint is added to the installed bin directory by the constructor installer?
I've set up a stripped-down version of the repo here: conda-constructor-python-demo. I've pasted some key files below.
Some caveats:
- I need to use conda as some dependencies (namely esmpy) are only available in conda-fe.
- There may be a better way of packaging this project, but I've tried everything I can see out there (PyInstaller, Homebrew, conda-pack), and I've not had any lucky with any of them. Conda constructor seems like the most promising solution.
constructor.yaml
name: MyCli
version: "0.0.1"
channels:
- /
installer_type: pkg
specs:
- python=3.13
- pip
- typer
- numpy
- xcdat
- xesmf
environment.yaml
name: MyCli
version: "0.0.1"
channels:
- /
installer_type: pkg
environment_file: "./environment.yaml"
pyproject.yaml
[project]
name = "my-cli"
version = "0.0.1"
[project.scripts]
mycli = "mycli.cli:app"
本文标签: How to include Python application in conda constructor outputStack Overflow
版权声明:本文标题:How to include Python application in conda constructor output? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.roclinux.cn/p/1744025265a2520519.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论