You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @Avasam, thank you very much again for working in the migration.
Any install_* command is complicated...
There is actual no replacement since setuptools no longer is responsible for installing the package itself after the Python package ecosystem moved to a "post-PEP517" era.
In a "post-PEP517" scenario, all setuptools does is to create a .whl file (a custom .zip) which is then installed by pip without calling 3rd-party code. Customisation of install_* commands may (a) fail, (b) not behave as intended, or (c) be merely used to copy the files to their correct places inside the .whl archive - not in the end-user's machine.
I had a look at your setup.py. It seems that the only customisation is to re-use the install.install_lib directory. In turn, this seems (to me, and I maybe be interpreting the code wrong) like an attempt to abuse data_files/install_data to actually install package data or "synthetize on the fly" new packages1.
If that is the case, wouldn't it be a better option to use package data directly instead and/or package_dir?
Maybe you will also need a custom build step (example) for placing pywin32.pth (or other non-Python files directly inside site-packages).
Footnotes
If I am not mistaken, any folder in install.install_lib ends up in the site-packages folder, which is in sys.path. Any folder inside of a directory in sys.path is package itself (more specifically, a "namespace package" if it does not contain an __init__.py). ↩
Thank you for all the references and direct documentation links. This will require some exploration on my part, and fully understanding what and why pywin32 does so. (so far my interpretation is the same, pywin32 does programmatically and dynamically create multiple packages).
Might be a while though because this is low priority until pywin32 officially stops providing .exe installers, and running the setup script directly (which they already deprecated in favor of pip install)
Summary
I'm looking into progressively migrating
distutil
usage in pywin32 (mhammond/pywin32#2119), wheredistutils.command.install_data.install_data
is used.https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html#prefer-setuptools and https://peps.python.org/pep-0632/#migration-advice mention that
distutils.command.*
should be replaced bysetuptools.command.*
. However,setuptools.command.install_data
does not exist. I searched the documentation forinstall_data
and could not find any deprecation or migration mention.OS / Environment
Windows 10
Python 3.9
setuptools 68.2.2
Additional Information
Document a migration path for
distutils.command.install_data
Code of Conduct
The text was updated successfully, but these errors were encountered: