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.

Cannot dynamically find version through git link

See original GitHub issue
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Mac OS 11.0.1
  • Poetry version: Poetry version 1.1.4
  • Link of a Gist with the contents of your pyproject.toml file:
[tool.poetry.dependencies]
python = "^3.8"
celery = "4.4.0"
watchdog = "0.10.2"
argh = "0.24.1"
vSphere-Automation-SDK = { git = "https://github.com/vmware/vsphere-automation-sdk-python" }
...
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

Issue

Similar to https://github.com/python-poetry/poetry/issues/2761, I can’t dynamically determine the version number. However, when I do the installation via pip on the repo (pip install --upgrade git+https://github.com/vmware/vsphere-automation-sdk-python.git), it is able to resolve it fine. The new dependency I am trying to install is https://github.com/vmware/vsphere-automation-sdk-python

  Stack trace:

  15  ~/.poetry/lib/poetry/_vendor/py3.8/clikit/console_application.py:131 in run
       129β”‚             parsed_args = resolved_command.args
       130β”‚
     β†’ 131β”‚             status_code = command.handle(parsed_args, io)
       132β”‚         except KeyboardInterrupt:
       133β”‚             status_code = 1

  14  ~/.poetry/lib/poetry/_vendor/py3.8/clikit/api/command/command.py:120 in handle
       118β”‚     def handle(self, args, io):  # type: (Args, IO) -> int
       119β”‚         try:
     β†’ 120β”‚             status_code = self._do_handle(args, io)
       121β”‚         except KeyboardInterrupt:
       122β”‚             if io.is_debug():

  13  ~/.poetry/lib/poetry/_vendor/py3.8/clikit/api/command/command.py:171 in _do_handle
       169β”‚         handler_method = self._config.handler_method
       170β”‚
     β†’ 171β”‚         return getattr(handler, handler_method)(args, io, self)
       172β”‚
       173β”‚     def __repr__(self):  # type: () -> str

  12  ~/.poetry/lib/poetry/_vendor/py3.8/cleo/commands/command.py:92 in wrap_handle
        90β”‚         self._command = command
        91β”‚
     β†’  92β”‚         return self.handle()
        93β”‚
        94β”‚     def handle(self):  # type: () -> Optional[int]

  11  ~/.poetry/lib/poetry/console/commands/update.py:47 in handle
       45β”‚         self._installer.update(True)
       46β”‚
     β†’ 47β”‚         return self._installer.run()
       48β”‚

  10  ~/.poetry/lib/poetry/installation/installer.py:103 in run
       101β”‚         local_repo = Repository()
       102β”‚
     β†’ 103β”‚         return self._do_install(local_repo)
       104β”‚
       105β”‚     def dry_run(self, dry_run=True):  # type: (bool) -> Installer

   9  ~/.poetry/lib/poetry/installation/installer.py:235 in _do_install
       233β”‚             )
       234β”‚
     β†’ 235β”‚             ops = solver.solve(use_latest=self._whitelist)
       236β”‚         else:
       237β”‚             self._io.write_line("Installing dependencies from lock file")

   8  ~/.poetry/lib/poetry/puzzle/solver.py:65 in solve
        63β”‚         with self._provider.progress():
        64β”‚             start = time.time()
     β†’  65β”‚             packages, depths = self._solve(use_latest=use_latest)
        66β”‚             end = time.time()
        67β”‚

   7  ~/.poetry/lib/poetry/puzzle/solver.py:233 in _solve
       231β”‚
       232β”‚         try:
     β†’ 233β”‚             result = resolve_version(
       234β”‚                 self._package, self._provider, locked=locked, use_latest=use_latest
       235β”‚             )

   6  ~/.poetry/lib/poetry/mixology/__init__.py:7 in resolve_version
       5β”‚     solver = VersionSolver(root, provider, locked=locked, use_latest=use_latest)
       6β”‚
     β†’ 7β”‚     return solver.solve()
       8β”‚

   5  ~/.poetry/lib/poetry/mixology/version_solver.py:84 in solve
        82β”‚             while next is not None:
        83β”‚                 self._propagate(next)
     β†’  84β”‚                 next = self._choose_package_version()
        85β”‚
        86β”‚             return self._result()

   4  ~/.poetry/lib/poetry/mixology/version_solver.py:397 in _choose_package_version
       395β”‚             version = locked
       396β”‚
     β†’ 397β”‚         version = self._provider.complete_package(version)
       398β”‚
       399β”‚         conflict = False

   3  ~/.poetry/lib/poetry/puzzle/provider.py:450 in complete_package
       448β”‚                     self.search_for_directory(r)
       449β”‚                 elif r.is_file():
     β†’ 450β”‚                     self.search_for_file(r)
       451β”‚                 elif r.is_vcs():
       452β”‚                     self.search_for_vcs(r)

   2  ~/.poetry/lib/poetry/puzzle/provider.py:220 in search_for_file
       218β”‚             package = _package.clone()
       219β”‚         else:
     β†’ 220β”‚             package = self.get_package_from_file(dependency.full_path)
       221β”‚
       222β”‚             dependency._constraint = package.version

   1  ~/.poetry/lib/poetry/puzzle/provider.py:247 in get_package_from_file
       245β”‚     def get_package_from_file(cls, file_path):  # type: (Path) -> Package
       246β”‚         try:
     β†’ 247β”‚             package = PackageInfo.from_path(path=file_path).to_package(
       248β”‚                 root_dir=file_path
       249β”‚             )

  RuntimeError

  Unable to retrieve the package version for None

  at ~/.poetry/lib/poetry/inspection/info.py:143 in to_package
      139β”‚         name = name or self.name
      140β”‚
      141β”‚         if not self.version:
      142β”‚             # The version could not be determined, so we raise an error since it is mandatory.
    β†’ 143β”‚             raise RuntimeError(
      144β”‚                 "Unable to retrieve the package version for {}".format(name)
      145β”‚             )
      146β”‚
      147β”‚         package = Package(

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
tyao117commented, Dec 12, 2020

Actually, having it locally (the pseudo-dependencies) is the reason it works. Going to close this because it is not relevant to poetry.

0reactions
tyao117commented, Dec 12, 2020

already reported ^

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot get dynamic repository to work #953 - GitHub
Dynamic repository doesn't work for me with version 3.6.1 (installed GitVersion.Portable from Choco). Below is my command and output.
Read more >
Get current version of repository - git - Stack Overflow
There's really no clean way to do this, since "current" version of the repository means different things to different people.
Read more >
Dynamically Insert Version Info From git tag to Your App
There are two options, either you put version info in code and then use that in automation to create git tag. The another...
Read more >
Repository mirroring - GitLab Docs
You can mirror a repository to and from external sources. You can select which repository serves as the source. Branches, tags, and commits...
Read more >
How to dynamically define the name and version of a package
How to capture package version from SCM: gitΒΆ. The Git() helper from tools can be used to capture data from the Git repo...
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