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

Add test which exercises lockfile dependency #312

Closed
tommyyliu opened this issue Jan 11, 2023 · 4 comments
Closed

Add test which exercises lockfile dependency #312

tommyyliu opened this issue Jan 11, 2023 · 4 comments

Comments

@tommyyliu
Copy link

I was seeing the below error. I needed to install lockfile.

ImportError:
NOTE: In order to use the FileCache you must have lockfile installed.

More extensive stacktrace:
File "C:\Users\tommy.conda\envs\builder\Lib\site-packages\conda_lock\conda_lock.py", line 1341, in lock
lock_func(
File "C:\Users\tommy.conda\envs\builder\Lib\site-packages\conda_lock\conda_lock.py", line 1071, in run_lock
make_lock_files(
File "C:\Users\tommy.conda\envs\builder\Lib\site-packages\conda_lock\conda_lock.py", line 407, in make_lock_files
lock_content = lock_content | create_lockfile_from_spec(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tommy.conda\envs\builder\Lib\site-packages\conda_lock\conda_lock.py", line 800, in create_lockfile_from_spec
deps = _solve_for_arch(
^^^^^^^^^^^^^^^^
File "C:\Users\tommy.conda\envs\builder\Lib\site-packages\conda_lock\conda_lock.py", line 736, in _solve_for_arch
pip_deps = solve_pypi(
^^^^^^^^^^^
File "C:\Users\tommy.conda\envs\builder\Lib\site-packages\conda_lock\pypi_solver.py", line 220, in solve_pypi
pypi = PyPiRepository()
^^^^^^^^^^^^^^^^
File "C:\Users\tommy.conda\envs\builder\Lib\site-packages\conda_lock_vendor\poetry\repositories\pypi_repository.py", line 72, in init
self._cache_control_cache = FileCache(str(release_cache_dir / "_http"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\tommy.conda\envs\builder\Lib\site-packages\cachecontrol\caches\file_cache.py", line 87, in init
raise ImportError(notice)
ImportError:
NOTE: In order to use the FileCache you must have
lockfile installed. You can install it via pip:
pip install lockfile

@mariusvniekerk
Copy link
Collaborator

what does your source file look like?

@tommyyliu
Copy link
Author

tommyyliu commented Jan 11, 2023

Created a more minimal repro:

channels:
    - conda-forge
dependencies:
    - python=3.10
    - pip:
          - pypylon

It seems like the pip resolution requires lockfile.
"conda install lockfile" fixes it.
Additionally, I'm trying this on Windows. I can try on a different OS later if that helps.

@maresb
Copy link
Contributor

maresb commented Feb 5, 2023

Thanks a lot for the report! This should now be fixed by conda-forge/conda-lock-feedstock#40.

We still need to add test coverage for this type of pip resolution. I appreciate your minimal reproducer, we should add it or something similar into the test suite.

@maresb maresb changed the title lockfile dependency Add test which exercises lockfile dependency Feb 5, 2023
@maresb
Copy link
Contributor

maresb commented Feb 25, 2023

According to my debugger, we do have coverage of Poetry's usage of FileCache in our test suite, e.g. test_run_lock_with_pip. I think there's nothing more to do here.

@maresb maresb closed this as completed Feb 25, 2023
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

3 participants