poetry2conda icon indicating copy to clipboard operation
poetry2conda copied to clipboard

Conda only dependency

Open churnikov opened this issue 3 years ago • 6 comments

Hello!

I think this is a great tool, but I think there is one package that stops me from using it. I'm talking about rdkit.

You see, it's impossible to install it as a git dependency and the simplest way to install it is via Conda.

Can I use your tool in this case? And how 😊?)

churnikov avatar Jul 30 '20 19:07 churnikov

I don't think you can use poetry or poetry2conda for this particular package. Poetry relies on packages that are distributed through PyPI. I don't really understand what you are trying to achieve, given that your dependency is a "pure conda" package (which is regrettable).

dojeda avatar Aug 05 '20 13:08 dojeda

I'm facing a different use case that could also be described as a "conda only dependency". We use poetry for all our env management but need conda for our pyinstaller builds. Thus, we want pyinstaller in our conda env but not in our poetry envs.

Not sure if this really helps OP but maybe someone passing through in the future. We simply used the "extras" functionality in pyproject.toml:

[tool.poetry.dependencies]
...
pyinstaller = { version = "3.6", optional = true }

[tool.poetry.extras]
conda-only = ["pyinstaller"]

Then we call poetry2conda with the extras flag: poetry2conda --extras conda-only pyproject.toml conda.yml

@dojeda Really appreciate this tool!

damienallen avatar Nov 16 '20 17:11 damienallen

I was able to use the above trick to install a package not on pypi at all:

[tool.poetry.dev-dependencies]
dummypkg = { git="https://github.com/bjodah/dummypkg.git", tag="master", optional = true }
...

[tool.poetry.extras]
conda-only = ["dummypkg"]

[tool.poetry2conda.dependencies]
dummypkg = { name="cuml", version = "0.18", channel = "rapidsai" }
...

frankier avatar Mar 02 '21 10:03 frankier

I'm facing a different use case that could also be described as a "conda only dependency". We use poetry for all our env management but need conda for our pyinstaller builds. Thus, we want pyinstaller in our conda env but not in our poetry envs.

Not sure if this really helps OP but maybe someone passing through in the future. We simply used the "extras" functionality in pyproject.toml:

[tool.poetry.dependencies]
...
pyinstaller = { version = "3.6", optional = true }

[tool.poetry.extras]
conda-only = ["pyinstaller"]

Then we call poetry2conda with the extras flag: poetry2conda --extras conda-only pyproject.toml conda.yml

@dojeda Really appreciate this tool!

@dojeda This should be added to the package's descriptions; there is not a manual for all the possible yaml headers & configurations!

Moreover, I think poetry update should have an additional option, similar to --no-dev, to exclude installations & updates on extra dependencies.

chestergan avatar May 22 '21 09:05 chestergan

I'm facing a different use case that could also be described as a "conda only dependency". We use poetry for all our env management but need conda for our pyinstaller builds. Thus, we want pyinstaller in our conda env but not in our poetry envs.

Not sure if this really helps OP but maybe someone passing through in the future. We simply used the "extras" functionality in pyproject.toml:

[tool.poetry.dependencies]
...
pyinstaller = { version = "3.6", optional = true }

[tool.poetry.extras]
conda-only = ["pyinstaller"]

Then we call poetry2conda with the extras flag: poetry2conda --extras conda-only pyproject.toml conda.yml

@dojeda Really appreciate this tool!

How do you run poetry update on the .toml file successfully? poetry update still encounters the SolverProblemError for the conda-specific package nomkl: image

chestergan avatar May 22 '21 09:05 chestergan

I was able to use the above trick to install a package not on pypi at all:

[tool.poetry.dev-dependencies]
dummypkg = { git="https://github.com/bjodah/dummypkg.git", tag="master", optional = true }
...

[tool.poetry.extras]
conda-only = ["dummypkg"]

[tool.poetry2conda.dependencies]
dummypkg = { name="cuml", version = "0.18", channel = "rapidsai" }
...

This works when there is only one conda-specific package, but what if there is more? How many dummy packages do I need to use?

chestergan avatar May 22 '21 10:05 chestergan