question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Editable installs that depend on each other and use flit build system do not resolve

See original GitHub issue

Hi everyone,

I have a Pipfile in my project root that’s similar to this:

[packages]
mypackage = {path = "packages/mypackage", editable = true}
mypackage-cli = {path = "packages/mypackage-cli", editable = true}

mypackage-cli also depends on mypackage. However, if the version of mypackage isn’t yet on Pypi, pipenv is unable to make the lockfile. I’m hoping it would satisfy mypackage-cli’s dependency on mypackage through the mypackage editable install.

Is there a way to do this with Pipenv?

Thank you!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
matteiuscommented, Jun 24, 2022

I modified the other example I linked to so both editable packages were in their own directory and then I pointed one of them to depend on the other via install_requires= and it in fact doesn’t work. I tried downgrading to an earlier release this year before index restricted package change and it has the same issue:

matteius@matteius-VirtualBox:~/pipenv-triage/pipenv-5142/scrambled_eggs$ pipenv lock -v
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
Reporter.starting()
INFO:pipenv.patched.notpip._internal.resolution.resolvelib.reporter:Reporter.starting()
Reporter.adding_requirement(SpecifierRequirement('french_toast'), None)
INFO:pipenv.patched.notpip._internal.resolution.resolvelib.reporter:Reporter.adding_requirement(SpecifierRequirement('french_toast'), None)
CRITICAL:pipenv.patched.notpip._internal.resolution.resolvelib.factory:Could not find a version that satisfies the requirement french_toast (from versions: none)
Traceback (most recent call last):
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/patched/notpip/_vendor/resolvelib/resolvers.py", line 341, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/patched/notpip/_vendor/resolvelib/resolvers.py", line 173, in _add_to_criteria
    raise RequirementsConflicted(criterion)
pipenv.patched.notpip._vendor.resolvelib.resolvers.RequirementsConflicted: Requirements conflict: SpecifierRequirement('french_toast')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/resolution/resolvelib/resolver.py", line 94, in resolve
    result = self._result = resolver.resolve(
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/patched/notpip/_vendor/resolvelib/resolvers.py", line 472, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/patched/notpip/_vendor/resolvelib/resolvers.py", line 343, in resolve
    raise ResolutionImpossible(e.criterion.information)
pipenv.patched.notpip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('french_toast'), parent=None)]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/utils.py", line 882, in resolve
    results = resolver.resolve(self.constraints, check_supported_wheels=False)
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/patched/notpip/_internal/resolution/resolvelib/resolver.py", line 103, in resolve
    raise error from e
pipenv.patched.notpip._internal.exceptions.DistributionNotFound: No matching distribution found for french_toast
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/resolver.py", line 766, in <module>
    main()
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/resolver.py", line 760, in main
    _main(parsed.pre, parsed.clear, parsed.verbose, parsed.system, parsed.write,
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/resolver.py", line 743, in _main
    resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/resolver.py", line 704, in resolve_packages
    results, resolver = resolve(
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/resolver.py", line 685, in resolve
    return resolve_deps(
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/utils.py", line 1377, in resolve_deps
    results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/utils.py", line 1106, in actually_resolve_deps
    resolver.resolve()
  File "/home/matteius/.local/lib/python3.9/site-packages/pipenv/utils.py", line 884, in resolve
    raise ResolutionFailure(message=str(e))
pipenv.exceptions.ResolutionFailure: ERROR: No matching distribution found for french_toast
✘ Locking Failed! 

The only work around that I can think for now is to not include the install_requires in the setup.py of the other project as that is what is causing it – having two editable dependencies that depend on each other without explicitly defining it does work, but yeah seems like there is an edge case to potentially improve with this report.

0reactions
gitpushdashfcommented, Aug 22, 2022

Awesome! That worked. Nice work and thank you so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Third try on editable installs - Discussions on Python.org
So I took a look at flit. It has two kinds of editable installs. One uses symlinks to link the install into site-packages....
Read more >
Flit Documentation
Install flit if you don't already have it: python3 -m pip install flit. 3. Run flit init in the directory containing the module...
Read more >
How to install a package using pip in editable mode with ...
I get the same error for both build systems: ERROR: Project file:///tmp/demo has a 'pyproject.toml' and its build backend is missing the 'build_editable' ......
Read more >
The pyproject.toml config file — Flit 3.8.0 documentation
If you are not using flit build but flit_core via another build frontend, Flit doesn't doesn't check the VCS for files to include...
Read more >
Changelog - PDM
Bug Fixes# · Ensure pypi. · Fix a crash issue when depending on editable packages with extras. · Do not save the python...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found