Skip to content

Commit 9102a48

Browse files
committed
Release 2.0.0
1 parent 1fe9e97 commit 9102a48

File tree

7 files changed

+36
-109
lines changed

7 files changed

+36
-109
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,27 @@ jobs:
3535

3636
- name: Test
3737
run: poetry run pytest -rP .
38+
39+
publish:
40+
needs: [compile, test]
41+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout repo
45+
uses: actions/checkout@v4
46+
- name: Set up python
47+
uses: actions/setup-python@v4
48+
with:
49+
python-version: 3.8
50+
- name: Bootstrap poetry
51+
run: |
52+
curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1
53+
- name: Install dependencies
54+
run: poetry install
55+
- name: Publish to pypi
56+
run: |
57+
poetry config repositories.remote https://upload.pypi.org/legacy/
58+
poetry --no-interaction -v publish --build --repository remote --username "$PYPI_USERNAME" --password "$PYPI_PASSWORD"
59+
env:
60+
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
61+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

poetry.lock

Lines changed: 5 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[project]
2-
name = "browser-use"
2+
name = "browser-use-sdk"
33

44
[tool.poetry]
5-
name = "browser-use"
6-
version = "0.0.0"
5+
name = "browser-use-sdk"
6+
version = "2.0.0"
77
description = ""
88
readme = "README.md"
99
authors = []

src/browser_use/core/client_wrapper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ def __init__(
2222

2323
def get_headers(self) -> typing.Dict[str, str]:
2424
headers: typing.Dict[str, str] = {
25+
"User-Agent": "browser-use-sdk/2.0.0",
2526
"X-Fern-Language": "Python",
26-
"X-Fern-SDK-Name": "browser-use",
27-
"X-Fern-SDK-Version": "0.0.0",
27+
"X-Fern-SDK-Name": "browser-use-sdk",
28+
"X-Fern-SDK-Version": "2.0.0",
2829
**(self.get_custom_headers() or {}),
2930
}
3031
headers["X-Browser-Use-API-Key"] = self.api_key

src/browser_use/tasks/raw_client.py

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
from ..errors.bad_request_error import BadRequestError
1515
from ..errors.internal_server_error import InternalServerError
1616
from ..errors.not_found_error import NotFoundError
17-
from ..errors.payment_required_error import PaymentRequiredError
1817
from ..errors.unprocessable_entity_error import UnprocessableEntityError
19-
from ..types.insufficient_credits_error import InsufficientCreditsError
2018
from ..types.supported_ll_ms import SupportedLlMs
2119
from ..types.task_created_response import TaskCreatedResponse
2220
from ..types.task_list_response import TaskListResponse
@@ -230,17 +228,6 @@ def create_task(
230228
),
231229
),
232230
)
233-
if _response.status_code == 402:
234-
raise PaymentRequiredError(
235-
headers=dict(_response.headers),
236-
body=typing.cast(
237-
InsufficientCreditsError,
238-
construct_type(
239-
type_=InsufficientCreditsError, # type: ignore
240-
object_=_response.json(),
241-
),
242-
),
243-
)
244231
if _response.status_code == 404:
245232
raise NotFoundError(
246233
headers=dict(_response.headers),
@@ -263,17 +250,6 @@ def create_task(
263250
),
264251
),
265252
)
266-
if _response.status_code == 500:
267-
raise InternalServerError(
268-
headers=dict(_response.headers),
269-
body=typing.cast(
270-
typing.Optional[typing.Any],
271-
construct_type(
272-
type_=typing.Optional[typing.Any], # type: ignore
273-
object_=_response.json(),
274-
),
275-
),
276-
)
277253
_response_json = _response.json()
278254
except JSONDecodeError:
279255
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
@@ -682,17 +658,6 @@ async def create_task(
682658
),
683659
),
684660
)
685-
if _response.status_code == 402:
686-
raise PaymentRequiredError(
687-
headers=dict(_response.headers),
688-
body=typing.cast(
689-
InsufficientCreditsError,
690-
construct_type(
691-
type_=InsufficientCreditsError, # type: ignore
692-
object_=_response.json(),
693-
),
694-
),
695-
)
696661
if _response.status_code == 404:
697662
raise NotFoundError(
698663
headers=dict(_response.headers),
@@ -715,17 +680,6 @@ async def create_task(
715680
),
716681
),
717682
)
718-
if _response.status_code == 500:
719-
raise InternalServerError(
720-
headers=dict(_response.headers),
721-
body=typing.cast(
722-
typing.Optional[typing.Any],
723-
construct_type(
724-
type_=typing.Optional[typing.Any], # type: ignore
725-
object_=_response.json(),
726-
),
727-
),
728-
)
729683
_response_json = _response.json()
730684
except JSONDecodeError:
731685
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)

0 commit comments

Comments
 (0)