You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Installing prettytable via poetry does not install wcwidth dependency since prettytable 3.13.0 #362
In a new empty python project I tried to install prettytable using poetry add prettytable. This does not install wcwidth as a dependency which makes prettytable fail on text table output.
What did you expect to happen?
wcwidth should automatically be installed as a dependency, which worked up until prettytable 3.12.0
What actually happened?
wcwidth was not installed as a dependency
What versions are you using?
OS: Ubuntu 22.0
Python: 3.12.2
PrettyTable: 3.14.0
Other info
I tried adding an older version of prettytable using poetry add prettytable==3.12.0 and this installs wcwidth as a dependency. If I explicitly specify prettytable 3.13.0 or 3.14.0 it does not work. So something must have been changed from 3.12.0 to 3.13.0.
I don't use Poetry much, but could not reproduce on macOS with Python 3.12 and Poetry 1.8.3:
Details
❯ poetry initThis command will guide you through creating your pyproject.toml config.Package name [prettypoetry]:Version [0.1.0]:Description []:Author [Hugo van Kemenade <[email protected]>, n to skip]:License []:Compatible Python versions [^3.12]:Would you like to define your main dependencies interactively? (yes/no) [yes]You can specify a package in the following forms: - A single name (requests): this will search for matches on PyPI - A name and a constraint (requests@^2.23.0) - A git url (git+https://github.com/python-poetry/poetry.git) - A git url with a revision (git+https://github.com/python-poetry/poetry.git#develop) - A file path (../my-package/my-package.whl) - A directory (../my-package/) - A url (https://example.com/packages/my-package-0.1.0.tar.gz)Package to add or search for (leave blank to skip):Would you like to define your development dependencies interactively? (yes/no) [yes]Package to add or search for (leave blank to skip):Generated file[tool.poetry]name = "prettypoetry"version = "0.1.0"description = ""authors = ["Hugo van Kemenade <[email protected]>"]readme = "README.md"[tool.poetry.dependencies]python = "^3.12"[build-system]requires = ["poetry-core"]build-backend = "poetry.core.masonry.api"Do you confirm generation? (yes/no) [yes]
❯ ldrwxr-xr-x hugo wheel 96 B Thu Feb 6 18:44:19 2025 .drwxrwxrwt root wheel 1.1 KB Thu Feb 6 18:43:34 2025 ...rw-r--r-- hugo wheel 297 B Thu Feb 6 18:44:19 2025 pyproject.toml
❯ cat pyproject.toml[tool.poetry]name = "prettypoetry"version = "0.1.0"description = ""authors = ["Hugo van Kemenade <[email protected]>"]readme = "README.md"[tool.poetry.dependencies]python = "^3.12"[build-system]requires = ["poetry-core"]build-backend = "poetry.core.masonry.api"
❯ poetry add prettytableCreating virtualenv prettypoetry-pYUagiwI-py3.12 in /Users/hugo/Library/Caches/pypoetry/virtualenvsUsing version ^3.14.0 for prettytableUpdating dependenciesResolving dependencies... (0.1s)Package operations: 2 installs, 0 updates, 0 removals - Installing wcwidth (0.2.13) - Installing prettytable (3.14.0)Writing lock file
❯ ldrwxr-xr-x hugo wheel 128 B Thu Feb 6 18:44:30 2025 .drwxrwxrwt root wheel 1.1 KB Thu Feb 6 18:43:34 2025 ...rw-r--r-- hugo wheel 1.2 KB Thu Feb 6 18:44:30 2025 poetry.lock.rw-r--r-- hugo wheel 321 B Thu Feb 6 18:44:30 2025 pyproject.toml
❯ cat poetry.lock
# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand.[[package]]name = "prettytable"version = "3.14.0"description = "A simple Python library for easily displaying tabular data in a visually appealing ASCII table format"optional = falsepython-versions = ">=3.9"files = [ {file = "prettytable-3.14.0-py3-none-any.whl", hash = "sha256:61d5c68f04a94acc73c7aac64f0f380f5bed4d2959d59edc6e4cbb7a0e7b55c4"}, {file = "prettytable-3.14.0.tar.gz", hash = "sha256:b804b8d51db23959b96b329094debdbbdf10c8c3aa75958c5988cfd7f78501dd"},][package.dependencies]wcwidth = "*"[package.extras]tests = ["pytest", "pytest-cov", "pytest-lazy-fixtures"][[package]]name = "wcwidth"version = "0.2.13"description = "Measures the displayed width of unicode strings in a terminal"optional = falsepython-versions = "*"files = [ {file = "wcwidth-0.2.13-py2.py3-none-any.whl", hash = "sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859"}, {file = "wcwidth-0.2.13.tar.gz", hash = "sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5"},][metadata]lock-version = "2.0"python-versions = "^3.12"content-hash = "4a2cd4629c892732746a282c1f7380c1af6c9fcdfa370c223e0b3d0017180729"
Yeah, I don't use poetry that often either and tried the same thing you did with python 3.13 and prettytable 3.14 on macOS. Had no luck reproducing it either, which is why I asked for more details.
Thanks for your feedback. I essentially did the same as @hugovk but had the issue. After further debugging I found a difference. I am using a company internal artifactory as pypi mirror. When I configure that back to Pypi directly the issue is gone. So I assume this is some problem with my mirror and poetry, but which is triggered by some change from prettytable 3.12.0 to 3.13.0, since the older version works without problem in my setup and I do not see similar behavior with other packages.
Can confirm that this was an issue with my poetry setup. This behavior is a known bug with poetry and artifactory with packages using newer metadata versions namely 2.3 and 2.4. I assume prettytable moved to a newer format in 3.13.0 which triggered the poetry bug for me. Upgrading pkginfo in the poetry venv fixes this bug.
Activity
stuertz commentedon Feb 6, 2025
Could you add an example, to reproduce?
hugovk commentedon Feb 6, 2025
I don't use Poetry much, but could not reproduce on macOS with Python 3.12 and Poetry 1.8.3:
Details
stuertz commentedon Feb 6, 2025
Yeah, I don't use poetry that often either and tried the same thing you did with python 3.13 and prettytable 3.14 on macOS. Had no luck reproducing it either, which is why I asked for more details.
loewexy commentedon Feb 7, 2025
Thanks for your feedback. I essentially did the same as @hugovk but had the issue. After further debugging I found a difference. I am using a company internal artifactory as pypi mirror. When I configure that back to Pypi directly the issue is gone. So I assume this is some problem with my mirror and poetry, but which is triggered by some change from prettytable 3.12.0 to 3.13.0, since the older version works without problem in my setup and I do not see similar behavior with other packages.
loewexy commentedon Feb 7, 2025
Can confirm that this was an issue with my poetry setup. This behavior is a known bug with poetry and artifactory with packages using newer metadata versions namely 2.3 and 2.4. I assume prettytable moved to a newer format in 3.13.0 which triggered the poetry bug for me. Upgrading pkginfo in the poetry venv fixes this bug.
hugovk commentedon Feb 7, 2025
That's right, we started using the new 2.4 metadata in #350 to use the new license expressions.
I think it would have happened anyway, as we don't upper-pin Hatchling, but we do specifically need 2.4 for #350.
Thank you for finding the issue is with Poetry.