Skip to content

Install entrypoint scripts in develop command on Windows - #634

Merged
messense merged 2 commits into
PyO3:mainfrom
messense:windows-develop-scripts
Sep 23, 2021
Merged

Install entrypoint scripts in develop command on Windows#634
messense merged 2 commits into
PyO3:mainfrom
messense:windows-develop-scripts

Conversation

@messense

@messense messense commented Sep 21, 2021

Copy link
Copy Markdown
Member

Closes #213

Per https://pythonhosted.org/distlib/tutorial.html#using-the-scripts-api:

On Windows, on systems where the PEP 397 launcher isn’t installed, it is not easy to ensure that the correct Python interpreter is used for a script. You may wish to install native Windows executable launchers which run the correct interpreter, based on a shebang line in the script.

This is not as portable as embedding the script into the binary launcher, but better than nothing.

@netlify

This comment has been minimized.

@messense

Copy link
Copy Markdown
Member Author

The test failure looks like rust-lang/rust#42869

@messense

Copy link
Copy Markdown
Member Author

Even with PEP 397 launcher installed, .py and.pyw file extensions have to be properly associated with py.exe and pyw.exe to make scripts work. So I think this is somewhat useless, we have to go with the embedding the script into the binary launcher method to make it always work.

@davidhewitt

Copy link
Copy Markdown
Member

Do you need me to test this on my machine? (IIRC you have a mac?)

@messense

Copy link
Copy Markdown
Member Author

Do you need me to test this on my machine? (IIRC you have a mac?)

I've done some tests on a Windows VM, with file association correctly setup invoking the script in PowerShell works, but the test case somehow fails, I suspect it has something to do with Windows UNC path.

@messense
messense force-pushed the windows-develop-scripts branch from ecf0456 to ecc55ab Compare September 22, 2021 14:48
@messense messense changed the title Install entrypoint scripts in develop command on Windows using PEP 397 launcher Install entrypoint scripts in develop command on Windows Sep 22, 2021
@messense

Copy link
Copy Markdown
Member Author

@davidhewitt Please give it a try, looks like it's working on CI.

@messense
messense force-pushed the windows-develop-scripts branch 2 times, most recently from af5b7bb to c970923 Compare September 22, 2021 15:30
@messense
messense force-pushed the windows-develop-scripts branch from c970923 to d8c9552 Compare September 23, 2021 12:56
@messense

Copy link
Copy Markdown
Member Author

Tested again in Windows VM and both entrypoint scripts and cargo test works. Merging.

@messense
messense merged commit 15d646f into PyO3:main Sep 23, 2021
@messense
messense deleted the windows-develop-scripts branch September 23, 2021 15:41
@davidhewitt

Copy link
Copy Markdown
Member

Sorry I didn't get around to testing this in time - I've had a busy recent few days!

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Oct 1, 2021
https://build.opensuse.org/request/show/922513
by user mia + dimstar_suse
- Update to 0.11.4
  * Autodetect PyPy executables
    gh#PyO3/maturin#617
  * auditwheel: add `libz.so.1` to whitelisted libraries
    gh#PyO3/maturin#625
  * auditwheel: detect musl libc
    gh#PyO3/maturin#629
  * Fixed Python 3.10 and later versions detection on Windows
    gh#PyO3/maturin#630
  * Install entrypoint scripts in `maturin develop` command
    gh#PyO3/maturin#633
    gh#PyO3/maturin#634
  * Add support for installing optional dependencies in
    `maturin develop` command
    gh#PyO3/maturin#635
  * Fixed build error when `manylinux`/`compatibility` options is
    specified in `pyproject.toml`
    gh#PyO3/maturin#637
- Changes in 0.11.3:
  * Add path option for Python source
    gh#PyO3/maturin#584
  * Add auditwheel support for musllinux
    gh#PyO3/maturin#597
  * `[tool.m
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.

Installation of scripts

2 participants