Skip to content

Commit bc7ad11

Browse files
committed
Make pywin32_postinstall and pywin32_testall into console_scripts
1 parent c717bfa commit bc7ad11

5 files changed

Lines changed: 19 additions & 4 deletions

File tree

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Run tests
4747
# Run the tests directly from the source dir so support files (eg, .wav files etc)
4848
# can be found - they aren't installed into the Python tree.
49-
run: python pywin32_testall.py -v -skip-adodbapi
49+
run: python -m win32.scripts.pywin32_testall -v -skip-adodbapi
5050

5151
- name: Build wheels
5252
run: |

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Outside of a virtual environment you might want to install COM objects, services
5757
this by executing:
5858

5959
```shell
60-
python Scripts/pywin32_postinstall.py -install
60+
pywin32_postinstall -install
6161
```
6262

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

9393
```shell
94-
python Scripts/pywin32_postinstall.py -install
94+
pywin32_postinstall -install
9595
```
9696

9797
This will make some small attempts to cleanup older conflicting installs.

setup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2222,7 +2222,18 @@ def maybe_fixup_exes():
22222222
"user_access_control": "auto",
22232223
},
22242224
},
2225-
scripts=["pywin32_postinstall.py", "pywin32_testall.py"],
2225+
# This adds the scripts under Python3XX/Scripts, but doesn't actually do much
2226+
scripts=[
2227+
"win32/scripts/pywin32_postinstall.py",
2228+
"win32/scripts/pywin32_testall.py",
2229+
],
2230+
# This shortcuts `python -m win32.scripts.some_script` to just `some_script`
2231+
entry_points={
2232+
"console_scripts": [
2233+
"pywin32_postinstall = win32.scripts.pywin32_postinstall:main",
2234+
"pywin32_testall = win32.scripts.pywin32_testall:main",
2235+
]
2236+
},
22262237
ext_modules=ext_modules,
22272238
package_dir={
22282239
"win32com": "com/win32com",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,10 @@ def main():
702702
703703
> python pywin32_postinstall.py -install
704704
705+
* or if pywin32 is already installed:
706+
707+
> pywin32_postinstall -install
708+
705709
If you installed pywin32 via a .exe installer, this should be run
706710
automatically after installation, but if it fails you can run it again.
707711

0 commit comments

Comments
 (0)