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

[🐛 Bug]: INSTALL_SCHEMES and setuptools 60+ #10268

Closed
stanislavlevin opened this issue Jan 20, 2022 · 5 comments
Closed

[🐛 Bug]: INSTALL_SCHEMES and setuptools 60+ #10268

stanislavlevin opened this issue Jan 20, 2022 · 5 comments

Comments

@stanislavlevin
Copy link

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 pypa/distutils#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

@github-actions
Copy link

@stanislavlevin, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@titusfortner
Copy link
Member

I'm not familiar with this part of the Python setup. Is there a fix that you can propose? Thanks.

@titusfortner
Copy link
Member

closing due to lack of clarification. Can reopen if additional info is provided.

@stanislavlevin
Copy link
Author

@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']

@github-actions
Copy link

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.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants