Skip to content

Commit 6dfb110

Browse files
srirclaude
authored andcommitted
Remove PyPI publish workflow (#2)
* Remove PyPI publish workflow, fix CI issues - Remove publish-pypi.yml (private fork, no PyPI publishing) - Exclude _compat.py from mypy (type comparison issues) - Fix mock.patch strings in tests (orb -> orb_sdk) - Fix error message strings in tests - Update apply-customizations.sh with all fixes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix import check in scripts/lint - Update scripts/lint to import orb_sdk instead of orb - Simplify mypy exclude (no need for _compat.py exclusion) - Update apply-customizations.sh to fix scripts/lint 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Use Python 3.9 to match upstream - Match upstream's Python 3.9.18 version - This avoids mypy differences between Python versions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Remove release-doctor workflow Not needed since we're not publishing to PyPI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Remove pydantic v1 tests from CI We only use pydantic v2, so no need to run v1 tests. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent a6be5a1 commit 6dfb110

8 files changed

Lines changed: 29 additions & 70 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/release-doctor.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.11.6
1+
3.9.18

scripts/apply-customizations.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ find tests -name "*.py" -exec sed -i 's/from orb$/from orb_sdk/g' {} +
2424
find tests -name "*.py" -exec sed -i 's/import orb\([^_]\)/import orb_sdk\1/g' {} +
2525
find tests -name "*.py" -exec sed -i 's/import orb$/import orb_sdk/g' {} +
2626

27+
# Update mock.patch strings and error messages in tests
28+
echo "Updating mock.patch and error message strings in tests/"
29+
find tests -name "*.py" -exec sed -i "s/\"orb\._/\"orb_sdk._/g" {} +
30+
find tests -name "*.py" -exec sed -i "s/'orb\._/'orb_sdk._/g" {} +
31+
32+
# Update scripts/lint import check
33+
echo "Updating scripts/lint import check"
34+
sed -i "s/python -c 'import orb'/python -c 'import orb_sdk'/" scripts/lint
35+
36+
# Remove pydantic v1 tests (we only use pydantic v2)
37+
echo "Removing pydantic v1 tests from scripts/test"
38+
sed -i '/Running Pydantic v1 tests/d' scripts/test
39+
sed -i '/nox -s test-pydantic-v1/d' scripts/test
40+
2741
# Update pyproject.toml
2842
echo "Updating pyproject.toml"
2943
sed -i 's/name = "orb-billing"/name = "orb_sdk"/' pyproject.toml

scripts/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ else
1313
fi
1414

1515
echo "==> Making sure it imports"
16-
rye run python -c 'import orb'
16+
rye run python -c 'import orb_sdk'

scripts/test

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,3 @@ export DEFER_PYDANTIC_BUILD=false
5656

5757
echo "==> Running tests"
5858
rye run pytest "$@"
59-
60-
echo "==> Running Pydantic v1 tests"
61-
rye run nox -s test-pydantic-v1 -- "$@"

tests/test_client.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ def test_parse_retry_after_header(
869869
calculated = client._calculate_retry_timeout(remaining_retries, options, headers)
870870
assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType]
871871

872-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
872+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
873873
@pytest.mark.respx(base_url=base_url)
874874
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Orb) -> None:
875875
respx_mock.post("/customers").mock(side_effect=httpx.TimeoutException("Test timeout error"))
@@ -879,7 +879,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien
879879

880880
assert _get_open_connections(client) == 0
881881

882-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
882+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
883883
@pytest.mark.respx(base_url=base_url)
884884
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Orb) -> None:
885885
respx_mock.post("/customers").mock(return_value=httpx.Response(500))
@@ -889,7 +889,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client
889889
assert _get_open_connections(client) == 0
890890

891891
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
892-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
892+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
893893
@pytest.mark.respx(base_url=base_url)
894894
@pytest.mark.parametrize("failure_mode", ["status", "exception"])
895895
def test_retries_taken(
@@ -920,7 +920,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
920920
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
921921

922922
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
923-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
923+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
924924
@pytest.mark.respx(base_url=base_url)
925925
def test_omit_retry_count_header(self, client: Orb, failures_before_success: int, respx_mock: MockRouter) -> None:
926926
client = client.with_options(max_retries=4)
@@ -943,7 +943,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
943943
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
944944

945945
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
946-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
946+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
947947
@pytest.mark.respx(base_url=base_url)
948948
def test_overwrite_retry_count_header(
949949
self, client: Orb, failures_before_success: int, respx_mock: MockRouter
@@ -968,7 +968,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
968968
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
969969

970970
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
971-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
971+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
972972
@pytest.mark.respx(base_url=base_url)
973973
def test_retries_taken_new_response_class(
974974
self, client: Orb, failures_before_success: int, respx_mock: MockRouter
@@ -1813,7 +1813,7 @@ async def test_parse_retry_after_header(
18131813
calculated = async_client._calculate_retry_timeout(remaining_retries, options, headers)
18141814
assert calculated == pytest.approx(timeout, 0.5 * 0.875) # pyright: ignore[reportUnknownMemberType]
18151815

1816-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
1816+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
18171817
@pytest.mark.respx(base_url=base_url)
18181818
async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncOrb) -> None:
18191819
respx_mock.post("/customers").mock(side_effect=httpx.TimeoutException("Test timeout error"))
@@ -1825,7 +1825,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter,
18251825

18261826
assert _get_open_connections(async_client) == 0
18271827

1828-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
1828+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
18291829
@pytest.mark.respx(base_url=base_url)
18301830
async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncOrb) -> None:
18311831
respx_mock.post("/customers").mock(return_value=httpx.Response(500))
@@ -1837,7 +1837,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter,
18371837
assert _get_open_connections(async_client) == 0
18381838

18391839
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
1840-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
1840+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
18411841
@pytest.mark.respx(base_url=base_url)
18421842
@pytest.mark.parametrize("failure_mode", ["status", "exception"])
18431843
async def test_retries_taken(
@@ -1868,7 +1868,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
18681868
assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success
18691869

18701870
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
1871-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
1871+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
18721872
@pytest.mark.respx(base_url=base_url)
18731873
async def test_omit_retry_count_header(
18741874
self, async_client: AsyncOrb, failures_before_success: int, respx_mock: MockRouter
@@ -1893,7 +1893,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
18931893
assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0
18941894

18951895
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
1896-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
1896+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
18971897
@pytest.mark.respx(base_url=base_url)
18981898
async def test_overwrite_retry_count_header(
18991899
self, async_client: AsyncOrb, failures_before_success: int, respx_mock: MockRouter
@@ -1918,7 +1918,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
19181918
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
19191919

19201920
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
1921-
@mock.patch("orb._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
1921+
@mock.patch("orb_sdk._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
19221922
@pytest.mark.respx(base_url=base_url)
19231923
async def test_retries_taken_new_response_class(
19241924
self, async_client: AsyncOrb, failures_before_success: int, respx_mock: MockRouter

tests/test_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_extract_response_type_direct_classes() -> None:
3737
def test_extract_response_type_direct_class_missing_type_arg() -> None:
3838
with pytest.raises(
3939
RuntimeError,
40-
match="Expected type <class 'orb._response.AsyncAPIResponse'> to have a type argument at index 0 but it did not",
40+
match="Expected type <class 'orb_sdk._response.AsyncAPIResponse'> to have a type argument at index 0 but it did not",
4141
):
4242
extract_response_type(AsyncAPIResponse)
4343

0 commit comments

Comments
 (0)