Skip to content

Commit 4d6edd6

Browse files
committed
Fixed project structure and enabled unit tests on PR
1 parent ae06e33 commit 4d6edd6

25 files changed

Lines changed: 86 additions & 18 deletions

.github/workflows/run-tests.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,33 @@ name: Run tests
1616

1717
on:
1818
pull_request:
19-
# branches:
20-
# - main
19+
branches:
20+
- main
21+
push:
22+
branches:
23+
- main
2124

2225
jobs:
2326
build_and_test:
2427
runs-on: ubuntu-latest
2528

2629
steps:
2730
- name: Checkout repository
28-
uses: actions/checkout@v4
31+
uses: actions/checkout@v5
2932

3033
- name: Set up Python
3134
uses: actions/setup-python@v5
3235
with:
3336
python-version: '3.13'
3437

35-
- name: Install build dependencies
36-
run: |
37-
python -m pip install --upgrade uv
38+
- name: Install uv
39+
uses: astral-sh/setup-uv@v6
40+
41+
- name: Install dependencies
42+
run: uv sync --dev
3843

3944
- name: Build distribution packages
4045
run: uv build
4146

42-
# - name: Publish package to PyPI
43-
# uses: pypa/gh-action-pypi-publish@release/v1
44-
# with:
45-
# No need to specify username or password due to trusted publishing
46-
# repository_url: https://test.pypi.org/legacy/ # Uncomment to publish to TestPyPI
47+
- name: Run tests
48+
run: uv run pytest

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ description = "Oxia client for Python"
1919
authors = [
2020
{ name = "StreamNative"}
2121
]
22+
23+
requires-python = ">=3.13"
24+
2225
dependencies = [
2326
"betterproto2-compiler",
2427
"grpcio",
@@ -29,6 +32,10 @@ dependencies = [
2932
dev = [
3033
"grpcio-tools>=1.75.1",
3134
"pydoctor>=25.10.1",
35+
"pytest>=8.4.2",
3236
"testcontainers>=4.13.1",
3337
]
3438

39+
[build-system]
40+
requires = ["uv_build>=0.8.22,<0.9.0"]
41+
build-backend = "uv_build"
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
Oxia Python Client SDK
1717
"""
1818

19-
import oxia.ex as ex
2019
from oxia.client import (
2120
Client,
2221
)

oxia/client.py renamed to src/oxia/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def get(self, key: str,
177177
# // Returns ErrorKeyNotFound if the record does not exist
178178
if partition_key is None and \
179179
(comparison_type != oxia.defs.ComparisonType.EQUAL
180-
or use_index is not None):
180+
or use_index is not None):
181181

182182
results = []
183183
for shard, stub in self._service_discovery.get_all_shards():
File renamed without changes.
File renamed without changes.
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
import functools
15-
from opcode import cmp_op
16-
1714

1815
def _cmp(a: str, b: str) -> int:
1916
if a < b:

0 commit comments

Comments
 (0)