Skip to content

Commit b1af956

Browse files
committed
feat: bump, update to uv
1 parent 10d5910 commit b1af956

File tree

17 files changed

+1765
-2325
lines changed

17 files changed

+1765
-2325
lines changed

.github/workflows/publish.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,37 @@
1-
name: publish
1+
name: Release Distributables
2+
23
on:
3-
push:
4-
tags:
5-
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching *, i.e. 1.0, 20.15.10
4+
release:
5+
types:
6+
- published
67

78
jobs:
8-
publish:
9-
strategy:
10-
fail-fast: false
11-
matrix:
12-
python-version: [3.11]
13-
os: [ubuntu-latest]
14-
runs-on: ${{ matrix.os }}
9+
build-n-upload:
10+
runs-on: ubuntu-latest
1511
steps:
16-
- uses: actions/checkout@v3
17-
- name: Install poetry
18-
run: pipx install poetry
19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v3
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Python 3.11
15+
uses: actions/setup-python@v4
2116
with:
22-
python-version: ${{ matrix.python-version }}
17+
python-version: "3.11"
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v3
21+
with:
22+
enable-cache: true
23+
2324
- name: Install dependencies
24-
run: |
25-
poetry install
26-
- name: Lint with flake8
27-
run: |
28-
poetry run flake8 src --ignore E501
25+
run: uv sync --dev
26+
27+
- name: Lint with ruff
28+
run: uv run ruff check src
29+
2930
- name: Run unit tests
30-
run: |
31-
poetry run pytest --doctest-modules --ignore=examples --cov=deltadefi --cov-config=.coveragerc --cov-report=xml
32-
- name: poetry-check
33-
run: |
34-
poetry check
35-
- name: poetry-publish
36-
run: |
37-
poetry publish --build --username __token__ --password ${{ secrets.PYPI_TOKEN }}
31+
run: uv run pytest --cov=deltadefi --cov-report=xml
32+
33+
- name: Build distributables
34+
run: uv build
35+
36+
- name: Build and publish to PyPI
37+
run: uv publish --username __token__ --password ${{ secrets.PYPI_TOKEN }}

.gitignore

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,62 @@
1-
venv/
1+
# Virtual environment
2+
.venv/
3+
4+
# Python
25
__pycache__/
36
*.pyc
47
*.pyo
5-
.env
8+
*.pyd
9+
.Python
10+
build/
11+
develop-eggs/
12+
dist/
13+
downloads/
14+
eggs/
15+
.eggs/
16+
lib/
17+
lib64/
18+
parts/
19+
sdist/
20+
var/
21+
wheels/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
26+
# Testing
27+
.pytest_cache/
28+
.coverage
29+
htmlcov/
30+
.tox/
31+
.nox/
32+
cov_html/
33+
34+
# Type checking
35+
.mypy_cache/
36+
.dmypy.json
37+
dmypy.json
38+
39+
# Linting
40+
.ruff_cache/
41+
42+
# Environment variables
43+
.env
44+
.env.local
45+
.env.development.local
46+
.env.test.local
47+
.env.production.local
48+
49+
# Documentation
50+
docs/build/
51+
docs/_build/
52+
53+
# IDEs
54+
.vscode/
55+
.idea/
56+
*.swp
57+
*.swo
58+
*~
59+
60+
# OS
61+
.DS_Store
62+
Thumbs.db

Makefile

Lines changed: 84 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,85 @@
11

