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 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