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

Change name of devtools to choreographer #142

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
src: './app'
- uses: chartboost/ruff-action@v1
with:
src: './devtools'
src: './choreographer'
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install chromium-browser xvfb
#- uses: ./.github/actions/ # it would be nice but it doesn't support timeout-minutes
- name: Install devtools
- name: Install Choreographer
Copy link
Contributor

@gvwilson gvwilson Oct 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the upper-case 'C' in this test.yml file but lower-case 'c' elsewhere in this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2nd grade "titles should be capitalized!" habit

run: pip install .[dev]
- name: DTDoctor
run: dtdoctor --no-run
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Install Dependencies
run: choco install googlechrome -y --ignore-checksums
#- uses: ./.github/actions/
- name: Install devtools
- name: Install Choreographer
run: pip install .[dev]
- name: DTDoctor
run: dtdoctor --no-run
Expand All @@ -58,7 +58,7 @@ jobs:
- name: Install Dependencies
run: brew install google-chrome
#- uses: ./.github/actions/
- name: Install devtools
- name: Install Choreographer
run: pip install .[dev]
- name: DTDoctor
run: dtdoctor --no-run
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Devtools Protocol

`devtools` allows remote control of browsers from Python.
`choreographer` allows remote control of browsers from Python.
It is a work in progress:
only Chrome-ish browsers are supported at the moment,
and the name will change before the first release to PyPI.
Expand Down Expand Up @@ -49,11 +49,11 @@ Save the following code to `example-01.py` and run with Python.

```
import asyncio
import devtools
import choreographer as choreo


async def example():
browser = await devtools.Browser(headless=False)
browser = await choreo.Browser(headless=False)
tab = await browser.create_tab("https://google.com")
await asyncio.sleep(3)
await tab.send_command("Page.navigate", params={"url": "https://github.com"})
Expand All @@ -69,7 +69,7 @@ Step by step, this example:
1. Imports the required libraries.
1. Defines an `async` function
(because `await` can only be used inside `async` functions).
1. Asks `devtools` to create a browser.
1. Asks `choreographer` to create a browser.
`headless=False` tells it to display the browser on the screen;
the default is no display.
1. Wait three seconds for the browser to be created.
Expand Down Expand Up @@ -113,7 +113,7 @@ Try adding the following to the example shown above:
You can use this library without `asyncio`,

```
my_browser = devtools.Browser() # blocking until open
my_browser = choreo.Browser() # blocking until open
```

However,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ build-backend = "setuptools.build_meta"
find = {namespaces = false}

[project]
name = "devtools"
description = "Devtools protocol"
name = "choreographer"
description = "Devtools Protocol implementation for chrome"
requires-python = ">=3.9"
dynamic = ["version"]

Expand All @@ -20,7 +20,7 @@ dev = [
]

[project.scripts]
dtdoctor = "devtools.browser:diagnose"
dtdoctor = "choreographer.browser:diagnose"

[tool.ruff.lint]
ignore = ["E701"]
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio
import pytest
import pytest_asyncio
import devtools
import choreographer as choreo

@pytest.fixture(params=[True, False], ids=["headless", ""])
def headless(request):
Expand All @@ -28,15 +28,15 @@ async def browser(request):
headless = request.config.getoption("--headless")
debug = request.config.get_verbosity() > 2

browser = await devtools.Browser(
browser = await choreo.Browser(
headless=headless, debug=debug, debug_browser=debug
)
yield browser
await browser.close()

@pytest_asyncio.fixture(scope="function", loop_scope="function")
async def browser_verbose():
browser = await devtools.Browser(debug=True, debug_browser=True)
browser = await choreo.Browser(debug=True, debug_browser=True)
yield browser
await browser.close()

Expand Down
10 changes: 5 additions & 5 deletions tests/test_process.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import asyncio

import devtools
import choreographer as choreo

import pytest
from async_timeout import timeout


@pytest.mark.asyncio(loop_scope="function")
async def test_context(capteesys, headless, debug, debug_browser):
async with devtools.Browser(
async with choreo.Browser(
headless=headless,
debug=debug,
debug_browser=debug_browser,
Expand All @@ -17,7 +17,7 @@ async def test_context(capteesys, headless, debug, debug_browser):
assert "result" in response and "targetInfos" in response["result"]
assert (len(response["result"]["targetInfos"]) != 0) != headless
if not headless:
assert isinstance(browser.get_tab(), devtools.tab.Tab)
assert isinstance(browser.get_tab(), choreo.tab.Tab)
assert len(browser.get_tab().sessions) == 1
print("") # this makes sure that capturing is working
# stdout should be empty, but not because capsys is broken, because nothing was print
Expand All @@ -27,7 +27,7 @@ async def test_context(capteesys, headless, debug, debug_browser):

@pytest.mark.asyncio(loop_scope="function")
async def test_no_context(capteesys, headless, debug, debug_browser):
browser = await devtools.Browser(
browser = await choreo.Browser(
headless=headless,
debug=debug,
debug_browser=debug_browser,
Expand All @@ -38,7 +38,7 @@ async def test_no_context(capteesys, headless, debug, debug_browser):
assert "result" in response and "targetInfos" in response["result"]
assert (len(response["result"]["targetInfos"]) != 0) != headless
if not headless:
assert isinstance(browser.get_tab(), devtools.tab.Tab)
assert isinstance(browser.get_tab(), choreo.tab.Tab)
assert len(browser.get_tab().sessions) == 1
finally:
await browser.close()
Expand Down
Loading