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

[Refactor]: Unary client #16

Merged
merged 3 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
68 changes: 23 additions & 45 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ readme = "README.md"
requires-python = ">=3.7"
license = "Apache-2.0"
keywords = []
authors = [
{ name = "LingKa", email = "[email protected]" },
]
authors = [{ name = "LingKa", email = "[email protected]" }]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
Expand All @@ -27,6 +25,7 @@ classifiers = [
dependencies = [
"grpcio==1.58.0",
"grpcio-tools==1.58.0",
"grpcio-status==1.58.0",
"pytest-asyncio",
"passlib",
]
Expand All @@ -40,47 +39,24 @@ Source = "https://github.com/xline-kv/py-xline"
path = "client/__about__.py"

[tool.hatch.envs.default]
dependencies = [
"coverage[toml]>=6.5",
"pytest",
]
dependencies = ["coverage[toml]>=6.5", "pytest"]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-report = [
"- coverage combine",
"coverage report",
"coverage xml",
]
cov = [
"test-cov",
"cov-report",
]
cov-report = ["- coverage combine", "coverage report", "coverage xml"]
cov = ["test-cov", "cov-report"]

[[tool.hatch.envs.all.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11"]

[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=23.1.0",
"mypy>=1.0.0",
"ruff>=0.0.243",
]
dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:client tests}"
style = [
"ruff {args:.}",
"black --check --diff {args:.}",
]
fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"style",
]
all = [
"style",
]
style = ["ruff {args:.}", "black --check --diff {args:.}"]
fmt = ["black {args:.}", "ruff --fix {args:.}", "style"]
all = ["style"]

[tool.black]
target-version = ["py37"]
Expand Down Expand Up @@ -121,13 +97,21 @@ ignore = [
# Allow non-abstract empty methods in abstract base classes
"B027",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT001", "FBT002", "FBT003",
"FBT001",
"FBT002",
"FBT003",
# Ignore checks for possible passwords
"S105", "S106", "S107",
"S105",
"S106",
"S107",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
"C901",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
# Ignore import sort
"I001",
"I001",
# Allow verable shadow
"A003",
# Allow const use upercase
Expand All @@ -154,20 +138,14 @@ ban-relative-imports = "all"
source_pkgs = ["client", "tests"]
branch = true
parallel = true
omit = [
"client/__about__.py",
]
omit = ["client/__about__.py"]

[tool.coverage.paths]
py_xline = ["client"]
tests = ["tests"]

[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]

[tool.hatch.build.targets.wheel]
packages = ["client"]
Empty file added src/__init__.py
Empty file.
5 changes: 5 additions & 0 deletions src/curp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import sys

sys.path.append("./api/curp")

sys.path.append("./api/xline")
Loading