Skip to content

Commit

Permalink
deps(client): client/sdk supports python3.11 (#1584)
Browse files Browse the repository at this point in the history
* client/sdk supports python3.11

* remove deprecated setDaemon and isDaemon methods

* upgrade boto3 to resolve the deprecated cgi dependency in the utils.py

* skip ut for macos && python3.11
  • Loading branch information
tianweidut authored Dec 12, 2022
1 parent 32adf21 commit cf24c63
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"

- "3.11"
needs:
- filter
if: ${{ (github.event_name == 'pull_request' && needs.filter.outputs.client == 'true') || github.event_name == 'push' }}
Expand Down Expand Up @@ -89,17 +89,23 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
os:
- macos-latest
- ubuntu-latest
exclude:
# https://github.com/pytorch/pytorch/issues/86566
# pytorch does not release python 3.11 wheel package for macosx os yet.
- os: macos-latest
python-version: "3.11"
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash

needs:
- filter
if: ${{ (github.event_name == 'pull_request' && needs.filter.outputs.client == 'true') || github.event_name == 'push' }}
if: ${{(github.event_name == 'pull_request' && needs.filter.outputs.client == 'true') || github.event_name == 'push'}}

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -149,6 +155,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
defaults:
run:
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
- "3.8"
- "3.9"
- "3.10"
- "3.11"

steps:
- uses: actions/checkout@v3
Expand Down
9 changes: 6 additions & 3 deletions client/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
"commonmark>=0.9.1",
"textual==0.1.18",
"jsonlines==3.0.0",
"boto3==1.21.0",
# botocore(>=1.29.14) fixed the cgi deprecation warning which has been updated in the boto3 1.26.14 version
"boto3>=1.26.14",
"scikit-learn>=0.20.0",
"dill==0.3.5.1",
# Python 3.11 needs dill >= 0.3.6
"dill>=0.3.6",
"packaging>=21.3",
"pyarrow>=8.0.0",
"Jinja2>=3.1.2",
Expand Down Expand Up @@ -76,7 +78,7 @@ def _format_version() -> str:
sw = starwhale.cli:cli
starwhale = starwhale.cli:cli
""",
python_requires=">=3.7, <3.11",
python_requires=">=3.7, <=3.11",
scripts=[
"scripts/sw-docker-entrypoint",
],
Expand All @@ -91,6 +93,7 @@ def _format_version() -> str:
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down
2 changes: 1 addition & 1 deletion client/starwhale/api/_impl/data_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ def __init__(
self._queue_run_exceptions: List[Exception] = []
self._run_exceptions_limits = max(run_exceptions_limits, 0)

self.setDaemon(True)
self.daemon = True
atexit.register(self.close)
self.start()

Expand Down
2 changes: 1 addition & 1 deletion client/starwhale/api/_impl/dataset/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ def __init__(

self._run_exception: t.Optional[Exception] = None

self.setDaemon(True)
self.daemon = True
self._builder: t.Optional[BaseBuildExecutor] = None
if append and append_from_version:
_cls = create_generic_cls_by_mode(append_with_swds_bin, self.__iter__)
Expand Down
2 changes: 1 addition & 1 deletion client/starwhale/core/runtime/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@

_SUPPORT_CUDA = ["11.3", "11.4", "11.5", "11.6", "11.7"]
_SUPPORT_CUDNN = {"8": {"support_cuda_versions": ["11.3", "11.4", "11.5", "11.6"]}}
_SUPPORT_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
_SUPPORT_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]


class DockerEnv(ASDictMixin):
Expand Down
2 changes: 1 addition & 1 deletion client/tests/sdk/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ def test_update(self, m_make_swds: MagicMock) -> None:
rw._builder = None
rw.update(DataRow(index=3, data=Binary(b"test"), annotations={"label": 3}))
assert rw._builder is not None
assert rw.isDaemon()
assert rw.daemon
assert isinstance(rw._builder, SWDSBinBuildExecutor)
assert m_make_swds.call_count == 1

Expand Down

0 comments on commit cf24c63

Please sign in to comment.