Skip to content

[🐛 Bug]: Instructions for setting up a local development environment for Python need updating #15369

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

Closed
cgoldberg opened this issue Mar 3, 2025 · 5 comments · Fixed by #15424
Labels
A-needs-triaging A Selenium member will evaluate this soon! I-defect Something is not working as intended

Comments

@cgoldberg
Copy link
Contributor

cgoldberg commented Mar 3, 2025

What happened?

Does anyone know how to setup a local development environment for Python?

There are some outdated build instructions here:

... but they no longer work. I would like to get it working then update those instructions.

The goal:

I have the selenium repo cloned and all I want to be able to do is make some changes to the source code, then build the package so I can import it and use it. Ideally, it would be installed in editible mode, so I can work on the package without reinstalling it.

I can't use Bazel and all the selenium build machinery... I just want an isolated Python environment using standard Python tooling. I looked through the Bazel configs to see how it builds the Python bindings, but I can't figure out how to do the same outside of Bazel.

What I've tried:

After cloning the repo, I would think I could just create a virtual environment, install requirements, then install with pip in editible mode:

cd selenium/py
python3 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt
pip install -e .

But this fails while building the package. It fails on the running build_rust step with the error:

distutils.errors.DistutilsFileError: can't find manifest for Rust extension `selenium.webdriver.common.selenium-manager` at path `Cargo.toml`

Am I missing a step or some dependency?

Can anyone help me out?


How can we reproduce the issue?

Try to setup a local Python development environment.

Relevant log output

N/A

Operating System

Linux (Debian)

Selenium version

Python

What are the browser(s) and version(s) where you see this issue?

N/A

What are the browser driver(s) and version(s) where you see this issue?

N/A

Are you using Selenium Grid?

N/A

@cgoldberg cgoldberg added I-defect Something is not working as intended A-needs-triaging A Selenium member will evaluate this soon! labels Mar 3, 2025
Copy link

github-actions bot commented Mar 3, 2025

@cgoldberg, 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, MSEdgeDriver, 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!

@Delta456
Copy link
Member

Delta456 commented Mar 4, 2025

Have you checked https://github.com/SeleniumHQ/selenium?tab=readme-ov-file#developing? It has instructions for Python bindings, and they work. Wikia was updated in 2018, which would make it several years outdated. Probably should remove it entirely, IMO.

@cgoldberg
Copy link
Contributor Author

Yes, I have seen that readme. That method works, but it requires you to have Bazel/Go/Java/Rust/Cargo and a lot of dependencies installed... which I was trying to avoid. It also builds a new python package (wheel/sdist), that you then need to install to use the modified code... so that's a very slow/tedious way to do development.

I finally got it all figured out, and have a development environment setup that runs directly from source using plain old Python tooling. I will write up instructions somewhere then close this issue. I will also either update or remove that wiki content.

@Delta456
Copy link
Member

Delta456 commented Mar 4, 2025

I am looking forward to your development environment setup!

I feel many people including myself didn't know there's a wiki so it never got updated with time 😅

Copy link

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-needs-triaging A Selenium member will evaluate this soon! I-defect Something is not working as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants