question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[🐛 Bug]: INSTALL_SCHEMES and setuptools 60+

See original GitHub issue

What 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:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
stanislavlevincommented, Feb 7, 2022

@titusfortner, sorry for delay. I’ve migrated selenium to 3.14.1.

3.14.1 lacks either data_files or package_data in setup.py and relies on include_package_data and MANIFEST.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:

 26 for scheme in INSTALL_SCHEMES.values():                                          
 27     scheme['data'] = scheme['purelib']
0reactions
github-actions[bot]commented, Mar 10, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

History - setuptools 65.6.3.post20221124 documentation
Future releases of setuptools may simply ignore externally set metadata not backed by dynamic or even halt the build with an error.
Read more >
Python distutils keyError - setuptools - Stack Overflow
I downgraded to setuptools==58.2.0 and now it works fine again. ... I'm getting the same error as you. Staging server setup last week...
Read more >
Build "can not execute setup.py since setuptools is not available"
I'm trying to deploy my first blueprint, and running into an issue that I'm not understanding. I've got a Django project, and from...
Read more >
setuptools 3.8.1 - PyPI
2.0.1. Issue #124: Fixed error in list detection in upload_docs. ... Issue #60: On Windows, Setuptools supports deferring to another launcher, such as...
Read more >
[TRACKER] Packages broken by dev-python/setuptools >= 60 ...
If you hit bugs with SETUPTOOLS_USE_DISTUTILS=local, please retest with the newest version of dev-python/setuptools.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found