Skip to content

Commit

Permalink
Merge branch 'feat/uv' into aux/8.2.0rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout committed Jan 14, 2025
2 parents cb4886a + e3b84cc commit 27d99c5
Show file tree
Hide file tree
Showing 138 changed files with 3,173 additions and 2,738 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Add metadata and build files
!pyproject.toml
!pdm.lock
!*.lock
!README.md
!requirements**

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- 'src/**'
- 'Dockerfile'
- 'pyproject.toml'
# NOTE: Dumped with `pdm run update`
# NOTE: Dumped with `make update`
- 'requirements.txt'
- '.github/workflows/build.yml'

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ jobs:
python-version: '3.12'
cache: 'pip'

- name: Install PDM
run: pip install pdm
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install markdownlint-cli
run: npm install -g markdownlint-cli

- name: Install project
run: pdm sync
run: make install

- name: Clone frontend
run: |
gh auth setup-git
gh repo clone dipdup-io/interface ../interface -- --single-branch --branch "$FRONTEND_BRANCH"
- name: Build docs
run: pdm run make docs
run: uv run make docs

# NOTE: Installer is tested in `installer` workflow
- name: Commit and push frontend
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ jobs:
python-version: '3.12'
cache: 'pip'

- name: Install PDM
run: pipx install pdm
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Run install
run: pdm install
run: make install

- name: Run all checks
run: pdm run make all
run: uv run make all
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v4

- name: Install PDM
run: pipx install pdm
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -40,14 +40,14 @@ jobs:
cache: 'pip'

- name: Run install
run: pdm sync
run: make install

- name: Run lint
run: pdm run make lint
run: uv run make lint
if: contains(matrix.os, 'ubuntu') && contains(matrix.arch, 'amd64')

- name: Run tests
run: pdm run make test
run: uv run make test
env:
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
!**/Makefile
!**/pyproject.toml
!**/requirements*
!**/pdm.lock
!**/*.lock
!**/README.md
!**/.keep
!**/py.typed
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ RUN apt update && \
touch /opt/dipdup/src/dipdup/__init__.py && \
rm -r /var/log/* /var/lib/apt/lists/* /var/cache/* /var/lib/dpkg/status*
WORKDIR /opt/dipdup
ENV PATH="/opt/dipdup/.venv/bin:$PATH"
ENV PATH="/root/.cargo/bin:$PATH"
ENV PATH="/root/.cargo/bin:/opt/dipdup/.venv/bin:$PATH"

COPY pyproject.toml requirements.txt README.md /opt/dipdup/
RUN /usr/local/bin/pip install --prefix /opt/dipdup --no-cache-dir --disable-pip-version-check --no-deps \
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
RUN uv pip install --prefix /opt/dipdup --compile-bytecode --no-cache --no-deps \
-r /opt/dipdup/requirements.txt -e .

FROM python:3.12-slim-bookworm AS build-image
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ help: ## Show this help (default)
##

install: ## Install dependencies
pdm sync --clean
uv sync --all-extras --all-groups --locked

update: ## Update dependencies and dump requirements.txt
pdm update
pdm export --without-hashes -f requirements --prod -o requirements.txt
uv sync --all-extras --all-groups
uv export --all-extras --locked --no-group lint --no-group test --no-group docs --no-group perf > requirements.txt


##
##-- CI
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,4 @@

from dipdup.config import DipDupConfig
from pydantic.dataclasses import rebuild_dataclass
rebuild_dataclass(DipDupConfig)
rebuild_dataclass(DipDupConfig) # type: ignore[arg-type]
Loading

0 comments on commit 27d99c5

Please sign in to comment.