Skip to content

Use uv to manage python deps #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build-stm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion Tools/elf2hex.py
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down
8 changes: 7 additions & 1 deletion Tools/macho2bin.py
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down
8 changes: 7 additions & 1 deletion Tools/macho2uf2.py
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down
2 changes: 0 additions & 2 deletions Tools/requirements.txt

This file was deleted.

Loading