terminal-colors icon indicating copy to clipboard operation
terminal-colors copied to clipboard

--force-term N, cross-platform command install, depend on windows-curses (only on Windows proper)

Open mike-clark-8192 opened this issue 1 year ago • 2 comments

  • added --force-term N to test for color support outside of what tigetnum('colors') reports

  • added cross-platform terminal-colors cli command installation per PyPA conventions

    On Windows this creates a terminal-colors.exe shim. Also tested this method works on Ubuntu.

  • declared platform-specific dependency on windows-curses

Sorry I was working off of the source code from a pip install and didn't see your most recent repo commits regarding removing the tigetnum('colors') check-or-fail. All these changes I made without knowing you had made yours. But I think they're still useful, and maybe with --force-term N it might make sense to keep the failure check in, since that might encourage the Windows Terminal folks or the windows-curses folks to improve termcap reporting some day.

As far as I could figure out, in order to use the PyPA console_scripts shimgen, the script had to be addressable as a module, so I ended up moving it to a module dir and changing the hyphen to and underscore, and added the .py extension to make it importable. Unfortunately this makes the project feel less Unix-y and more Python-y -- all just to make it easier for Windows users to be able to run terminal-colors like any other PIP-installable command line tool. Whether you want to adopt this structural change, I really don't know. If downstream folks are really only interested in the standalone Python script, it seems trivial to export it and rename it. Maybe provide a script to automate that, I don't know.

Also, in Python 3.12, the setuptools module is no longer shipped with Python (to encourage people away from setup.py). We should probably switch to pyproject.toml eventually.

mike-clark-8192 avatar Feb 17 '24 15:02 mike-clark-8192