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

Enable GUI scripts #9549

Closed
wants to merge 1 commit into from
Closed

Enable GUI scripts #9549

wants to merge 1 commit into from

Conversation

IgnaciodelaTorreArias
Copy link

Resolves: #2310

  • Added tests for changed code.
  • Updated documentation for changed code.

FEATURE: ability to define gui scripts

The implementation is based on the official specification by @abn #2310

Created a script to be used with Windows gui_scripts, when using poetry install.

  1. The script starts a new window with an empty title "", in this new cmd pythonw is executed with the python script that is created for unix systems as argument (just as in console scripts), any other arguments are forwarded (just as in console scripts), The start command
  2. Since pythonw doesn't starts/need a command window only the GUI window is opened, if the python script is defined correctly on the scripts section.
  3. After starting pythonw the WINDOWS_GUI_CMD_TEMPLATE finishes, this means that if {script-name}.cmd was executed by clicking on it this will close the command window that was opened.

Questions:
To be able to run pythonw i used string functions [split, replace, join] modifying the python path provided, i don't know if this is correct?
Using pythonw means this only works with the CPython implementation, is this OK?

Updated documentation corresponding to the scripts section.

Based on PyPA entry-points specification defined console scripts and gui scripts.
Also added a warning deprecation for

[tool.poetry.scripts]
my_package_cli = 'my_package.console:run'

this is because of a TODO

Example

[tool.poetry.scripts]
my_pachkage_gui = {reference='my_package.gui:run', type='gui'}

testing

  • Tested manually with a repository a created with this purpose DearPyGUI-example-poetry
    For this testing i also needed to modify poetry-core, i will make a pull request after this one is merged.
     

Created a script to be used with Windows gui_scripts.
Updated documentation corresponding to the scripts section.
@dimbleby
Copy link
Contributor

haven't looked at the code but, any implementation for this should have corresponding changes in poetry-core for building wheels

Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve script section: support use of script files
2 participants