Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4.0.0 development #79

Closed
wants to merge 21 commits into from
Closed

v4.0.0 development #79

wants to merge 21 commits into from

Conversation

Cube707
Copy link
Collaborator

@Cube707 Cube707 commented Jul 4, 2022

This is a continuation of #71. I just felt that it was justified to create a new clean issue.

Motivation

As the current Version 3.0.5 has some big issues and the windows support has always been lacking, I took the time to restructure the complete library.

Changes

The following changes have been made:

Breaking changes

  • the readkey() function now raises a KeyboardInterupt when CTRL+C is pressed. (but readchar() can still be used to capture it). This is more inline with the python philosophy (IMHO) and prevents developers from accidentally trapping their users with no option to stop the programm.

fixes

  • windows now returns strings instead of bytestrings, same as on linux
  • windows now supports most special characters
  • swaped LF and CR, as per Swap linefeed & carriage return keycodes #69
  • windows actually returns CR on ENTER, so the ENTER variable now points to the appropriate existing variable
  • __all__ should return a list of strings
  • f5-f12 had wrong codes on linux
  • code coverage is much better now: Coverage Status
  • workflows: code coverage is now measued during the testing workflow and uploaded to coveralls.io

removed

  • removed python 2.7, 3.4, 3.5 and pypy support

changed

  • support for NON-BLOCKING behavior this is now removed as it has problems with the terminalsettings as pointed out in Keypresses outside of readchar_linux() are dropped #73 and discussed in feature request - non-blocking / timeout #62
  • general cleanup of config and setup files
  • bump precommit-hook versions
  • simplyfied .yamellinter.yml
  • since yamllint v1.27.0 there is a new option new-lines: type: platform that allows for platform independent linting. Added this.
  • reworked the github actions
  • workflows: updated the used github actions to actions/checkout@v3 and actions/setup-python@v4

added

  • extensive testing for both windows and linux
  • automated workflow that runs the test on both platforms
  • more keycodes for windows
  • add end-of-line-fixer to pre-commit
  • Add LICENSE file to repo and sdist #44
  • mac OS and FreeBSD run the linux behavior (note in the README that they are not supported but should work)
  • SHIFT+TAB support on Linux

related

closes #80
resolves #78, resolves #46
closes #75
closes #66
closes #56, resolves #42
closes #44
fixes #37
closes #9, resolves #8

closes magmax/python-inquirer#156
fixes magmax/python-inquirer#155
fixes magmax/python-inquirer#117
closes magmax/python-inquirer#113

closes Kamik423/cutie#26
closes Kamik423/cutie#23

@C0D3D3V
Copy link
Contributor

C0D3D3V commented Jul 7, 2022

Did you try to use the PyCharm terminal for example to debug the input test script? I got one report that the inputs do not work on windows using PyCharm. I myself did not test it, and I think there is also an issue open for the old version, so it is not very important that this works.

@Cube707
Copy link
Collaborator Author

Cube707 commented Jul 7, 2022

@C0D3D3V

No I only tested in Windows CMD terminal and Debian bash so far. Both while using VS code. I have never used PyCharm. But you right, there is already an issue: #51

@qianyun210603
Copy link

qianyun210603 commented Jul 9, 2022

(Edited shorter to keep this thread manageable, detailed discussion in https://github.com/Cube707/python-readchar/pull/5)

@Cube707
Copy link
Collaborator Author

Cube707 commented Jul 9, 2022

@qianyun210603 please see https://github.com/Cube707/python-readchar/pull/5

Would you also be so kind and edit your comment shorter to keep this thread manageable and more on-topic. Its already big enough with all the commits and linked issues...

Cube707 and others added 17 commits July 10, 2022 16:42
2.7 was not supported or tested for a long time. Since mokypatch
requires at least 3.6, this will be the first supporded version.
The `# -*- coding: utf-8 -*-` headers were useful for Python 2, and
aren't needed for Python 3 where UTF-8 is the default.
Their values where swaped and have been corrected as per @vanschelven PR

merges and closes #69
to allow for easier maintanace and proper separation. Every operating
system gets a seperate set of files. They are exported by the module
depending on `sys.platform`

closes #66, closes #62, closes #57, closes #42, closes #10, closes #9,
closes #8
The new setup uses a seperate folder for every operation system that
tests are provided for. Test for a different operating system than the
one currently running will be ignored.
The testscript now automatically knows of all special keys listed in the
`key.py` submodule. It additionally outputs the hex representaion of all
detected keys
github will now run precommit and pytest on all pushes and PRs
automatically.
@Cube707 Cube707 mentioned this pull request Jul 15, 2022
@Cube707 Cube707 changed the base branch from master to v4-development July 25, 2022 10:22
@Cube707 Cube707 closed this Jul 25, 2022
@Cube707 Cube707 deleted the dev-v4 branch July 25, 2022 10:32
@fleytman fleytman mentioned this pull request Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment