[🐛 Bug]: INSTALL_SCHEMES and setuptools 60+
See original GitHub issueWhat happened?
I’m packaging python-selenium in ALTLinux.
https://docs.python.org/3/whatsnew/3.10.html#distutils-deprecated:
The entire distutils package is deprecated, to be removed in Python 3.12. Its functionality for specifying package builds has already been completely replaced by third-party packages setuptools and packaging, and most other commonly used APIs are available elsewhere in the standard library (such as platform, shutil, subprocess or sysconfig). There are no plans to migrate any other functionality from distutils, and applications that are using other functions should plan to make private copies of the code. Refer to PEP 632 for discussion.
setuptools is the new home for distutils and from 60+ setuptools enables its own copy of distutils by default. With this change, the hack in setup.py of selenium no longer works since INSTALL_SCHEMES are no longer considered as scheme source (a scheme is taken from sysconfig). See https://github.com/pypa/distutils/pull/79 for details.
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['purelib']
This led to the wrong installation path for data (depend on selected installation scheme), e.g.
/usr/selenium/webdriver/remote/getAttribute.js
/usr/selenium/webdriver/remote/isDisplayed.js
while the expected path is /usr/lib64/python3/site-packages/selenium/webdriver/remote/
.
Note: even I have too old selenium I see exactly the same code in master.
For my distro I dropped the hack and added cli option --install-data
for python setup.py install
.
How can we reproduce the issue?
1) install setuptools 60+
2) `/usr/bin/python3 setup.py install --skip-build --root=/usr/src/tmp/python3-module-selenium-buildroot --force`
Relevant log output
running install_data
creating /usr/src/tmp/python3-module-selenium-buildroot/usr/selenium
creating /usr/src/tmp/python3-module-selenium-buildroot/usr/selenium/webdriver
creating /usr/src/tmp/python3-module-selenium-buildroot/usr/selenium/webdriver/firefox
creating /usr/src/tmp/python3-module-selenium-buildroot/usr/selenium/webdriver/firefox
/x86
copying py/selenium/webdriver/firefox/x86/x_ignore_nofocus.so -> /usr/src/tmp/python3-
module-selenium-buildroot/usr/selenium/webdriver/firefox/x86
creating /usr/src/tmp/python3-module-selenium-buildroot/usr/selenium/webdriver/firefox
/amd64
copying py/selenium/webdriver/firefox/amd64/x_ignore_nofocus.so -> /usr/src/tmp/python
3-module-selenium-buildroot/usr/selenium/webdriver/firefox/amd64
creating /usr/src/tmp/python3-module-selenium-buildroot/usr/selenium/webdriver/remote
copying py/selenium/webdriver/remote/getAttribute.js -> /usr/src/tmp/python3-module-se
lenium-buildroot/usr/selenium/webdriver/remote
copying py/selenium/webdriver/remote/isDisplayed.js -> /usr/src/tmp/python3-module-sel
enium-buildroot/usr/selenium/webdriver/remote
Operating System
ALTLinux
Selenium version
3.0.2
What are the browser(s) and version(s) where you see this issue?
0
What are the browser driver(s) and version(s) where you see this issue?
0
Are you using Selenium Grid?
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
@titusfortner, sorry for delay. I’ve migrated selenium to 3.14.1.
3.14.1 lacks either
data_files
orpackage_data
insetup.py
and relies oninclude_package_data
andMANIFEST.in
.Since the issue has been fixed in the recent version of selenium this ticket can be closed, but most likely the code below (
setup.py
) is dead:This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.