From 0e9152e2acc1dc9a3fab57c702ce5c8b5413cc4d Mon Sep 17 00:00:00 2001 From: Martin Kersner Date: Tue, 30 Jun 2026 14:08:31 +0900 Subject: [PATCH 1/2] ci: install deps via uv (setup-uv + uv pip --system) --- .github/workflows/python-package.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4ba13d3..e7ed5b3 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,14 +16,12 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - uses: actions/cache@v4 + - name: Set up uv + uses: astral-sh/setup-uv@v6 with: - path: ~/.cache/pip - key: ${{ hashFiles('requirements/requirements-test.txt') }} + enable-cache: true - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements/requirements-test.txt + run: uv pip install --system -r requirements/requirements-test.txt - name: Run black to review standard code format run: | # Checks if need to reformat files From 722b50d9e6ecffb5b8a99cc92082dec4d7585be8 Mon Sep 17 00:00:00 2001 From: Martin Kersner Date: Tue, 30 Jun 2026 14:08:31 +0900 Subject: [PATCH 2/2] docs: switch dev/test setup to uv flow --- README.md | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index c5d5071..beac37c 100644 --- a/README.md +++ b/README.md @@ -410,35 +410,45 @@ data3, next_request3 = next_request2() ## Local Development +This project uses [uv](https://docs.astral.sh/uv/) for fast dev setup. Install +uv first (see the [uv docs](https://docs.astral.sh/uv/getting-started/installation/)). + ```shell git clone https://github.com/bisonai/datamaxi-python.git cd datamaxi-python -pip install -r requirements/common.txt + +# Create a virtual environment and install dev dependencies +# (requirements-dev.txt pulls in the test and docs stacks). +uv venv +uv pip install -r requirements/requirements-dev.txt + +# For runtime dependencies only: +# uv pip install -r requirements/common.txt ``` ## Tests ```shell -# Install test dependencies -pip install -r requirements/requirements-test.txt +# Install test dependencies (skip if you already ran the dev install above) +uv pip install -r requirements/requirements-test.txt # Run unit tests (no API key required) -python -m pytest tests/test_api.py -v +uv run pytest tests/test_api.py -v # Run integration tests (requires API key) export DATAMAXI_API_KEY="your_api_key" -python -m pytest tests/test_integration.py -v +uv run pytest tests/test_integration.py -v # Test specific endpoint groups using markers -python -m pytest tests/test_integration.py -m "cex" -v -python -m pytest tests/test_integration.py -m "funding" -v -python -m pytest tests/test_integration.py -m "premium" -v -python -m pytest tests/test_integration.py -m "forex" -v -python -m pytest tests/test_integration.py -m "telegram" -v -python -m pytest tests/test_integration.py -m "naver" -v +uv run pytest tests/test_integration.py -m "cex" -v +uv run pytest tests/test_integration.py -m "funding" -v +uv run pytest tests/test_integration.py -m "premium" -v +uv run pytest tests/test_integration.py -m "forex" -v +uv run pytest tests/test_integration.py -m "telegram" -v +uv run pytest tests/test_integration.py -m "naver" -v # Run all tests -python -m pytest tests/ -v +uv run pytest tests/ -v ``` ## Links