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

Breaking change in setuptools 50+ #2222

Closed
krzywon opened this issue Sep 26, 2022 · 5 comments · Fixed by #2233
Closed

Breaking change in setuptools 50+ #2222

krzywon opened this issue Sep 26, 2022 · 5 comments · Fixed by #2233
Labels
Blocker Prevents a different issue from being resolved Critical High priority Discuss At The Call Issues to be discussed at the fortnightly call

Comments

@krzywon
Copy link
Contributor

krzywon commented Sep 26, 2022

Describe the bug

Running GitHub workflow-generated installers on Windows, the following error occurs:

Traceback (most recent call last):
File "sasview.py", line 15, in
File "sas\qtgui\MainWindow\MainWindow.py", line 120, in run_sasview
File "sas\qtgui\MainWindow\MainWindow.py", line 46, in init
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "sas\qtgui\MainWindow\GuiManager.py", line 14, in
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "matplotlib_init_.py", line 112, in
File "distutils_hack_init.py", line 88, in create_module
File "importlib_init_.py", line 127, in import_module
File "PyInstaller\loader\pyimod02_importers.py", line 499, in exec_module
File "setuptools_init_.py", line 10, in
File "distutils_hack_init.py", line 88, in create_module
File "importlib_init_.py", line 127, in import_module
ModuleNotFoundError: No module named 'setuptools._distutils'

There is an issue in the setuptools repo describing the change and potential workarounds, but I haven't read the full thread yet.

To Reproduce
Download a recent windows installer generated by a push or PR, install the software, and try to run sasview.

SasView version (please complete the following information):

  • Version: post 5.0.5
@krzywon krzywon added Critical High priority Blocker Prevents a different issue from being resolved labels Sep 26, 2022
@lucas-wilkins
Copy link
Contributor

You working on this?

@lucas-wilkins
Copy link
Contributor

I'm trying using "setuptools<50" in installers.yml for now.

@lucas-wilkins lucas-wilkins linked a pull request Sep 26, 2022 that will close this issue
@krzywon
Copy link
Contributor Author

krzywon commented Sep 26, 2022

You working on this?

Not yet, no. Have at it.

@lucas-wilkins
Copy link
Contributor

So, I have tried setting the environment variable SETUPTOOLS_USE_DISTUTILS via the iss file, and during creation via installers.yml. Neither work. I've also tried setting the setuputils version in the pip command to <50, that doesn't work either.

Giving up, at least for today, probably longer.

@llimeht
Copy link
Contributor

llimeht commented Sep 27, 2022

This is a pair of "pyinstaller" vs "old versions" and "incompatible pinning" issues.

Fortunately, it can be fixed pretty easily in two ways:

  • Force a newer setuptools into the build. pyinstaller understand setuptools > 65 quite well and if setuptools > 65 is included instead, then it all works. I say "force", because numba has an upper bound on its setuptools version of "< 60" and so pip will downgrade setuptools while installing numba. That downgrade would also be why any of your attempts so far to work around this have failed. Luckily for us, numba doesn't actually need setuptools at runtime at all and that upper bound is relevant only to building numba (and it should be removed!)
  • Getting away from the matplotlib==2.2.5 that is pinned in the installers.yml would also help. The currently supported release of matplotlib (3.5.x) doesn't have any runtime requirement on distutils (and therefore setuptools doing strange things doesn't hurt it). As a bonus, a newer matplotlib will have better support in pyinstaller.

Have I mentioned how much I dislike version pinning recently?

Because pip is pretty dumb in how it handles dependencies, adding python -m pip install "setuptools>=65" as the last step of the install step in installers.yml will convince it to upgrade setuptools just emitting lots of error messages, but not failing the build.

For example in: main...llimeht:sasview:tmp/setuptools-win

I can break that into several PRs if you want, but note that #2216 needs to land first.

@lucas-wilkins lucas-wilkins added the Discuss At The Call Issues to be discussed at the fortnightly call label Sep 27, 2022
llimeht added a commit to llimeht/sasview that referenced this issue Oct 4, 2022
Unpinning matplotlib allows a newer matplotlib to be installed, saves it
being broken by setuptools, and should therefore unbreak the build.

Closes: SasView#2222
llimeht added a commit to llimeht/sasview that referenced this issue Oct 10, 2022
Unpinning matplotlib allows a newer matplotlib to be installed, saves it
being broken by setuptools, and should therefore unbreak the build.

Closes: SasView#2222
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker Prevents a different issue from being resolved Critical High priority Discuss At The Call Issues to be discussed at the fortnightly call
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants