{"id":20841346,"url":"https://github.com/zephyrproject-rtos/windows-curses","last_synced_at":"2025-06-12T03:03:43.543Z","repository":{"id":45960585,"uuid":"131604828","full_name":"zephyrproject-rtos/windows-curses","owner":"zephyrproject-rtos","description":"Windows Curses Python module","archived":false,"fork":false,"pushed_at":"2025-01-11T00:00:41.000Z","size":193,"stargazers_count":190,"open_issues_count":18,"forks_count":33,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-08T22:09:29.539Z","etag":null,"topics":["curses","tools"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/windows-curses/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zephyrproject-rtos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-04-30T14:19:44.000Z","updated_at":"2025-04-24T09:36:13.000Z","dependencies_parsed_at":"2024-05-05T07:26:37.356Z","dependency_job_id":"f9277824-d00c-41b0-9668-46bd77ba4644","html_url":"https://github.com/zephyrproject-rtos/windows-curses","commit_stats":{"total_commits":75,"total_committers":6,"mean_commits":12.5,"dds":"0.31999999999999995","last_synced_commit":"b3b403cde99ebd9f502e0627f8f376872b02b9da"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/zephyrproject-rtos/windows-curses","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrproject-rtos%2Fwindows-curses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrproject-rtos%2Fwindows-curses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrproject-rtos%2Fwindows-curses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrproject-rtos%2Fwindows-curses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zephyrproject-rtos","download_url":"https://codeload.github.com/zephyrproject-rtos/windows-curses/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zephyrproject-rtos%2Fwindows-curses/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259387512,"owners_count":22849745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["curses","tools"],"created_at":"2024-11-18T01:19:45.122Z","updated_at":"2025-06-12T03:03:43.485Z","avatar_url":"https://github.com/zephyrproject-rtos.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Python curses wheels for Windows\r\n================================\r\n\r\n![Latest Version](https://img.shields.io/pypi/v/windows-curses)\r\n![Supported Python Implementations](https://img.shields.io/pypi/implementation/windows-curses)\r\n\r\nThis is the repository for the [windows-curses wheels on\r\nPyPI](https://pypi.org/project/windows-curses). The wheels are based on the\r\n[wheels on Christoph Gohlke's\r\npage](https://www.lfd.uci.edu/~gohlke/pythonlibs/#curses).\r\n\r\nOnly `build-wheels.bat` is original work.\r\n\r\nWheels built from this repository can be installed with this command:\r\n\r\n    pip install windows-curses\r\n\r\nStarting with version 2.0, these wheels include a hack to make resizing work\r\nfor Python applications that haven't been specifically adapted for PDCurses.\r\nSee [this\r\ncommit](https://github.com/zephyrproject-rtos/windows-curses/commit/30ca08bfbcb7a332228ddcde026181b2009ea0a7).\r\nThe description on PyPI has a longer explanation.\r\n\r\nNote that this hack is not in Gohlke's wheels.\r\n\r\nMaintainers Wanted\r\n------------------\r\n\r\nThis project is not actively maintained and is looking for maintainers.\r\n\r\nIf you are interested, please let us know by either creating an issue here or messaging in the\r\n[#windows-support channel on Zephyr Discord](https://discord.gg/ygfnbCZCtU).\r\n\r\nBackground\r\n----------\r\n\r\nThe `curses` module is in the Python standard library, but is not available on\r\nWindows. Trying to import `curses` gives an import error for `_curses`, which\r\nis provided by `Modules/_cursesmodule.c` in the CPython source code.\r\n\r\nThe wheels provided here are based on patches from\r\nhttps://bugs.python.org/issue2889, which make minor modifications to\r\n`_cursesmodule.c` to make it compatible with Windows and the\r\n[PDCurses](https://pdcurses.sourceforge.io) curses implementation.  `setup.py`\r\ndefines `HAVE_*` macros for features available in PDCurses and makes some minor\r\nadditional compatibility tweaks.\r\n\r\nThe patched `_cursesmodule.c` is linked against PDCurses to produce a wheel\r\nthat provides the `_curses` module on Windows and allows the standard `curses`\r\nmodule to run.\r\n\r\nUnicode support\r\n---------------\r\n\r\nThe wheels are built with wide character support and force the encoding to\r\nUTF-8. Remove `UTF8=y` from the `nmake` line in `build-wheels.bat` to use the\r\ndefault system encoding instead.\r\n\r\nBuild instructions\r\n------------------\r\n\r\n 1. Clone the repository with the following command:\r\n\r\n        git clone --recurse-submodules https://github.com/zephyrproject-rtos/windows-curses.git\r\n\r\n    `--recurse-submodules` pulls in the required PDCurses Git submodule.\r\n\r\n 2. Install compilers compatible with the Python versions that you want to\r\n    builds wheel for by following the instructions at\r\n    https://wiki.python.org/moin/WindowsCompilers.\r\n\r\n    Visual Studio 2019 will work for Python 3.6-3.9.\r\n\r\n    Visual Studio 2022 will work for Python 3.10-3.13.\r\n\r\n 3. Install Python 3.6 or later to get\r\n    the [Python launcher for Windows](https://docs.python.org/3/using/windows.html#launcher).\r\n\r\n 4. Install any other Python versions you want to build wheels for.\r\n\r\n    Only the Python X.Y versions that have `pyXY\\` directories are supported.\r\n\r\n 5. Install/upgrade the `wheel` and `setuptools` packages for all Python\r\n    versions. Taking Python 3.6 as an example, the following command will do\r\n    it:\r\n\r\n        py -3.6 -m pip install --upgrade wheel setuptools\r\n\r\n    `py` is the Python launcher, which makes it easy to run a particular Python\r\n    version.\r\n\r\n 6. Open the Visual Studio\r\n    [Developer Command Prompt](https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs)\r\n    of the compiler required by the version of Python that you want to build\r\n    a wheel for.\r\n\r\n    Use the 32-bit version (`x86 Native Tools Command Prompt for VS 2022`) to build wheels for 32-bit\r\n    Python versions, and the 64-bit version (e.g.\r\n    `x64 Native Tools Command Prompt for VS 2022`) to build wheels for 64-bit Python versions.\r\n\r\n 7. Run `build-wheels.bat`, passing it the Python version you're building a\r\n    wheel for. For example, the following command will build a wheel for\r\n    Python 3.6:\r\n\r\n        build-wheels.bat 3.6\r\n\r\n    If you have both 32-bit and 64-bit versions of the same Python version\r\n    installed and are building a 32-bit wheel, add \"-32\" to the version\r\n    number, like in the following example:\r\n\r\n        build-wheels.bat 3.6-32\r\n\r\n    If you are building multiple wheels for Python versions that are all\r\n    compatible with the same compiler, you can list all of them in the same\r\n    command:\r\n\r\n        build-wheels.bat 3.6 3.7\r\n\r\n    `build-wheels.bat` first cleans and rebuilds PDCurses, and then builds and\r\n    links the source code in `pyXY\\` for each of the specified Python versions,\r\n    producing wheels as output in `dist\\`.\r\n\r\n### Rebuilding the wheels for Python 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, and 3.13\r\n\r\nIn `x86 Native Tools Command Prompt for VS 2022`:\r\n\r\n    build-wheels.bat 3.6-32 3.7-32 3.8-32 3.9-32 3.10-32 3.11-32 3.12-32 3.13-32\r\n\r\nIn `x64 Native Tools Command Prompt for VS 2022`:\r\n\r\n    build-wheels.bat 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13\r\n\r\n\r\nThis gives a set of wheels in `dist\\`.\r\n\r\nCompatibility note\r\n------------------\r\n\r\nThis building scheme above should be the safest one to use. In practice, many\r\nof the resulting wheels seem to be forwards- and backwards-compatible.\r\n\r\nMaking a new release\r\n--------------------\r\n\r\n  1. Bump the version number in `setup.py` according to the [Semantic versioning](https://semver.org/).\r\n\r\n  2. Create a Git tag for the release:\r\n\r\n         git tag -s -m \"windows-curses 1.2.3\" v1.2.3\r\n         git push upstream v1.2.3\r\n\r\n     For pre-releases, add `aNUMBER` after the release name (e.g. `v1.2.3a1`, `v1.2.3a2`, ...).\r\n\r\n  3. [Create a GitHub release](https://github.com/zephyrproject-rtos/windows-curses/releases/new)\r\n     from the tag.\r\n\r\n     The name of the GitHub release should match the name of the release tag (e.g. `v1.2.3`) and its\r\n     body should contain a brief release note.\r\n\r\nOnce a GitHub release is created, the GitHub Actions CI will automatically build and upload the\r\nwheels to the PyPI.\r\n\r\nUploading to PyPI\r\n-----------------\r\n\r\n**NOTE: The process of uploading wheels for releases is automated using the GitHub Actions and\r\nmanual uploads should not be necessary under normal circumstances.**\r\n\r\nDon't forget to bump the version number in `setup.py` before building new\r\nwheels. [Semantic versioning](https://semver.org/) is intended.\r\n\r\nOnce the wheels are built, follow the instructions\r\n[here](https://packaging.python.org/tutorials/distributing-packages/#uploading-your-project-to-pypi)\r\nto upload them to PyPI.\r\n\r\n`pip`/PyPI will look at the wheel metadata and automatically install the right\r\nversion of the wheel.\r\n\r\nAdding support for a new Python version\r\n---------------------------------------\r\n\r\n1. Create a new directory `pyXY` for the Python version X.Y (e.g. `py39` for\r\n   Python 3.9).\r\n\r\n2. Copy `Modules/_cursesmodule.c` and `Modules/_curses_panel.c` from the\r\n   CPython source code to `pyXY/_cursesmodule.c` and `pyXY/_curses_panel.c`,\r\n   respectively.\r\n\r\n3. Apply the following PDCurses compatibility patches:\r\n\r\n   * https://github.com/zephyrproject-rtos/windows-curses/commit/b1cf4e10cecb9ba3e43766407c2ed2b138571f85\r\n   * https://github.com/zephyrproject-rtos/windows-curses/commit/30ca08bfbcb7a332228ddcde026181b2009ea0a7\r\n   * https://github.com/zephyrproject-rtos/windows-curses/commit/3e4fa8c6427483641300efb21a3e9af78b146c83\r\n\r\n4. Run `Tools/clinic/clinic.py` script from the CPython source code on\r\n   `pyXY/_cursesmodule.c` and `pyXY/_curses_panel.c` in order to generate the\r\n   respective header files under `pyXY/clinic/`.\r\n\r\n5. Add the build specifications for the new Python version in\r\n   `.github/workflows/ci.yml`.\r\n\r\nIn practice, `Modules\\_cursesmodule.c` from newer Python 3 versions is likely\r\nto be compatible with older Python 3 versions too. The Python 3.6 and 3.7\r\nwheels are currently built from identical `_cursesmodule.c` files (but not the\r\nPython 3.8 or 3.9 wheels).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephyrproject-rtos%2Fwindows-curses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzephyrproject-rtos%2Fwindows-curses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzephyrproject-rtos%2Fwindows-curses/lists"}