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

Only support python 3.6+ going forward + migrate to use some 3.6 features #109

Closed
jwlodek opened this issue May 17, 2021 · 6 comments
Closed
Assignees
Labels
Core Add for issues having to do with core functions Debug Add for issues pertaining to debug options (logging) Feature Request Add for a new feature request
Milestone

Comments

@jwlodek
Copy link
Owner

jwlodek commented May 17, 2021

Is your feature request related to a problem? Please describe.
Currently py_cui supports as far back as python 3.2, however, there are some features with newer python versions that would help a lot with development

Describe the solution you'd like
Move the minimum python version to 3.6, and integrate some initial features that were previously unsupported by older python versions

Additional context
Start with converting all .format instances to f-strings

@jwlodek jwlodek added Feature Request Add for a new feature request Core Add for issues having to do with core functions Debug Add for issues pertaining to debug options (logging) labels May 17, 2021
@jwlodek jwlodek added this to the v0.1.4 milestone May 17, 2021
@PabloLec
Copy link
Contributor

Hi ! I can work on this.

Switch to f-strings and check if I see any other relevant features to replace.

@jwlodek
Copy link
Owner Author

jwlodek commented May 20, 2021

Sure that would be great! I already did most of the f-strings (you can take a look at the v0.1.4-develop branch, but haven't had a chance to look into any other features.

@PabloLec
Copy link
Contributor

I converted remaining .format() in PR #111.

Regarding other 3.6 features, there is not much useful syntax improvement other than f-strings.
Maybe type annotations for variables.

Even if it's prior to 3.6, we could also switch from os.path to pathlib if you think that's relevant.

@jwlodek
Copy link
Owner Author

jwlodek commented May 21, 2021

Yes, type annotations are tracked in a separate issue: #77

Would definitely like to get to those, since it makes IDE style intellisense in VSCode and PyCharm work a lot better

@PabloLec
Copy link
Contributor

You plan on annotating types for variables too? So not only function arguments and return values but also proper vars?

I can start working on it, one file at a time, at a smooth and easy pace 😁

Beforehand, can you give a look to #112? Especially for multiple spaces around operators as in:

self._height                = height
self._width                 = width
self._height                = self._height - 4

I'd like to know what you think about it before starting annotating.

@jwlodek jwlodek mentioned this issue May 29, 2021
3 tasks
@jwlodek
Copy link
Owner Author

jwlodek commented Oct 2, 2021

I believe this has been mostly completed - the primary syntax improvement I wanted to account for was the f-string, which has been applied. Grepping the repo for .format shows no relevant results:

(venv) PS E:\ProgrammingWorkspace\py_cui> grep -rin format py_cui
py_cui/colors.py:16:# Format is FOREGROUND_ON_BACKGROUND
Binary file py_cui/controls/__pycache__/slider.cpython-37.pyc matches
py_cui/debug.py:49:    formatter   = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s | %(message)s')
py_cui/debug.py:50:    log_file.setFormatter(formatter)
Binary file py_cui/dialogs/__pycache__/filedialog.cpython-37.pyc matches
Binary file py_cui/dialogs/__pycache__/form.cpython-37.pyc matches
py_cui/__init__.py:1173:            Popup color with format FOREGOUND_ON_BACKGROUND. See colors module. Default: WHITE_ON_BLACK.
py_cui/__init__.py:1511:            The information regarding the error.
py_cui/__init__.py:1734:    def __format__(self, fmt):
py_cui/__init__.py:1735:        """Override of base format function. Prints list of current widgets.
py_cui/__init__.py:1739:        fmt : Format
py_cui/__init__.py:1740:            The format to override
Binary file py_cui/__pycache__/colors.cpython-37.pyc matches
Binary file py_cui/__pycache__/debug.cpython-37.pyc matches
Binary file py_cui/__pycache__/grid.cpython-37.pyc matches
Binary file py_cui/__pycache__/popups.cpython-37.pyc matches
Binary file py_cui/__pycache__/renderer.cpython-37.pyc matches
Binary file py_cui/__pycache__/ui.cpython-37.pyc matches
Binary file py_cui/__pycache__/widgets.cpython-37.pyc matches
Binary file py_cui/__pycache__/widget_set.cpython-37.pyc matches
Binary file py_cui/__pycache__/__init__.cpython-37.pyc matches

@jwlodek jwlodek closed this as completed Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Add for issues having to do with core functions Debug Add for issues pertaining to debug options (logging) Feature Request Add for a new feature request
Projects
None yet
Development

No branches or pull requests

2 participants