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

Devops - Removed hatch #1035

Merged
merged 7 commits into from
Mar 26, 2025
Merged

Conversation

pabshazon
Copy link
Contributor

@pabshazon pabshazon commented Mar 16, 2025

Description

Removed hatch, setuptools, and updated docs

Motivation

Smaller memory footprint, simpler devops workflows, code as documentation

@pabshazon pabshazon changed the title Added hatch installation link to docs Docs - Added hatch installation link to docs Mar 16, 2025
@pabshazon pabshazon changed the title Docs - Added hatch installation link to docs Docs - Added hatch installation link Mar 16, 2025
@MagMueller
Copy link
Collaborator

Hi we use uv to manage dependencies and environments, Hatch might be redundant - what do you think?

@pabshazon
Copy link
Contributor Author

pabshazon commented Mar 17, 2025

Makes sense.
I have extended the PR to include the removal of all hatch dependencies I found, and the docs up to date.
Building and running here.
What do you think? Safe to remove hatch completely?

@pabshazon pabshazon changed the title Docs - Added hatch installation link Devops - Removed hatch Mar 17, 2025
@MagMueller
Copy link
Collaborator

@gregpr07

@MagMueller
Copy link
Collaborator

@pabshazon We load the buildDomTree.js as a resource in the pip package inside dom/service.py - do we need it for that inside the pip package?

@pabshazon
Copy link
Contributor Author

pabshazon commented Mar 18, 2025

@MagMueller , imo you do not need hatch nor setuptools as dependencies. Not in runtime, and not in dev.

With python -m build you will use hatchling (the minimal build package of hatch), as is configured so in the pyproject.toml file, and it is enough to package the .js file correctly into the dist package without the rest of hatch installed.

As I am looking at dom/service.py, you are managing that using importlib.resources (the native python lib to manage static resources into packages): is cool and efficient imo, and does not require hatch nor setuptools, because hatchling will correctly bundle the package with the .js file in its place.

✅ I did run a test in my local and is working without hatch nor setuptools deps. Committing it here for you to test - I am still unfamiliar with local env cache for testing.

@pabshazon
Copy link
Contributor Author

After building, you can unzip the wheel package and check the .js is inside the package.

Screenshot 2025-03-17 at 20 39 10

@pabshazon
Copy link
Contributor Author

pabshazon commented Mar 18, 2025

I think there might be an issue with the build workflows, in which you need the local dist/file to not exist, I have been using rm -rf dist in my local, not sure if you have local_dev scripts (they can help as documentation and automation at the same time).
In your github actions will not make an impact because vms for devops actions start without the 'dist' folder.

@pabshazon
Copy link
Contributor Author

pabshazon commented Mar 18, 2025

✅ Just tested with a fresh .venv and dist and worked well.
I wonder if you have dev scripts or runbooks to ensure all cache is deleted before new builds. Could be a good "first issue recommendation" for contributors.

@pirate pirate merged commit c6af409 into browser-use:main Mar 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants