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

Install pre-built wheel file #861

Closed
DUOLabs333 opened this issue Jan 19, 2022 · 9 comments
Closed

Install pre-built wheel file #861

DUOLabs333 opened this issue Jan 19, 2022 · 9 comments
Labels
⭐ enhancement Improvements for existing features

Comments

@DUOLabs333
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I have a wheel file that I have already compiled, ie, it's not on PyPI, but on my computer, and I want to install it.

Describe the solution you'd like

I want to be able to install with with pdm add <name of wheel>.

@DUOLabs333 DUOLabs333 added the ⭐ enhancement Improvements for existing features label Jan 19, 2022
@DUOLabs333
Copy link
Contributor Author

Thanks!

@DUOLabs333
Copy link
Contributor Author

It fails when installing a build sympy wheel.

@frostming
Copy link
Collaborator

frostming commented Feb 11, 2022

Paste the error or I can't help. A simple sentence like "xxx fails" tells nothing.

@DUOLabs333
Copy link
Contributor Author

Adding packages to default dependencies: sympy-1.11.dev0-py3-none-any.whl
======== Start resolving requirements ========
  mathicsscript>=4.0.0
  sympy-1.11.dev0-py3-none-any.whl
  python>=3.10
  Adding requirement mathicsscript>=4.0.0
        Found matching candidates:
          <Candidate mathicsscript 4.0.0 from https://pypi.org/simple/mathicsscript/>
  Adding requirement sympy-1.11.dev0-py3-none-any.whl
Traceback (most recent call last):
  File "/home/system/.local/bin/pdm", line 8, in <module>
    sys.exit(main())
  File "/home/system/.local/lib/python3.10/site-packages/pdm/core.py", line 226, in main
    return Core().main(args)
  File "/home/system/.local/lib/python3.10/site-packages/pdm/core.py", line 161, in main
    raise cast(Exception, err).with_traceback(traceback)
  File "/home/system/.local/lib/python3.10/site-packages/pdm/core.py", line 156, in main
    f(options.project, options)
  File "/home/system/.local/lib/python3.10/site-packages/pdm/cli/commands/add.py", line 53, in handle
    actions.do_add(
  File "/home/system/.local/lib/python3.10/site-packages/pdm/cli/actions.py", line 236, in do_add
    resolved = do_lock(project, strategy, tracked_names, reqs, dry_run=dry_run)
  File "/home/system/.local/lib/python3.10/site-packages/pdm/cli/actions.py", line 77, in do_lock
    mapping, dependencies = resolve(
  File "/home/system/.local/lib/python3.10/site-packages/pdm/resolver/core.py", line 31, in resolve
    result = resolver.resolve(requirements, max_rounds)
  File "/home/system/.local/lib/python3.10/site-packages/resolvelib/resolvers.py", line 481, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/system/.local/lib/python3.10/site-packages/resolvelib/resolvers.py", line 348, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/home/system/.local/lib/python3.10/site-packages/resolvelib/resolvers.py", line 168, in _add_to_criteria
    candidates=build_iter_view(matches),
  File "/home/system/.local/lib/python3.10/site-packages/resolvelib/structs.py", line 164, in build_iter_view
    matches = list(matches)
  File "/home/system/.local/lib/python3.10/site-packages/pdm/resolver/providers.py", line 232, in find_matches
    yield from super().find_matches(identifier, requirements, incompatibilities)
  File "/home/system/.local/lib/python3.10/site-packages/pdm/resolver/providers.py", line 140, in find_matches
    candidates = self.repository.find_candidates(
  File "/home/system/.local/lib/python3.10/site-packages/pdm/models/repositories.py", line 113, in find_candidates
    self._find_candidates(requirement),
  File "/home/system/.local/lib/python3.10/site-packages/pdm/models/repositories.py", line 296, in _find_candidates
    raise CandidateNotFound(
pdm.exceptions.CandidateNotFound: Unable to find candidates for sympy-1.11.dev0-py3-none-any.whl. There may exist some issues with the package name or network condition.

@frostming
Copy link
Collaborator

You can't do that with the bare name of the wheel, where you suppose PDM to find it? Use the absolute URL instead.

@DUOLabs333
Copy link
Contributor Author

An existing project uses a specific version of sympy, but I wanted to use my own with

[tool.pdm.overrides]
sympy = "1.11.dev0"

But once I did, I got

======== Start resolving requirements ========
  mathicsscript>=4.0.0
  sympy @ file:///${PROJECT_ROOT}/sympy-1.11.dev0-py3-none-any.whl
  python>=3.10
  Adding requirement mathicsscript>=4.0.0
	Found matching candidates:
	  <Candidate mathicsscript 4.0.0 from https://pypi.org/simple/mathicsscript/>
  Adding requirement sympy @ file:///${PROJECT_ROOT}/sympy-1.11.dev0-py3-none-any.whl
	Could not find any matching candidates.
	Could not find any matching candidates even when considering pre-releases.
	Found but non-matching candidates:
	  <Candidate sympy 1.9 from https://pypi.org/simple/sympy/>
	  <Candidate sympy 1.9rc1 from https://pypi.org/simple/sympy/>
	  <Candidate sympy 1.8 from https://pypi.org/simple/sympy/>
	  <Candidate sympy 1.7.1 from https://pypi.org/simple/sympy/>
	  <Candidate sympy 1.7 from https://pypi.org/simple/sympy/>
	  <Candidate sympy 1.7rc1 from https://pypi.org/simple/sympy/>
	  <Candidate sympy 1.6.2 from https://pypi.org/simple/sympy/>
	  <Candidate sympy 1.6.1 from https://pypi.org/simple/sympy/>
	  <Candidate sympy 1.6 from https://pypi.org/simple/sympy/>
	  <Candidate sympy 1.6rc2 from https://pypi.org/simple/sympy/>
	  ... [44 more candidate(s)]
Error occurs
Traceback (most recent call last):
  File "/home/system/.local/lib/python3.10/site-packages/pdm/termui.py", line 200, in logging
    yield logger
  File "/home/system/.local/lib/python3.10/site-packages/pdm/cli/actions.py", line 96, in do_lock
    raise ResolutionImpossible("Unable to find a resolution") from None
resolvelib.resolvers.ResolutionImpossible: Unable to find a resolution

@frostming
Copy link
Collaborator

Why do you want to override? Does one of your dependencies rejects the local wheel?

@DUOLabs333
Copy link
Contributor Author

Yes -- mathicsscript wants between 1.8 and 1.9.

@frostming
Copy link
Collaborator

Oops, overrides table doesn't support URLs yet. Will be improved in the next release.

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

No branches or pull requests

2 participants