Skip to content

Commit

Permalink
switch to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
phcreery committed Feb 12, 2025
1 parent d81c601 commit 6177a6a
Show file tree
Hide file tree
Showing 12 changed files with 2,831 additions and 3,281 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ jobs:
fetch-depth: 0
submodules: recursive

- name: Install poetry
run: pipx install poetry
- name: Install uv
run: pipx install uv

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'poetry'
cache: "uv"

- name: Install dependencies
run: |
poetry env use "3.10"
poetry install
uv venv --python 3.10
uv sync
- name: Build and deploy
run: |
poetry run mkdocs gh-deploy --force
uv run mkdocs gh-deploy --force
30 changes: 15 additions & 15 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ jobs:
fetch-depth: 0
submodules: recursive

- name: Install poetry
run: pipx install poetry
- name: Install uv
run: pipx install uv

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'poetry'
cache: "uv"

- name: Install dependencies
run: |
poetry env use "3.10"
poetry install
uv venv --python 3.10
uv sync
- name: Install twine
run: pip install twine

- name: Build
run: |
poetry build
uv build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand All @@ -53,22 +53,22 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry
- name: Install uv
run: pipx install uv

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'poetry'
cache: "uv"

- name: Install dependencies
run: |
poetry env use "3.10"
poetry install
uv venv --python 3.10
uv sync
- name: Build executable
run: poetry run python ./scripts/build.py
run: uv run python ./scripts/build.py

- name: Build cross-platform binary
run: |
Expand Down Expand Up @@ -106,11 +106,11 @@ jobs:
apt update
apt install python3-full python3-pip pipx -y
pipx ensurepath
pipx install poetry
poetry install
pipx install uv
uv sync
rm -rf dist/
mkdir dist/
poetry run python ./scripts/build.py
uv run python ./scripts/build.py
for file in dist/spotdl*; do cp "$file" "${file}-aarch64"; done
- name: Release
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/standard-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry
- name: Install uv
run: pipx install uv

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'poetry'
cache: "uv"

- name: Install dependencies
run: |
poetry env use "3.11"
poetry install
uv venv --python 3.11
uv sync
- name: Run Pylint check
run: |
poetry run pylint --fail-under 10 --limit-inference-results 0 --disable=R0917 ./spotdl
uv run pylint --fail-under 10 --limit-inference-results 0 --disable=R0917 ./spotdl
- name: Run MyPy check
run: |
poetry run mypy --ignore-missing-imports --follow-imports silent --install-types --non-interactive ./spotdl
uv run mypy --ignore-missing-imports --follow-imports silent --install-types --non-interactive ./spotdl
- name: Run Black check
run: |
poetry run black --check ./spotdl
uv run black --check ./spotdl
- name: Run isort check
run: |
poetry run isort --check --diff ./spotdl
uv run isort --check --diff ./spotdl
42 changes: 21 additions & 21 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ jobs:
strategy:
max-parallel: 1
matrix:
platform: [ ubuntu-latest, macos-13, windows-latest ]
platform: [ubuntu-latest, macos-13, windows-latest]

steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry
- name: Install uv
run: pipx install uv

- name: Set up Python "3.11"
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'poetry'
cache: "uv"

- name: Install dependencies
run: |
poetry env use "3.11"
poetry install
uv venv --python 3.11
uv sync
- uses: FedericoCarboni/setup-ffmpeg@v1
id: setup-ffmpeg
Expand All @@ -35,7 +35,7 @@ jobs:

- name: Run tests
run: |
poetry run pytest -vvv --record-mode=new_episodes --ignore tests/test_matching.py --ignore tests/utils/test_ffmpeg.py --ignore tests/utils/test_metadata.py --ignore tests/providers/lyrics/test_azlyrics.py --ignore tests/providers/lyrics/test_musixmatch.py --ignore tests/providers/audio/test_youtube.py --ignore tests/console/test_entry_point.py --ignore tests/test_init.py
uv run pytest -vvv --record-mode=new_episodes --ignore tests/test_matching.py --ignore tests/utils/test_ffmpeg.py --ignore tests/utils/test_metadata.py --ignore tests/providers/lyrics/test_azlyrics.py --ignore tests/providers/lyrics/test_musixmatch.py --ignore tests/providers/audio/test_youtube.py --ignore tests/console/test_entry_point.py --ignore tests/test_init.py
env:
PLATFORM: ${{ matrix.platform }}

Expand All @@ -45,26 +45,26 @@ jobs:
strategy:
max-parallel: 3
matrix:
platform: [ ubuntu-latest, macos-13, windows-latest ]
python-version: [ "3.9", "3.11" ]
platform: [ubuntu-latest, macos-13, windows-latest]
python-version: ["3.9", "3.11"]

steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry
- name: Install uv
run: pipx install uv

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
cache: "uv"

- name: Install dependencies
run: |
poetry env use ${{ matrix.python-version }}
uv venv --python ${{ matrix.python-version }}
pip install -U pip setuptools
poetry install
uv sync
- uses: FedericoCarboni/setup-ffmpeg@v2
id: setup-ffmpeg
Expand All @@ -73,7 +73,7 @@ jobs:

- name: Run tests
run: |
poetry run pytest -vvv --record-mode=none --disable-recording --ignore tests/providers/lyrics --ignore tests/utils/test_github.py --ignore tests/utils/test_ffmpeg.py --ignore tests/utils/test_metadata.py --ignore tests/test_matching.py --ignore tests/providers/audio/test_youtube.py --ignore tests/console/test_entry_point.py --ignore tests/test_init.py
uv run pytest -vvv --record-mode=none --disable-recording --ignore tests/providers/lyrics --ignore tests/utils/test_github.py --ignore tests/utils/test_ffmpeg.py --ignore tests/utils/test_metadata.py --ignore tests/test_matching.py --ignore tests/providers/audio/test_youtube.py --ignore tests/console/test_entry_point.py --ignore tests/test_init.py
env:
PLATFORM: ${{ matrix.platform }}

Expand All @@ -84,19 +84,19 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry
- name: Install uv
run: pipx install uv

- name: Set up Python "3.11"
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'poetry'
cache: "uv"

- name: Install dependencies
run: |
poetry env use "3.11"
poetry install
uv venv --python 3.11
uv sync
- uses: FedericoCarboni/setup-ffmpeg@v1
id: setup-ffmpeg
Expand All @@ -105,4 +105,4 @@ jobs:

- name: Run tests
run: |
poetry run pytest -vvv --record-mode=none --disable-recording tests/test_matching.py
uv run pytest -vvv --record-mode=none --disable-recording tests/test_matching.py
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ RUN apk add --no-cache \
libffi-dev \
zlib-dev

# Install poetry and update pip/wheel
RUN pip install --upgrade pip poetry wheel spotipy
# Install uv and update pip/wheel
RUN pip install --upgrade pip uv wheel spotipy

# Copy requirements files
COPY poetry.lock pyproject.toml /
COPY uv.lock pyproject.toml /

# Install spotdl requirements
RUN poetry install
RUN uv sync

# Add source code files to WORKDIR
ADD . .

# Install spotdl itself
RUN poetry install
RUN uv sync

# Create music directory
RUN mkdir /music
Expand All @@ -39,4 +39,4 @@ VOLUME /music
WORKDIR /music

# Entrypoint command
ENTRYPOINT ["poetry", "run", "spotdl"]
ENTRYPOINT ["uv", "run", "spotdl"]
Loading

0 comments on commit 6177a6a

Please sign in to comment.