Description
I've been poking at this problem this afternoon as I think it is perhaps the root of why there isn't a version of pygame_sdl2 that we can just grab via pip on windows.
To see the problem, instead of running the normal:
python setup.py install
command, run:
python setup.py sdist
and then try to install the resulting tarball with pip like so:
pip install dist\pygame_sdl2-2.1.0.tar.gz
and you will quickly come a cropper.
Poking into the (pretty complicated!) setup.py file it looks like the issues stem from the code that is being used to copy the windows dependencies from where you plonk them in your root pygame_sdl2 directory over to your install location.
Once you wade through some unhandled exceptions (it seems that pip expects the setuplib.py file to handle it's own exceptions and won't tolerate them bubbling up to setup.py) you get to the meat of the problem which is that the windows dependencies that the setup.py code wants to copy to your install directory with shutil.copy
aren't being bundled in to the tarball.
I'm far from an expert in these matters having only really looked into it for the first time today, but I feel like there has been some confusion over the role of the setup.py file in installing python packages somewhere along the way. It appears that code in setup.py is designed to be run on already packaged up python projects to do some additional setup, but the windows dependency code in there right now is designed to add data from a source directory (that doesn't exist in the package) to a package.
It works with the rough and ready python setup.py install
because the user drags the windows dependency directory into the package before the script is run and the package directory is synonymous with our source directory.
What probably needs to change is either that we include the windows dependency files copy from location in the package (pygame_sdl2_windeps) or we move the code that copies files from the windows dependency directory to some place other than the setup.py file.
I'm happy to poke at this further, but I really have very little idea what I'm doing.