windows-entry-exe


Namewindows-entry-exe JSON
Version 1.3 PyPI version JSON
download
home_pagehttps://gitlab.com/alelec/windows-entry-exe/
SummaryReplacement exe launchers for setuptools entry_points
upload_time2024-07-26 04:59:48
maintainerNone
docs_urlNone
authorAndrew Leech
requires_python>=3.2
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            =================
windows_entry_exe
=================

This is a simple launcher for Python files, which is functionally equivalent to
the launchers in setuptools but not based on setuptools code. There are two
versions of the launcher - console and GUI - built from the same source code.

This project is based on simple_launcher by Vinay Sajip (https://bitbucket.org/vinay.sajip/simple_launcher).
Where the original project launches the script via a python child process however,
this launcher embeds python and launches the script directly. 

The main benefit of this is seen with gui projects on windows, such that the program
in the taskbar is the launcher exe rather than the python.exe in `simple_launcher`.
This change means pinning the program to the taskbar works, as does any application icons set.

The launcher is intended to facilitate script execution under Windows where a
PEP 397-compatible launcher is not available. The idea is that each Python
script has a copy of the launcher (symlinks not being generally available
under Windows). For scripts to work with the launcher, they have to have a name
ending in -script.py (for a console script) or -script.pyw (for a GUI script).
The deployment system (e.g. packaging) will ensure that for foo-script.py, a
console launcher opy named foo.exe is placed in the same directory; for
bar-script.pyw, a GUI launcher copy named bar.exe is placed in the same
directory.

Assuming that the relevant directories are on the path, the scripts can be
invoked using just "foo" or "bar". The foo.exe or bar.exe executable then
runs: it looks for a script with the appropriate suffix ("-script.py" or
"-script.pyw") in the same directory, and if found, opens that script to read a
shebang line indicating which Python executable to use for the script. The folder
of that executable, if found, is used to specify which python.dll the launcher is run against.

The above scheme is used automatically by `setuptools` when `entry_points` aree defined. 
`distutil` however works with an archive appended to the executable, rather than a separate file. 
This scheme is also supported natively; if an archive is found it will be used preferentially, if not a companion script
will be used.

These launchers can be used automatically for a project by including this module in 
your `setup.py` configuration like so ::

    setup(
        name="my_proj",
        ...,
        use_windows_entry_exe=True,
        setup_requires=['windows_entry_exe'],
        entry_points={
            'gui_scripts': [
                'MyProj = my_proj:main',
            ]
        },
    )

setuptools will then build entry_point exe's using these launchers rather than its own bundled ones.

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/alelec/windows-entry-exe/",
    "name": "windows-entry-exe",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.2",
    "maintainer_email": null,
    "keywords": null,
    "author": "Andrew Leech",
    "author_email": "andrew@alelec.net",
    "download_url": null,
    "platform": null,
    "description": "=================\nwindows_entry_exe\n=================\n\nThis is a simple launcher for Python files, which is functionally equivalent to\nthe launchers in setuptools but not based on setuptools code. There are two\nversions of the launcher - console and GUI - built from the same source code.\n\nThis project is based on simple_launcher by Vinay Sajip (https://bitbucket.org/vinay.sajip/simple_launcher).\nWhere the original project launches the script via a python child process however,\nthis launcher embeds python and launches the script directly. \n\nThe main benefit of this is seen with gui projects on windows, such that the program\nin the taskbar is the launcher exe rather than the python.exe in `simple_launcher`.\nThis change means pinning the program to the taskbar works, as does any application icons set.\n\nThe launcher is intended to facilitate script execution under Windows where a\nPEP 397-compatible launcher is not available. The idea is that each Python\nscript has a copy of the launcher (symlinks not being generally available\nunder Windows). For scripts to work with the launcher, they have to have a name\nending in -script.py (for a console script) or -script.pyw (for a GUI script).\nThe deployment system (e.g. packaging) will ensure that for foo-script.py, a\nconsole launcher opy named foo.exe is placed in the same directory; for\nbar-script.pyw, a GUI launcher copy named bar.exe is placed in the same\ndirectory.\n\nAssuming that the relevant directories are on the path, the scripts can be\ninvoked using just \"foo\" or \"bar\". The foo.exe or bar.exe executable then\nruns: it looks for a script with the appropriate suffix (\"-script.py\" or\n\"-script.pyw\") in the same directory, and if found, opens that script to read a\nshebang line indicating which Python executable to use for the script. The folder\nof that executable, if found, is used to specify which python.dll the launcher is run against.\n\nThe above scheme is used automatically by `setuptools` when `entry_points` aree defined. \n`distutil` however works with an archive appended to the executable, rather than a separate file. \nThis scheme is also supported natively; if an archive is found it will be used preferentially, if not a companion script\nwill be used.\n\nThese launchers can be used automatically for a project by including this module in \nyour `setup.py` configuration like so ::\n\n    setup(\n        name=\"my_proj\",\n        ...,\n        use_windows_entry_exe=True,\n        setup_requires=['windows_entry_exe'],\n        entry_points={\n            'gui_scripts': [\n                'MyProj = my_proj:main',\n            ]\n        },\n    )\n\nsetuptools will then build entry_point exe's using these launchers rather than its own bundled ones.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Replacement exe launchers for setuptools entry_points",
    "version": "1.3",
    "project_urls": {
        "Homepage": "https://gitlab.com/alelec/windows-entry-exe/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e90e0bd86ffc0b30ad6684af850a087b960bd7e99583957b718e3ab38b08b2bb",
                "md5": "0683933cffaa82bdee84a27baac697ab",
                "sha256": "b90904f69987f31e80d061cbd2d7cc62b823bd03d442befcdde1ee065365c340"
            },
            "downloads": -1,
            "filename": "windows_entry_exe-1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0683933cffaa82bdee84a27baac697ab",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.2",
            "size": 330004,
            "upload_time": "2024-07-26T04:59:48",
            "upload_time_iso_8601": "2024-07-26T04:59:48.497515Z",
            "url": "https://files.pythonhosted.org/packages/e9/0e/0bd86ffc0b30ad6684af850a087b960bd7e99583957b718e3ab38b08b2bb/windows_entry_exe-1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-26 04:59:48",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "alelec",
    "gitlab_project": "windows-entry-exe",
    "lcname": "windows-entry-exe"
}
        
Elapsed time: 0.30653s