2-
cov: ## check code coverage
3-
poetry run pytest -n 4 --cov deltadefi
4-
5-
cov-html: cov ## check code coverage and generate an html report
6-
poetry run coverage html -d cov_html
7-
$(BROWSER) cov_html/index.html
8-
9-
test: ## runs tests
10-
poetry run dotenv run -- pytest -vv
11-
12-
clean-test: ## remove test and coverage artifacts
13-
rm -f .coverage
14-
rm -fr cov_html/
15-
rm -fr .pytest_cache
16-
17-
docs: ## build the documentation
18-
poetry export --dev --without-hashes > docs/requirements.txt
19-
rm -r -f docs/build
20-
poetry run sphinx-build docs/source docs/build/html
21-
$(BROWSER) docs/build/html/index.html
22-
23-
format: ## runs code style and formatter
24-
poetry run isort .
25-
poetry run black .
26-
27-
deps:
28-
poetry lock
29-
poetry install
2+
# Makefile for deltadefi-python-sdk (uv-managed Python project)
3+
# Usage examples:
4+
# make install # create venv and install project + dev deps
5+
# make test # run pytest
6+
# make fmt lint # format + lint with Ruff
7+
# make build # build the package
8+
# make help # list targets
9+
10+
SHELL := /bin/bash
11+
.DEFAULT_GOAL := help
12+
13+
UV := uv
14+
PY := python
15+
16+
.PHONY: help venv install fmt lint type test cov build clean docs deps
17+
18+
help: ## Show this help with grouped commands
19+
@echo "Available commands:"
20+
@echo ""
21+
@echo "📦 Installation & Setup:"
22+
@grep -E '^[a-zA-Z_\-]+:.*##.*install' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
23+
@echo ""
24+
@echo "🔧 Testing & Quality:"
25+
@grep -E '^[a-zA-Z_\-]+:.*##.*\[(test|lint|format|type|quality|check)\]' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
26+
@echo ""
27+
@echo "🏗️ Building & Distribution:"
28+
@grep -E '^[a-zA-Z_\-]+:.*##.*\[(build|dist)\]' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
29+
@echo ""
30+
@echo "📚 Other Utilities:"
31+
@grep -E '^[a-zA-Z_\-]+:.*##[^[]*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
32+
33+
# 📦 Installation & Setup
34+
venv: ## Create virtual environment [install]
35+
@$(UV) venv
36+
37+
install: ## Install project in editable mode with dependencies [install]
38+
@$(UV) pip install -e . --group dev --group docs
39+
40+
deps: install ## Install dependencies (alias for install) [install]
41+
42+
# 🔧 Testing & Quality
43+
fmt: ## Format code with Ruff formatter [format]
44+
@$(UV) run ruff format .
45+
46+
lint: ## Lint with Ruff (auto-fix + fail on remaining issues) [lint]
47+
@$(UV) run ruff check --fix --exit-non-zero-on-fix .
48+
49+
type: ## Static type-check with mypy [type]
50+
@$(UV) run mypy --config-file=pyproject.toml src/ || true
51+
52+
test: install ## Run tests with pytest [test]
53+
@$(UV) run pytest -vv
54+
55+
cov: install ## Check code coverage [test]
56+
@$(UV) run pytest -n 4 --cov deltadefi
57+
58+
cov-html: cov ## Check code coverage and generate HTML report [test]
59+
@$(UV) run coverage html -d cov_html
60+
@echo "Coverage report generated in cov_html/"
61+
62+
# 🏗️ Building & Distribution
63+
build: install ## Build the package [build]
64+
@$(UV) build
65+
66+
# 📚 Other Utilities
67+
docs: install ## Build the documentation
68+
@mkdir -p docs/requirements
69+
@$(UV) export --group docs > docs/requirements.txt
70+
@rm -r -f docs/build
71+
@$(UV) run sphinx-build docs/source docs/build/html
72+
@echo "Documentation built in docs/build/html/"
73+
74+
clean-test: ## Remove test and coverage artifacts
75+
@rm -f .coverage
76+
@rm -fr cov_html/
77+
@rm -fr .pytest_cache
78+
79+
clean: clean-test ## Remove caches, build artifacts, and temp files
80+
@rm -rf .mypy_cache .ruff_cache dist build
81+
@find . -type d -name __pycache__ -prune -exec rm -rf {} +
82+
83+
version: ## Show uv and Python versions
84+
@$(UV) --version
85+
@$(UV) run $(PY) -c "import platform; print('Python', platform.python_version())"

0 commit comments

Comments
 (0)