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

Treat .pyw files as scripts in uv run on Windows #6453

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Treat .pyw files as scripts in uv run on Windows #6453

merged 1 commit into from
Aug 22, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Aug 22, 2024

Closes #6435

@zanieb zanieb added the bug Something isn't working label Aug 22, 2024
@zanieb
Copy link
Member Author

zanieb commented Aug 22, 2024

I haven't tested this. Do we need to use pythonw instead of python or something?

@samypr100
Copy link
Collaborator

I haven't tested this. Do we need to use pythonw instead of python or something?

Yup

@zanieb
Copy link
Member Author

zanieb commented Aug 22, 2024

Tragic. Will do that then.

@zanieb
Copy link
Member Author

zanieb commented Aug 22, 2024

Is that right? it should be spawned in the background?

@zanieb
Copy link
Member Author

zanieb commented Aug 22, 2024

(Yes, I think it is right)

@zanieb zanieb force-pushed the zb/run-pyw branch 3 times, most recently from 178d90c to b125e43 Compare August 22, 2024 21:36
@samypr100
Copy link
Collaborator

I just tried your branch, seems to work.

@zanieb
Copy link
Member Author

zanieb commented Aug 22, 2024

Thank you!

.is_some_and(|ext| ext.eq_ignore_ascii_case("py"))
&& target_path.exists()
} else if target_path.extension().is_some_and(|ext| {
ext.eq_ignore_ascii_case("py") || (cfg!(windows) && ext.eq_ignore_ascii_case("pyw"))
Copy link
Member

Choose a reason for hiding this comment

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

Should the || here be removed? What's the difference between this and the next branch?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh that's wrong, yes it should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

The next branch will use pythonw.exe to execute instead of python.exe

@zanieb zanieb enabled auto-merge (squash) August 22, 2024 23:02
@zanieb zanieb merged commit 99d278f into main Aug 22, 2024
56 checks passed
@zanieb zanieb deleted the zb/run-pyw branch August 22, 2024 23:07
zanieb pushed a commit that referenced this pull request Aug 23, 2024
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 25, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.3.1` -> `0.3.2` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.3.2`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#032)

[Compare Source](astral-sh/uv@0.3.1...0.3.2)

##### Configuration

-   Add support for configuring `python-downloads` with `UV_PYTHON_DOWNLOADS` ([#&#8203;6436](astral-sh/uv#6436))
-   Add support for configuring the `python-preference` with `UV_PYTHON_PREFERENCE` ([#&#8203;6432](astral-sh/uv#6432))
-   Deny invalid members in workspace schema ([#&#8203;6450](astral-sh/uv#6450))

##### Performance

-   Stop streaming wheels when `METADATA` is discovered (if range requests aren't supported) ([#&#8203;6470](astral-sh/uv#6470))

##### Bug fixes

-   Remove URI type from JSON Schema ([#&#8203;6449](astral-sh/uv#6449))
-   Fix retrieval of credentials for URLs from cache ([#&#8203;6452](astral-sh/uv#6452))
-   Restore `cache` suffix on Windows cache path ([#&#8203;6482](astral-sh/uv#6482))
-   Treat `.pyw` files as scripts in `uv run` on Windows ([#&#8203;6453](astral-sh/uv#6453))
-   Treat invalid extras as `false` in marker evaluation ([#&#8203;6395](astral-sh/uv#6395))
-   Avoid overwriting symlinks in `pip compile` output ([#&#8203;6487](astral-sh/uv#6487))

##### Documentation

-   Add `uv run` hint to the `uvx` guide ([#&#8203;6454](astral-sh/uv#6454))
-   Add a guide for using uv with FastAPI ([#&#8203;6401](astral-sh/uv#6401))
-   Add tip for using `managed = false` to disable project management ([#&#8203;6465](astral-sh/uv#6465))
-   Clarify the `uv tool run`, `uvx`, and `uv run` relationships ([#&#8203;6455](astral-sh/uv#6455))
-   Fix references to `--python-downloads` (it is `--no-python-downloads`) ([#&#8203;6439](astral-sh/uv#6439))
-   Further clarifications to the tools documentation ([#&#8203;6474](astral-sh/uv#6474))
-   Update docs dockerfile (bullseye -> bookworm) ([#&#8203;6441](astral-sh/uv#6441))
-   Update the installation documentation page ([#&#8203;6468](astral-sh/uv#6468))
-   Update pip compatibility pages to mention configuration files support ([#&#8203;6410](astral-sh/uv#6410))
-   Add `uv run` docs for gui scripts ([#&#8203;6478](astral-sh/uv#6478))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv run doesn't work on .pyw files
3 participants