Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conda only dependency #11

Open
churnikov opened this issue Jul 30, 2020 · 6 comments
Open

Conda only dependency #11

churnikov opened this issue Jul 30, 2020 · 6 comments

Comments

@churnikov
Copy link

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 😊?)

@dojeda
Copy link
Owner

dojeda commented Aug 5, 2020

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).

@damienallen
Copy link

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!

@frankier
Copy link

frankier commented Mar 2, 2021

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" }
...

@chestergan
Copy link

chestergan commented May 22, 2021

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
Copy link

chestergan commented May 22, 2021

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
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants