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

Allow Python versions >=3.10 and IPython alternate command as default shell options #2242

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

novaTopFlex
Copy link

Please follow these steps before submitting a new Pull Request to Guake:

  • rebase on latest HEAD:

    $ git pull --rebase upstream master
  • hack your change

  • to execute the code styling, checks and unit tests:

    $ make style check reno-lint test
  • describe your change in a slug file for automatic release note
    generation, using:

    $ make reno SLUG=<short_name_of_my_feature>

    and edit the created file in releasenotes/notes/.
    You can see how reno works using pipenv run reno --help.

    Please use a generic slug (eg, for translation update,
    use translation, for bugfix use bugfix,...)

  • create new commit message

    $ <hack the code>
    $ git commit --all
  • If your change is related to a GitHub issue, you can add a reference
    using #123 where 123 is the ID of the issue.
    You can use closes #123 to have GitHub automatically close the issue
    when your contribution get merged

  • Semantic commit is supported (and recommended). Add one of the following
    line in your commit messages:

    # For a bug fix, uses:
    sem-ver: bugfix
    
    # For a new feature, uses:
    sem-ver: feature
    
    # Please do not use the 'breaking change' syntax (`sem-ver: api-break`),
    # it is reserved for really big reworks
    

This pull request is necessary to ensure that Python versions beginning with 3.10 are available as default shell options on the Guake terminal. Without this modification the newest Python version that would function on the Guake terminal is only Python 3.9, and Ubuntu 22.04 LTS (my host system) ships with Python 3.10 by default, causing the issue of Python 3.10 not appearing on my host system.

@novaTopFlex novaTopFlex changed the title Update prefs.py Allow Python versions >=3.10 and IPython alternate command as default shell options Apr 18, 2024
In certain types of Linux packaging, the command for the IPython interpreter may be named "ipython2" and/or "ipython3" rather than simply "ipython" to distinguish Python 2.x and 3.x interpreter versions.
Copy link
Author

@novaTopFlex novaTopFlex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By changing the regex for the Python interpreter listings, versions of the Python 3.x interpreter newer than late-2021 should be permitted as options for the Guake drop-down terminal. The command for "python3.10" as well as commands for newer versions of Python 3 violate the rules created by the old regex (from the first commit). This second commit should enable the "ipython3" and legacy "ipython2" commands on Linux distributions that differentiate between Python 2 and Python 3 versions of the IPython interpreter. Also, on various Ubuntu versions, the "ipython3" command is the IPython command for default Python 3 interpretation.

Copy link
Collaborator

@Davidy22 Davidy22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about the late response, been busy as of late.

Few notes, you can use {x,y} notation for a range of repetitions instead of doing the two copied out repetitions of the last case, and it makes extending the regex a little more elegant too in case python ever gets into triple digit territory for the 3.x line. Also the ipython case seems to match a lot more letters than just i, is there a reason why we want to also match all these other cases like gpython and tpython?

@SparkyBluefang
Copy link

This might be a simpler regex to evaluate

PYTHONS = re.compile(r"^[a-z]?python(\d(\.\d+)?)?$")

or

PYTHONS = re.compile(r"^[a-z]?python(?:\d(?:\.\d+)?)?$")

if you don't need to capture the version components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants