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

Make pywin32_postinstall and pywin32_testall into Console Scripts #2408

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Run tests
# Run the tests directly from the source dir so support files (eg, .wav files etc)
# can be found - they aren't installed into the Python tree.
run: python pywin32_testall.py -v -skip-adodbapi
run: python -m win32.scripts.pywin32_testall -v -skip-adodbapi

- name: Build wheels
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Outside of a virtual environment you might want to install COM objects, services
this by executing:

```shell
python Scripts/pywin32_postinstall.py -install
pywin32_postinstall -install
```

From the root of your Python installation.
Expand Down Expand Up @@ -91,7 +91,7 @@ It usually means one of 2 things:
So you should run it again:

```shell
python Scripts/pywin32_postinstall.py -install
pywin32_postinstall -install
```

This will make some small attempts to cleanup older conflicting installs.
Expand Down
13 changes: 12 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,18 @@ def maybe_fixup_exes():
"user_access_control": "auto",
},
},
scripts=["pywin32_postinstall.py", "pywin32_testall.py"],
# This adds the scripts under Python3XX/Scripts, but doesn't actually do much
scripts=[
"win32/scripts/pywin32_postinstall.py",
"win32/scripts/pywin32_testall.py",
],
Comment on lines +2215 to +2219
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm keeping this for now as to not break some poor sysadmin's workflow of looking in Python's Scripts folder 😉 (then again, they were probably using .exe installers, but it's barely 4 lines to keep the support)

# This shortcuts `python -m win32.scripts.some_script` to just `some_script`
entry_points={
"console_scripts": [
"pywin32_postinstall = win32.scripts.pywin32_postinstall:main",
"pywin32_testall = win32.scripts.pywin32_testall:main",
]
},
ext_modules=ext_modules,
package_dir={
"win32com": "com/win32com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,10 @@ def main():

> python pywin32_postinstall.py -install

* or if pywin32 is already installed:

> pywin32_postinstall -install

If you installed pywin32 via a .exe installer, this should be run
automatically after installation, but if it fails you can run it again.

Expand Down
File renamed without changes.
Loading