- Notifications
You must be signed in to change notification settings - Fork317
Description
I want to propose that WinPython include the original wheels in the distribution instead of a pre-installed/configured Python environment. This has two benefits.
The first benefit is that it allows the users to verify the integrity of the.whl
files for tampering, by confirming that the SHA256 of the wheel files match the ones in PyPI. This is excellent from a security standpoint.
The second benefit is that it would allow users the flexibility to create virtual environments and install only the packages that they need into them usingpip install
oruv pip install
. This is preferred over puttingC:WinPython\python\Scripts
andC:\WinPython\python
on the system PATH, because it allows for dependency isolation in projects and avoids the need for a mutable system environment.
The only downside is that WinPython users would have a bit of initial setup to do. They would need to create the venv and pip install the packages they need. I would argue that this is a universal practice in Python that every user should know how to do... but WinPython could still provide a helper script (i.e.setup.bat
) to take care of it.
From WinPython root, createrequirements.txt
containing all WinPython packages:
python\python.exe -m pip freeze> requirements.txtmkdir wheelspython\python.exe -m pip download -r requirements.txt -d wheels
Note that in my testing with WinPython3.13.1.1slimb2
I had to manually remove the following packages fromrequirements.txt
becausepip download
could not find these pinned versions on PyPI:
adodbapi==2.6.1.3
baresql==0.8.0
db.py==0.5.4b1
formlayout==1.2.1a1
pdfrw==0.4.post2
ppci==0.5.9
PySimpleGUI==4.60.4
sqlite_bro==0.13.1
winpython==11.4.20250119
Assuming the new WinPython distribution has awheels
directory instead of pre-installed packages, usesetup.bat
script after unzipping:
From WinPython root:
cd pythonpython -m venv .venv --prompt WinPython.venv\Scripts\activatepip install --no-index --find-links=wheels/ -r requirements.txt
After runningsetup.bat
, users can either putC:\WinPython\.venv\Scripts
on the PATH or activate it usingC:\WinPython\.venv\Scripts\activate
when they need to work 😄