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

Andrew/refactor #178

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open

Andrew/refactor #178

wants to merge 35 commits into from

Conversation

ayjayt
Copy link
Collaborator

@ayjayt ayjayt commented Jan 5, 2025

This is a relatively large refactor but each commit is well written in stages.

That said, intermediate stages (commits) don't function.


description

We start with creating browser specific classes that ONLY return the CLI and env vars for a specific brand.

This lets us split the stages:

  1. processing starting/stopping in its own idea
  2. its own classes generating proper cli/env vars (must read the Pipe, now called channel, see below)
  3. a separate browser_wrapper now with above functions removed so the wrapper does it's one function of
    securing the proper file descriptors.

This requires two other refactors:

First:
Pipe will be refactored to have a standard interface (although it wont necessarily be enforced)
Pipe will split out serializer so that other channel types (like WebSocket) can use it.
Second:
System utilities needs to better divide its concerns:

  1. finding paths
  2. downloading a browser
  3. getting a specific path
  4. temp files

Then, the last refactor will be splitting browser into sync and async, where async will be composed with a broker class to separate the ideas of process control and async manage (sync doesnt really need a broker since sync can't do any sort of management anyway since it can't deal with the inherent asyncronicity of the process-process interaction).

After that, tests will be fixed since namespaces will have changed, even if expectations havent.

Documentation will then be included and built.

And we launch v1.0.0rc on testpypi.

ayjayt added 30 commits January 4, 2025 08:28
Pipe will eventually be one of two options (the other being websocket),
and since we're currently writing a CLI+ENV var generator for
chromium/chrome/edge (eventually supporting firefox), Pipe is now a bit
better organized so that these other classes can detect it and better
interpret it.
sys utils needs to be refactored before we can finish browser
since sys utils will provide mechanisms to find chromium
issue where BROWSER_PATH might now also be firefox
but I suppose that just means you would have to specify firefox
I think brave will work with this
_browsers/ interfaces have now changed a bit to

1. provide popen args
2. find their own path

Plus we've exported a lot of needed symbols in various __init__.py's

Plus organized and renamed some stuff among the tmpfiles
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.

1 participant