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.

Unable to retrieve the package version for git on preview 1.1.0b2

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).

Issue

I need the preview build for solving another bug. But now git packages are not working. Works as intended on the latest release 1.0.10.

  Stack trace:

  9  ~/.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

  8  ~/.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():

  7  ~/.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

  6  ~/.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]

  5  ~/.poetry/lib/poetry/console/commands/add.py:101 in handle
       99β”‚                     raise ValueError("Package {} is already present".format(name))
      100β”‚ 
    β†’ 101β”‚         requirements = self._determine_requirements(
      102β”‚             packages,
      103β”‚             allow_prereleases=self.option("allow-prereleases"),

  4  ~/.poetry/lib/poetry/console/commands/init.py:296 in _determine_requirements
      294β”‚             return requires
      295β”‚ 
    β†’ 296β”‚         requires = self._parse_requirements(requires)
      297β”‚         result = []
      298β”‚         for requirement in requires:

  3  ~/.poetry/lib/poetry/console/commands/init.py:386 in _parse_requirements
      384β”‚                         pair["extras"] = extras
      385β”‚ 
    β†’ 386β”‚                     package = Provider.get_package_from_vcs(
      387β”‚                         "git", url.url, reference=pair.get("rev")
      388β”‚                     )

  2  ~/.poetry/lib/poetry/puzzle/provider.py:209 in get_package_from_vcs
      207β”‚             revision = git.rev_parse(reference, tmp_dir).strip()
      208β”‚ 
    β†’ 209β”‚             package = cls.get_package_from_directory(tmp_dir, name=name)
      210β”‚ 
      211β”‚             package.source_type = "git"

  1  ~/.poetry/lib/poetry/puzzle/provider.py:311 in get_package_from_directory
      309β”‚         cls, directory, name=None
      310β”‚     ):  # type: (Path, Optional[str]) -> Package
    β†’ 311β”‚         package = PackageInfo.from_directory(
      312β”‚             path=directory, allow_build=True
      313β”‚         ).to_package(root_dir=directory)

  RuntimeError

  Unable to retrieve the package version for triopg

  at ~/.poetry/lib/poetry/inspection/info.py:135 in to_package
      131β”‚         name = name or self.name
      132β”‚ 
      133β”‚         if not self.version:
      134β”‚             # The version could not be determined, so we raise an error since it is mandatory.
    β†’ 135β”‚             raise RuntimeError(
      136β”‚                 "Unable to retrieve the package version for {}".format(name)
      137β”‚             )
      138β”‚ 
      139β”‚         package = Package(name=name, version=self.version)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
rotucommented, Sep 24, 2020

I’m having the same issue and it does not appear resolved by installing poetry-core from master:

https://gist.github.com/rotu/307020f80998bcb18f9236f4f79aeb87

$ pip3 list | grep poetry
poetry                     1.1.0b4
poetry-core                1.0.0b1

