Update setup.py, import distutils after setuptools#2459
Update setup.py, import distutils after setuptools#2459j9ac9k merged 1 commit intopyqtgraph:masterfrom
Conversation
This makes the package build again with newer setuptools, fixing this build failure:
make[2]: Leaving directory '/<<PKGBUILDDIR>>/doc'
dh_auto_build
I: pybuild base:240: /usr/bin/python3 setup.py build
/<<PKGBUILDDIR>>/setup.py:38: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
import distutils.dir_util
/usr/lib/python3/dist-packages/_distutils_hack/__init__.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the `distutils` module in `sys.modules`. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
warnings.warn(
/usr/lib/python3/dist-packages/_distutils_hack/__init__.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
Traceback (most recent call last):
File "/<<PKGBUILDDIR>>/setup.py", line 112, in <module>
setup(
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 172, in setup
ok = dist.parse_command_line()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 479, in parse_command_line
args = self._parse_command_opts(parser, args)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1107, in _parse_command_opts
nargs = _Distribution._parse_command_opts(self, parser, args)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 545, in _parse_command_opts
raise DistutilsClassError(
distutils.errors.DistutilsClassError: command class <class '__main__.Build'> must subclass Command
E: pybuild pybuild:379: build: plugin distutils failed with: exit code=1: /usr/bin/python3 setup.py build
dh_auto_build: error: pybuild --build -i python{version} -p 3.10 returned exit code 13
make[1]: *** [debian/rules:17: override_dh_auto_build] Error 25
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:6: binary-indep] Error 2
|
One of these days we're going to cleanup setup.py, but today is not this day. Thanks for the PR @LocutusOfBorg ! |
|
@LocutusOfBorg I have no problem merging this, but is there a reason you're still using |
|
@j9ac9k I'm the Debian maintainer and packager. We provide it via apt-get install python3-pyqtgraph. With Debian dependencies :) |
Oh right, we would like that to work for you all 😆 I'm not opposed to adding a CI pipeline to this repo test that the build process works so we don't leave you scrambling when we roll out a breaking change. I would likely need some assistance to make sure I'm actually testing what I think I'm testing. |
|
well, you never broke the Debian workflow, this is the first time, so maybe I can just open an issue here if this happens again :D |
|
We've had internal discussions about doing away w/ Maybe when we start work on that, one of us can reach out to you to see if we break things on your end? |
|
sure, whenever you want just ping me on irc or here |
This makes the package build again with newer setuptools, fixing this build failure:
make[2]: Leaving directory '/<>/doc'
dh_auto_build
I: pybuild base:240: /usr/bin/python3 setup.py build /<>/setup.py:38: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
import distutils.dir_util
/usr/lib/python3/dist-packages/_distutils_hack/init.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the
distutilsmodule insys.modules. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.warnings.warn(
/usr/lib/python3/dist-packages/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
Traceback (most recent call last):
File "/<>/setup.py", line 112, in
setup(
File "/usr/lib/python3/dist-packages/setuptools/init.py", line 87, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/core.py", line 172, in setup
ok = dist.parse_command_line()
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 479, in parse_command_line
args = self._parse_command_opts(parser, args)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 1107, in _parse_command_opts
nargs = _Distribution._parse_command_opts(self, parser, args)
File "/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py", line 545, in _parse_command_opts
raise DistutilsClassError(
distutils.errors.DistutilsClassError: command class <class 'main.Build'> must subclass Command
E: pybuild pybuild:379: build: plugin distutils failed with: exit code=1: /usr/bin/python3 setup.py build
dh_auto_build: error: pybuild --build -i python{version} -p 3.10 returned exit code 13
make[1]: *** [debian/rules:17: override_dh_auto_build] Error 25
make[1]: Leaving directory '/<>'
make: *** [debian/rules:6: binary-indep] Error 2
Detail the reasoning behind the code change. If there is an associated issue that this PR will resolve add
Fixes #
Other Tasks
Bump Dependency Versions
Files that need updates
Confirm the following files have been either updated or there has been a determination that no update is needed.
README.mdsetup.pytox.ini.github/workflows/main.ymland associatedrequirements.txtand condaenvironemt.ymlfilespyproject.tomlbinder/requirements.txtPre-Release Checklist
Pre Release Checklist
__init__.pyCHANGELOGprimarily using contents from automated changelog generation in GitHub release pagePost-Release Checklist
Steps To Complete
.dev0to__version__in__init__.py