Skip to content

Commit b78ab3c

Browse files
committed
Convert dependency management to uv
1 parent 97282c1 commit b78ab3c

15 files changed

Lines changed: 1914 additions & 43 deletions

.github/dependabot.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
version: 2
77
updates:
8-
- package-ecosystem: "pip" # See documentation for possible values
8+
- package-ecosystem: "uv" # See documentation for possible values
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "weekly"
12+
cooldown:
13+
default-days: 7

.github/workflows/mypy.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ jobs:
1212
- name: Setup Python
1313
uses: actions/setup-python@v6
1414
with:
15-
python-version: 3.9
16-
cache: 'pip'
15+
python-version: "3.10"
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v7
18+
with:
19+
enable-cache: true
1720
- name: Install Dependencies
1821
run: |
19-
pip install mypy
22+
uv sync --locked --group dev
2023
- name: mypy
2124
run: |
2225
make mypy

.github/workflows/ruff.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@ jobs:
1414
- name: Checkout
1515
uses: actions/checkout@v6
1616
- name: Setup Python
17-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v6
1818
with:
19-
python-version: 3.9
20-
cache: 'pip'
19+
python-version: "3.10"
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v7
22+
with:
23+
enable-cache: true
2124
- name: Install Dependencies
2225
run: |
23-
pip install ruff
26+
uv sync --locked --group dev
2427
- name: ruff
2528
run: |
2629
make ruff

.github/workflows/tests.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v6
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v7
21+
with:
22+
enable-cache: true
1923
- name: Set up Python ${{ matrix.python-version }}
2024
uses: actions/setup-python@v6
2125
with:
2226
python-version: ${{ matrix.python-version }}
2327
- name: Install Python dependencies
2428
run: |
25-
make install
26-
make test-requirements
29+
uv sync --locked --group dev --python ${{ matrix.python-version }}
2730
- name: Test with pytest
2831
run: |
2932
set -o pipefail

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ ipython_config.py
8686
# pyenv
8787
.python-version
8888

89+
# uv project Python version
90+
!.python-version
91+
8992
# pipenv
9093
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
9194
# However, in case of collaboration, if having platform-specific dependencies or dependencies
@@ -138,4 +141,4 @@ dmypy.json
138141
.idea
139142

140143
# Sublime Text project files
141-
*.sublime*
144+
*.sublime*

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

.readthedocs.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66
version: 2
77

88
build:
9-
os: "ubuntu-22.04"
9+
os: "ubuntu-24.04"
1010
tools:
1111
python: "3.11"
1212

1313
mkdocs:
1414
configuration: mkdocs.yml
1515

16-
# Optionally set the version of Python and requirements required to build your docs
1716
python:
18-
install:
19-
- requirements: docs/requirements.txt
17+
install:
18+
- method: uv
19+
command: sync
20+
groups:
21+
- docs

Dockerfile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ RUN git clone https://github.com/libimobiledevice/usbmuxd && cd usbmuxd \
104104

105105
# Create main image
106106
FROM ubuntu:24.04 AS main
107+
COPY --from=ghcr.io/astral-sh/uv:0.11.8 /uv /uvx /usr/local/bin/
107108

108109
LABEL org.opencontainers.image.url="https://mvt.re"
109110
LABEL org.opencontainers.image.documentation="https://docs.mvt.re"
@@ -133,12 +134,8 @@ COPY --from=build-usbmuxd /build /
133134

134135
# Install mvt using the locally checked out source
135136
COPY . mvt/
136-
RUN apt-get update \
137-
&& apt-get install -y git python3-pip \
138-
&& PIP_NO_CACHE_DIR=1 pip3 install --break-system-packages ./mvt \
139-
&& apt-get remove -y python3-pip git && apt-get autoremove -y \
140-
&& rm -rf /var/lib/apt/lists/* \
141-
&& rm -rf mvt
137+
RUN uv pip install --system --break-system-packages --no-cache ./mvt \
138+
&& rm -rf mvt
142139

143140
# Installing ABE
144141
ADD --checksum=sha256:a20e07f8b2ea47620aff0267f230c3f1f495f097081fd709eec51cf2a2e11632 \

Dockerfile.android

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Create main image
22
FROM python:3.10.14-alpine3.20 AS main
3+
COPY --from=ghcr.io/astral-sh/uv:0.11.8 /uv /uvx /usr/local/bin/
34

45
LABEL org.opencontainers.image.url="https://mvt.re"
56
LABEL org.opencontainers.image.documentation="https://docs.mvt.re"
@@ -20,7 +21,7 @@ RUN apk add --no-cache \
2021
# Install mvt
2122
COPY ./ mvt
2223
RUN apk add --no-cache --virtual .build-deps gcc musl-dev \
23-
&& PIP_NO_CACHE_DIR=1 pip3 install ./mvt \
24+
&& uv pip install --system --no-cache ./mvt \
2425
&& apk del .build-deps gcc musl-dev && rm -rf ./mvt
2526

2627
# Installing ABE

Dockerfile.ios

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ RUN git clone https://github.com/libimobiledevice/usbmuxd && cd usbmuxd \
105105
# Main image
106106
# ----------
107107
FROM python:3.10.14-alpine3.20 AS main
108+
COPY --from=ghcr.io/astral-sh/uv:0.11.8 /uv /uvx /usr/local/bin/
108109

109110
LABEL org.opencontainers.image.url="https://mvt.re"
110111
LABEL org.opencontainers.image.documentation="https://docs.mvt.re"
@@ -131,7 +132,7 @@ COPY --from=build-usbmuxd /build /
131132
# Install mvt using the locally checked out source
132133
COPY ./ mvt
133134
RUN apk add --no-cache --virtual .build-deps git gcc musl-dev \
134-
&& PIP_NO_CACHE_DIR=1 pip3 install ./mvt \
135+
&& uv pip install --system --no-cache ./mvt \
135136
&& apk del .build-deps git gcc musl-dev && rm -rf ./mvt
136137

137138
ENTRYPOINT [ "/usr/local/bin/mvt-ios" ]

0 commit comments

Comments
 (0)