$ poetry install -vvv
Creating virtualenv colcon in /Users/dan/Documents/colcon_ws/.venv
Using virtualenv: /Users/dan/Documents/colcon_ws/.venv
Updating dependencies
Resolving dependencies...
   1: fact: colcon is 0.0.1
   1: derived: colcon
   1: Version solving took 0.824 seconds.
   1: Tried 1 solutions.

  Stack trace:

  18  ~/.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

  17  ~/.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():

  16  ~/.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

  15  ~/.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]

  14  ~/.poetry/lib/poetry/console/commands/install.py:71 in handle
        69β”‚         self._installer.verbose(self._io.is_verbose())
        70β”‚ 
     β†’  71β”‚         return_code = self._installer.run()
        72β”‚ 
        73β”‚         if return_code != 0:

  13  ~/.poetry/lib/poetry/installation/installer.py:99 in run
        97β”‚         local_repo = Repository()
        98β”‚ 
     β†’  99β”‚         return self._do_install(local_repo)
       100β”‚ 
       101β”‚     def dry_run(self, dry_run=True):  # type: (bool) -> Installer

  12  ~/.poetry/lib/poetry/installation/installer.py:205 in _do_install
       203β”‚             )
       204β”‚ 
     β†’ 205β”‚             ops = solver.solve(use_latest=self._whitelist)
       206β”‚         else:
       207β”‚             self._io.write_line("Installing dependencies from lock file")

  11  ~/.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β”‚ 

  10  ~/.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β”‚             )

   9  ~/.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β”‚ 

   8  ~/.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()

   7  ~/.poetry/lib/poetry/mixology/version_solver.py:392 in _choose_package_version
       390β”‚             return dependency.complete_name
       391β”‚ 
     β†’ 392β”‚         version = self._provider.complete_package(version)
       393β”‚ 
       394β”‚         conflict = False

   6  ~/.poetry/lib/poetry/puzzle/provider.py:446 in complete_package
       444β”‚                 self.search_for_file(r)
       445β”‚             elif r.is_vcs():
     β†’ 446β”‚                 self.search_for_vcs(r)
       447β”‚             elif r.is_url():
       448β”‚                 self.search_for_url(r)

   5  ~/.poetry/lib/poetry/puzzle/provider.py:159 in search_for_vcs
       157β”‚             return [self._deferred_cache[dependency]]
       158β”‚ 
     β†’ 159β”‚         package = self.get_package_from_vcs(
       160β”‚             dependency.vcs,
       161β”‚             dependency.source,

   4  ~/.poetry/lib/poetry/puzzle/provider.py:197 in get_package_from_vcs
       195β”‚             revision = git.rev_parse(reference, tmp_dir).strip()
       196β”‚ 
     β†’ 197β”‚             package = cls.get_package_from_directory(tmp_dir, name=name)
       198β”‚             package._source_type = "git"
       199β”‚             package._source_url = url

   3  ~/.poetry/lib/poetry/puzzle/provider.py:280 in get_package_from_directory
       278β”‚         cls, directory, name=None
       279β”‚     ):  # type: (Path, Optional[str]) -> Package
     β†’ 280β”‚         package = PackageInfo.from_directory(path=directory).to_package(
       281β”‚             root_dir=directory
       282β”‚         )

   2  ~/.poetry/lib/poetry/inspection/info.py:142 in to_package
       140β”‚             )
       141β”‚ 
     β†’ 142β”‚         package = Package(
       143β”‚             name=name,
       144β”‚             version=self.version,

   1  ~/.poetry/lib/poetry/_vendor/py3.8/poetry/core/packages/package.py:61 in __init__
        59β”‚ 
        60β”‚         if not isinstance(version, Version):
     β†’  61β”‚             self._version = Version.parse(version)
        62β”‚             self._pretty_version = pretty_version or version
        63β”‚         else:

  ParseVersionError

  Unable to parse "attr: colcon_argcomplete.__version__".

  at ~/.poetry/lib/poetry/_vendor/py3.8/poetry/core/semver/version.py:206 in parse
      202β”‚         except TypeError:
      203β”‚             match = None
      204β”‚ 
      205β”‚         if match is None:
    β†’ 206β”‚             raise ParseVersionError('Unable to parse "{}".'.format(text))
      207β”‚ 
      208β”‚         text = text.rstrip(".")
      209β”‚ 
      210β”‚         major = int(match.group(1))
0reactions
rotucommented, Sep 28, 2020

Sweet! Can confirm my issue is resolved under Poetry master.

Read more comments on GitHub >

github_iconTop Results From Across the Web

poetry - PyPI
Poetry: Python packaging and dependency management made easy. Stable Version Pre-release Version Python Versions Download Stats Discord.
Read more >
Visual Studio 2019 version 16.0 Release Notes | Microsoft Learn
Get information on the latest release features, bug fixes, and support for Visual Studio 2019 v16.0.
Read more >
After upgrade to Big Sur git stopped working - Apple Developer
After upgrade to Big Sur git stopped working and it keeps prompting to install CLT. According to Xcode-select, see output below CLT is...
Read more >
Changelog β€” conan 1.55.0 documentation
Docs here; Feature: Add stdcpp_library to conan.tools.build to get name of C++ ... Docs here; Feature: Update requirements.txt to use distro package version...
Read more >
History | Poetry - Python dependency management and ...
Fix an issue where Git dependencies failed to clone when insteadOf was used in ... When displaying the name of packages retrieved from...
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