Skip to content

Commit a7e78f7

Browse files
committed
fix: lib exporting issue
1 parent 49d17b0 commit a7e78f7

File tree

15 files changed

+251
-18
lines changed

15 files changed

+251
-18
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
TRADING_PASSWORD="xxxxxxxx"
22
DELTADEFI_API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
3-
BASE_URL="http://localhost:8080"
3+
BASE_URL="http://localhost:8080"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ docs/_build/
5959

6060
# OS
6161
.DS_Store
62-
Thumbs.db
62+
Thumbs.db

.pre-commit-config.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
repos:
2+
# Standard pre-commit hooks
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v5.0.0
5+
hooks:
6+
- id: trailing-whitespace
7+
- id: end-of-file-fixer
8+
- id: check-yaml
9+
- id: check-added-large-files
10+
- id: check-json
11+
- id: check-toml
12+
- id: check-merge-conflict
13+
- id: debug-statements
14+
15+
# Ruff for linting and formatting
16+
- repo: https://github.com/astral-sh/ruff-pre-commit
17+
rev: v0.12.10
18+
hooks:
19+
- id: ruff
20+
args: [--fix]
21+
- id: ruff-format
22+
23+
# MyPy for type checking (lenient for now)
24+
- repo: https://github.com/pre-commit/mirrors-mypy
25+
rev: v1.17.1
26+
hooks:
27+
- id: mypy
28+
additional_dependencies: [types-requests]
29+
args: [--ignore-missing-imports, --disable-error-code=no-any-return, --disable-error-code=call-arg]
30+
31+
# Custom hooks for project-specific checks
32+
- repo: local
33+
hooks:
34+
# Install dependencies
35+
- id: uv-sync
36+
name: Install dependencies
37+
entry: uv sync --dev
38+
language: system
39+
pass_filenames: false
40+
stages: [pre-commit]
41+
42+
# Run tests
43+
- id: pytest
44+
name: Run tests
45+
entry: uv run pytest
46+
language: system
47+
pass_filenames: false
48+
stages: [pre-commit]
49+
50+
# Build package
51+
- id: uv-build
52+
name: Build package
53+
entry: uv build --out-dir .pre-commit-build
54+
language: system
55+
pass_filenames: false
56+
stages: [pre-commit]
57+
58+
# Clean up build artifacts
59+
- id: cleanup-build
60+
name: Clean build artifacts
61+
entry: rm -rf .pre-commit-build
62+
language: system
63+
pass_filenames: false
64+
stages: [pre-commit]
65+
66+
# Configure which hooks run at different stages
67+
default_stages: [pre-commit]

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ cov-html: cov ## Check code coverage and generate HTML report [test]
5959
@$(UV) run coverage html -d cov_html
6060
@echo "Coverage report generated in cov_html/"
6161

62-
# 🏗️ Building & Distribution
62+
# 🏗️ Building & Distribution
6363
build: install ## Build the package [build]
6464
@$(UV) build
6565

@@ -83,3 +83,12 @@ clean: clean-test ## Remove caches, build artifacts, and temp files
8383
version: ## Show uv and Python versions
8484
@$(UV) --version
8585
@$(UV) run $(PY) -c "import platform; print('Python', platform.python_version())"
86+
87+
precommit-install: ## Install pre-commit hooks
88+
@$(UV) run pre-commit install
89+
90+
precommit: ## Run pre-commit hooks on all files
91+
@$(UV) run pre-commit run --all-files
92+
93+
precommit-update: ## Update pre-commit hooks
94+
@$(UV) run pre-commit autoupdate

pyproject.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "deltadefi"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = "Python SDK for DeltaDeFi protocol."
55
readme = "README.md"
66
requires-python = ">3.11,<4.0.0"
@@ -26,7 +26,7 @@ dependencies = [
2626
"sidan-gin>=0.1.6",
2727
"requests>=2.25.0",
2828
"certifi>=2024.8.30",
29-
"charset-normalizer>=3.4.0",
29+
"charset-normalizer>=3.4.0",
3030
"idna>=3.10",
3131
"urllib3>=2.2.3",
3232
"pycardano>=0.12.3",
@@ -42,6 +42,8 @@ dev = [
4242
"ruff>=0.12.10",
4343
"mypy>=1.17.1",
4444
"twine>=5.0.0",
45+
"build>=1.3.0",
46+
"pre-commit>=4.3.0",
4547
]
4648

4749
docs = [
@@ -54,6 +56,7 @@ docs = [
5456
requires = ["hatchling"]
5557
build-backend = "hatchling.build"
5658

59+
5760
[tool.ruff]
5861
line-length = 88
5962
target-version = "py311"
@@ -63,7 +66,7 @@ exclude = [
6366
".venv",
6467
"__pycache__",
6568
"build",
66-
"dist",
69+
"dist",
6770
".pytest_cache",
6871
".mypy_cache",
6972
".ruff_cache",

src/deltadefi/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import requests
44

55
from deltadefi.error import ClientError, ServerError
6-
from deltadefi.lib.utils import clean_none_value, encoded_string
6+
from deltadefi.utils import clean_none_value, encoded_string
77

88

99
class API:

src/deltadefi/clients/accounts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from sidan_gin import Asset, UTxO
44

55
from deltadefi.api import API
6-
from deltadefi.lib.utils import check_required_parameter, check_required_parameters
76
from deltadefi.models.models import OrderStatusType
87
from deltadefi.responses import (
98
BuildDepositTransactionResponse,
@@ -22,6 +21,7 @@
2221
GetOrderRecordsResponse,
2322
SubmitTransferalTransactionResponse,
2423
)
24+
from deltadefi.utils import check_required_parameter, check_required_parameters
2525

2626

2727
class Accounts(API):

src/deltadefi/clients/markets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from typing import Literal
22

33
from deltadefi.api import API
4-
from deltadefi.lib.utils import check_required_parameter, check_required_parameters
54
from deltadefi.responses import GetAggregatedPriceResponse, GetMarketPriceResponse
5+
from deltadefi.utils import check_required_parameter, check_required_parameters
66

77

88
class Market(API):

src/deltadefi/clients/orders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from deltadefi.api import API
2-
from deltadefi.lib.utils import check_required_parameter, check_required_parameters
32
from deltadefi.models.models import OrderSide, OrderType
43
from deltadefi.responses import (
54
BuildCancelOrderTransactionResponse,
65
BuildPlaceOrderTransactionResponse,
76
SubmitPlaceOrderTransactionResponse,
87
)
8+
from deltadefi.utils import check_required_parameter, check_required_parameters
99

1010

1111
class Order(API):

src/deltadefi/lib/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)