Skip to content

Add a guide to creating a native Windows application in Python - #1778

Open
pfmoore wants to merge 13 commits into
python:mainfrom
pfmoore:windows_apps
Open

pfmoore wants to merge 13 commits into
python:mainfrom
pfmoore:windows_apps

Conversation

@pfmoore

@pfmoore pfmoore commented Jan 7, 2025 •

Copy link
Copy Markdown
Member

Based on the discussion here and @zooba's blog post here.


📚 Documentation preview 📚: https://python-packaging-user-guide--1778.org.readthedocs.build/en/1778/

@pfmoore

pfmoore commented Jan 7, 2025

Copy link
Copy Markdown
Member Author

Hmm, I was going to add @zooba as a reviewer, but I don't seem to be able to do so.

@pfmoore

pfmoore commented Jan 7, 2025

Copy link
Copy Markdown
Member Author

The codespell check is flagging a compiler option. Is there any way I can suppress it?

Co-authored-by: sinoroc <5529267+sinoroc@users.noreply.github.com>
@pfmoore
pfmoore force-pushed the windows_apps branch 2 times, most recently from 7648a6a to 77ee674 Compare January 7, 2025 18:04
pfmoore and others added 2 commits February 17, 2025 16:22
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
@rgommers rgommers added type: enhancement A self-contained enhancement or new feature component: guides labels Nov 10, 2026
@rgommers

Copy link
Copy Markdown
Contributor

This seems like a useful guide, however given the amount of C code, the topic of embedding, manual compiler/linker invocation, and tkinter/subprocesses, this seems to fit way better in the CPython docs than in the Packaging User Guide. Especially given that it punts on distribution with "This guide doesn't cover installers, as they are a complex subject of their own. However, the requirements of a Python application built this way are fairly trivial." There isn't really anything comparable in the Packaging Guide at the moment. Is there a reason not to put it in the CPython docs @pfmoore?

@pfmoore

pfmoore commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

There's not really anything comparable in the CPython docs either, so I'm not sure it would be any better there than here. I'm not particularly motivated to try to get it into the CPython docs myself, but if someone else wants to do so, that's fine by me.

My main concern is to get this documented somewhere, because at the moment this sort of information is basically impossible to find, and as far as I can tell, everyone either makes up their own solution or gives up and uses something like pipx instead. I very strongly believe that the packaging community should be doing more to help people writing standalone Python applications and publishing executable scripts/apps, not focusing solely on library packaging and wheels. But it's hard to get any support to take that forward (maybe it's something the PPC can "officially" make part of the scope of "packaging", and that will affect how people think of it?)

Part of the problem here is that it's very much a Windows issue - Linux (and Mac?) users can simply ship a script with a shebang file, and it's as good as a binary executable. But Windows treats .exe files specially at the OS level, and any approach that isn't a genuine .exe has weird edge cases (which may not matter for a particular use case, which might be why "make up your own solution" is good enough for many people...?)

I don't have a great answer here. But I feel that merging this as it stands is at least better than doing nothing, and leaving the issue unresolved. "The perfect is the enemy of the good" and all that 🙂

@pfmoore

pfmoore commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

There isn't really anything comparable in the Packaging Guide at the moment.

Actually, https://packaging.python.org/en/latest/guides/creating-command-line-tools/ is very much a comparable topic. It's recommending pipx, which is a great solution for certain types of tool, but this PR adds another option for cases when pipx isn't suitable (e.g., when the project maintainer can't assume the end user will have Python installed, or that they will be comfortable installing and managing a copy of pipx).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: guides type: enhancement A self-contained enhancement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants