diff --git a/.github/workflows/build-stm.yml b/.github/workflows/build-stm.yml index fdb46f06..d26823bf 100644 --- a/.github/workflows/build-stm.yml +++ b/.github/workflows/build-stm.yml @@ -28,6 +28,9 @@ jobs: with: python-version: 3.11 + - name: Install uv + uses: astral-sh/setup-uv@v5 + - name: Install ${{ matrix.swift }} run: | wget -q https://download.swift.org/development/ubuntu2404/${{ matrix.swift }}/${{ matrix.swift }}-ubuntu24.04.tar.gz @@ -39,6 +42,5 @@ jobs: - name: Build ${{ matrix.example }} working-directory: ${{ matrix.example }} run: | - pip3 install -r ../Tools/requirements.txt export STM_BOARD=STM32F746G_DISCOVERY ./build-elf.sh diff --git a/README.md b/README.md index 63f325dd..c925ae52 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,9 @@ Each example in this repository contains build and deployment instructions, howe You can follow the [tutorial here](https://apple.github.io/swift-matter-examples/tutorials/swiftmatterexamples/setup-macos/) for instructions on installing and using nighly Swift toolchains. -2. Install the Python3 dependencies listed in `requirements.txt`. - - ```console - $ cd swift-embedded-examples - $ python3 -m venv .venv - $ source .venv/bin/activate - $ python3 -m pip install -r Tools/requirements.txt - ``` +2. Install [`uv`](https://github.com/astral-sh/uv) "an extremely fast Python package and project manager". + + You can follow the [instructions here](https://docs.astral.sh/uv/getting-started/installation/) to install `uv`. ## Catalog of Examples diff --git a/Tools/elf2hex.py b/Tools/elf2hex.py index db0449fa..37d360e4 100755 --- a/Tools/elf2hex.py +++ b/Tools/elf2hex.py @@ -1,4 +1,10 @@ -#!/usr/bin/env -S python3 -u -tt +#! /usr/bin/env -S uv run --script + +# /// script +# dependencies = [ +# "pyelftools==0.31", +# ] +# /// # This source file is part of the Swift open source project # diff --git a/Tools/macho2bin.py b/Tools/macho2bin.py index 6ba74b3c..842b4b2f 100755 --- a/Tools/macho2bin.py +++ b/Tools/macho2bin.py @@ -1,4 +1,10 @@ -#!/usr/bin/env python3 -u -tt +#! /usr/bin/env -S uv run --script + +# /// script +# dependencies = [ +# "macholib==1.16.3", +# ] +# /// # This source file is part of the Swift open source project # diff --git a/Tools/macho2uf2.py b/Tools/macho2uf2.py index 5043b4a8..39acd6c3 100755 --- a/Tools/macho2uf2.py +++ b/Tools/macho2uf2.py @@ -1,4 +1,10 @@ -#!/usr/bin/env python3 -u -tt +#! /usr/bin/env -S uv run --script + +# /// script +# dependencies = [ +# "macholib==1.16.3", +# ] +# /// # This source file is part of the Swift open source project # diff --git a/Tools/requirements.txt b/Tools/requirements.txt deleted file mode 100644 index c07854d6..00000000 --- a/Tools/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -macholib==1.16.3 -pyelftools==0.31