Skip to content

poetry-core 2.3.2 raises when determining macos tag version #10832

@sbowman-mitre

Description

@sbowman-mitre

Description

Description:
poetry-core throws when running in a python 3.13.13 environment on Mac. The error message is:

File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmphyb4nwid/.venv/lib/python3.13/site-packages/poetry/core/_vendor/packaging/tags.py", line 410, in mac_platforms
version = cast("AppleVersion", tuple(map(int, version_str.split(".")[:2])))

ValueError: invalid literal for int() with base 10: ''

Environment:
python 3.13.13
poetry 2.3.3
poetry-core 2.3.2
Host: Darwin Kernel Version 25.2.0: Tue Nov 18 21:09:56 PST 2025; root:xnu-12377.61.12~1/RELEASE_ARM64_T6041 arm64

Code:
The bug is here: https://github.com/python-poetry/poetry-core/blob/23bf0ac6b8a50a0756ef4d657d8ff67aef88aa67/src/poetry/core/_vendor/packaging/tags.py#L410

 version = cast("AppleVersion", tuple(map(int, version_str.split(".")[:2])))

The bug is repeatable in that specific environment. But, changing can make this go away. For instance, downgrading to py3.12 makes the throw go away. And, some mac systems do not raise even with running with py3.13. There is a nuance here that I don't grok.

(Sorry to post this here; the poetry-core repo was not accepting new issues.)

Workarounds

Not found yet. Trying to roll back poety versions to a working configuration.

Poetry Installation Method

system package manager (eg: dnf, apt etc.)

Operating System

MacOs

Poetry Version

2.3.3

Poetry Configuration

cache-dir = "/Users/admin/Library/Caches/pypoetry"
certificates.cre.cert = false
data-dir = "/Users/admin/Library/Application Support/pypoetry"
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
installer.re-resolve = true
keyring.enabled = true
python.installation-dir = "{data-dir}/python"
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  
virtualenvs.prompt = "{project_name}-py{python_version}"
virtualenvs.use-poetry-python = false

Python Sysconfig

sysconfig.log
Paste the output of 'python -m sysconfig', over this line.

Example pyproject.toml

Poetry Runtime Logs

poetry-runtime.log
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
  main()
  ~~~~^^
File "/opt/homebrew/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
  json_out["return_val"] = hook(**hook_input["kwargs"])
                           ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
  return _build_backend().build_wheel(
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
      wheel_directory, config_settings, metadata_directory
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  )
  ^
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/api.py", line 58, in build_wheel
  return WheelBuilder.make_in(
         ~~~~~~~~~~~~~~~~~~~~^
      poetry,
      ^^^^^^^
  ...<2 lines>...
      config_settings=config_settings,
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  )
  ^
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/builders/wheel.py", line 95, in make_in
  wb.build(target_dir=directory)
  ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/builders/wheel.py", line 141, in build
  metadata_directory = self.prepare_metadata(Path(temp_dir))
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/builders/wheel.py", line 325, in prepare_metadata
  self._write_wheel_file(f)
  ~~~~~~~~~~~~~~~~~~~~~~^^^
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/builders/wheel.py", line 554, in _write_wheel_file
  tag=self.tag,
      ^^^^^^^^
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/masonry/builders/wheel.py", line 443, in tag
  sys_tag = next(packaging.tags.sys_tags())
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/_vendor/packaging/tags.py", line 646, in sys_tags
  yield from cpython_tags(warn=warn)
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/_vendor/packaging/tags.py", line 224, in cpython_tags
  platforms = list(platforms or platform_tags())
File "/private/var/folders/fd/vltmqhld06b2lmkxbd7sm65c0000gn/T/tmp81tqrjyd/.venv/lib/python3.13/site-packages/poetry/core/_vendor/packaging/tags.py", line 410, in mac_platforms
  version = cast("AppleVersion", tuple(map(int, version_str.split(".")[:2])))
                                 ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions