tartley / colorama

Simple cross-platform colored terminal text in Python
BSD 3-Clause "New" or "Revised" License
3.56k stars 253 forks source link

colorama problem with poetry export req. #331

Closed ozkansen closed 2 years ago

ozkansen commented 2 years ago

I have a problem when I use colorama with poetry package manager. I am using the package on linux systems. Here it is marked as windows. Because of this the package is not installed.

poetry add colorama
poetry export -o req.txt --without-hashes
...
colorama==0.4.4; sys_platform == "win32" and python_full_version >= "3.6.2" and python_version < "4.0" and (python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "win32" or sys_platform == "win32" and python_version >= "3.6" and python_full_version >= "3.5.0") and python_version >= "3.6" and platform_system == "Windows" and (python_version >= "3.6" and python_full_version < "3.0.0" and sys_platform == "win32" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6") or sys_platform == "win32" and python_version >= "3.6" and (python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6") and python_full_version >= "3.5.0")
...
tartley commented 2 years ago

That sounds like a bug which should be fixed, but be warned that throughput on bugfixes and releases is currently very low.

CraigKelly commented 2 years ago

You might want to try with the latest release of poetry. I just tried this on Pop OS 22.04 with Python 3.9.10, pip 22.2.1, and poetry 1.1.14 and didn't see this behavior:

$ poetry add colorama
...
$ poetry export --without-hashes
colorama==0.4.5; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
ozkansen commented 2 years ago

yes i tried it fixed, thanks

panosfoto commented 8 months ago

I am encountering exactly the same issue as the OP.

python 3.11.7 poetry 1.7.1 pip 23.3.2

poetry export --with dev -o requirements.txt
...
colorama==0.4.6 ; python_version >= "3.11" and python_version < "3.12" and (sys_platform == "win32" or platform_system == "Windows") \
    --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
    --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6
...

Is there a chance that this was re-introduced?