Closed edublancas closed 2 years ago
To reproduce:
conda create --name test-env -y
conda activate test-env
# install some package with conda that is also available via pip
conda install pygraphviz -c conda-forge -y
pip freeze
On my laptop, it looks like this:
pygraphviz @ file:///Users/runner/miniforge3/conda-bld/pygraphviz_1642787954737/work
I think we should have a function that looks for these entries and raises an error with some meaningful message. the solution would be to ask the user to generate conda lock files - I'm still thinking what's the best error message here
for testing, we just need to generate some fake requirements.lock.txt with entries like that and then ensure the docker.build functions throws some error if it finds anything like that
If you use conda to create your virtual env, but generate a
requirements.lock.txt
, you'll end up with entries like this:That happens if pygraphviz wasn't installed via
pip install
but viaconda install
The problem is that once you wanna generate the docker image, it'll break:
The relevant error is:
Docker is trying to pull the file, but it doesn't exist.
Fix: before image building, check the contents of
requirements.lock.txt
using a regex to see if it has the{name} @ file:{some_path}
.If so, raise an exception with an informative error and instructions to fix it.
Not sure what the informative error and instructions could be, we can discuss that.