Skip to content
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
8 changes: 4 additions & 4 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: actions/checkout@v4
- name: Run the test suite
run: |
curl -ssL https://magic.modular.com | bash
source $HOME/.bash_profile
magic run bench
# magic run bench_server # Commented out until we get `wrk` installed
curl -fsSL https://pixi.sh/install.sh | sh
export PATH="$HOME/.pixi/bin:$PATH"
pixi run bench
# pixi run bench_server # Commented out until we get `wrk` installed
6 changes: 3 additions & 3 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
uses: actions/checkout@v4
- name: Run the package command
run: |
curl -ssL https://magic.modular.com | bash
source $HOME/.bash_profile
magic run mojo package lightbug_http -o lightbug_http.mojopkg
curl -fsSL https://pixi.sh/install.sh | sh
export PATH="$HOME/.pixi/bin:$PATH"
pixi run mojo package lightbug_http -o lightbug_http.mojopkg

- name: Upload package as artifact
uses: actions/upload-artifact@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}
CONDA_BLD_PATH: ${{ runner.workspace }}/.rattler
run: |
curl -ssL https://magic.modular.com | bash
source $HOME/.bash_profile
curl -fsSL https://pixi.sh/install.sh | sh
export PATH="$HOME/.pixi/bin:$PATH"

# Temporary method to fetch the rattler binary.
RATTLER_BINARY="rattler-build-aarch64-apple-darwin"
Expand All @@ -40,5 +40,5 @@ jobs:
chmod +x rattler-build

# Build and push
magic run build --target-platform=$TARGET_PLATFORM
magic run publish
pixi run build --target-platform=$TARGET_PLATFORM
pixi run publish
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
uses: actions/checkout@v4
- name: Run the test suite
run: |
curl -ssL https://magic.modular.com | bash
source $HOME/.bash_profile
magic run test
magic run integration_tests_py
magic run integration_tests_external
magic run integration_tests_udp
curl -fsSL https://pixi.sh/install.sh | sh
export PATH="$HOME/.pixi/bin:$PATH"
pixi run test
pixi run integration_tests_py
pixi run integration_tests_external
pixi run integration_tests_udp
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
hooks:
- id: mojo-format
name: mojo-format
entry: magic run mojo format -l 120
entry: pixi run mojo format -l 120
language: system
files: '\.(mojo|🔥)$'
stages: [pre-commit]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Once you have a Mojo project set up locally,
lightbug_http = ">=25.4.0"
```

3. Run `magic install` at the root of your project, where `mojoproject.toml` is located
3. Run `pixi install` at the root of your project, where `pixi.toml` is located
4. Lightbug should now be installed as a dependency. You can import all the default imports at once, e.g:

```mojo
Expand Down Expand Up @@ -190,7 +190,7 @@ struct Welcome(HTTPService):

### Using the client

Create a file, e.g `client.mojo` with the following code. Run `magic run mojo client.mojo` to execute the request to a given URL.
Create a file, e.g `client.mojo` with the following code. Run `pixi run mojo client.mojo` to execute the request to a given URL.

```mojo
from lightbug_http import *
Expand Down
4 changes: 2 additions & 2 deletions docker/lightbug.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/modular/magic:latest
FROM ghcr.io/prefix-dev/pixi:latest

RUN apt-get update && apt-get install -y git

Expand All @@ -15,4 +15,4 @@ ENV DEFAULT_SERVER_PORT=${DEFAULT_SERVER_PORT}
ENV DEFAULT_SERVER_HOST=${DEFAULT_SERVER_HOST}
ENV APP_ENTRYPOINT=lightbug.🔥

CMD magic run mojo ${APP_ENTRYPOINT}
CMD pixi run mojo ${APP_ENTRYPOINT}
8 changes: 4 additions & 4 deletions mojoproject.toml → pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ version = "0.25.6"
[tasks]
build = { cmd = "rattler-build build --recipe recipes -c https://conda.modular.com/max -c conda-forge --skip-existing=all", env = {MODULAR_MOJO_IMPORT_PATH = "$CONDA_PREFIX/lib/mojo"} }
publish = { cmd = "bash scripts/publish.sh", env = { PREFIX_API_KEY = "$PREFIX_API_KEY" } }
format = { cmd = "magic run mojo format -l 120 lightbug_http" }
format = { cmd = "mojo format -l 120 lightbug_http" }

[feature.unit-tests.tasks]
test = { cmd = "magic run mojo test -I . tests/lightbug_http" }
test = { cmd = "mojo test -I . tests/lightbug_http" }

[feature.integration-tests.tasks]
integration_tests_py = { cmd = "bash scripts/integration_test.sh" }
integration_tests_external = { cmd = "magic run mojo test -I . tests/integration" }
integration_tests_external = { cmd = "mojo test -I . tests/integration" }
integration_tests_udp = { cmd = "bash scripts/udp_test.sh" }

[feature.bench.tasks]
bench = { cmd = "magic run mojo -I . benchmark/bench.mojo" }
bench = { cmd = "mojo -I . benchmark/bench.mojo" }
bench_server = { cmd = "bash scripts/bench_server.sh" }

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion recipes/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source:
build:
script:
- mkdir -p ${PREFIX}/lib/mojo
- magic run mojo package . -o ${PREFIX}/lib/mojo/lightbug_http.mojopkg
- pixi run mojo package . -o ${PREFIX}/lib/mojo/lightbug_http.mojopkg

requirements:
run:
Expand Down
2 changes: 1 addition & 1 deletion scripts/bench_server.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


magic run mojo build -I . benchmark/bench_server.mojo || exit 1
pixi run mojo build -I . benchmark/bench_server.mojo || exit 1

echo "running server..."
./bench_server&
Expand Down
8 changes: 4 additions & 4 deletions scripts/integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ kill_server() {
}

test_server() {
(magic run mojo build -D LB_LOG_LEVEL=DEBUG -I . --debug-level full tests/integration/integration_test_server.mojo) || exit 1
(pixi run mojo build -D LB_LOG_LEVEL=DEBUG -I . --debug-level full tests/integration/integration_test_server.mojo) || exit 1

echo "[INFO] Starting Mojo server..."
./integration_test_server &

sleep 5

echo "[INFO] Testing server with Python client"
magic run python3 tests/integration/integration_client.py
pixi run python3 tests/integration/integration_client.py

rm ./integration_test_server
kill_server "integration_test_server" || echo "Failed to kill Mojo server"
}

test_client() {
echo "[INFO] Testing Mojo client with Python server"
(magic run mojo build -D LB_LOG_LEVEL=DEBUG -I . --debug-level full tests/integration/integration_test_client.mojo) || exit 1
(pixi run mojo build -D LB_LOG_LEVEL=DEBUG -I . --debug-level full tests/integration/integration_test_client.mojo) || exit 1

echo "[INFO] Starting Python server..."
magic run fastapi run tests/integration/integration_server.py &
pixi run fastapi run tests/integration/integration_server.py &
sleep 5

./integration_test_client
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# ignore errors because we want to ignore duplicate packages
for file in $CONDA_BLD_PATH/**/*.conda; do
magic run rattler-build upload prefix -c "mojo-community" "$file" || true
pixi run rattler-build upload prefix -c "mojo-community" "$file" || true
done

rm $CONDA_BLD_PATH/**/*.conda
4 changes: 2 additions & 2 deletions scripts/udp_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ kill_server() {
wait $pid 2>/dev/null
}

(magic run mojo build -D LB_LOG_LEVEL=DEBUG -I . --debug-level full tests/integration/udp/udp_server.mojo)
(magic run mojo build -D LB_LOG_LEVEL=DEBUG -I . --debug-level full tests/integration/udp/udp_client.mojo)
(pixi run mojo build -D LB_LOG_LEVEL=DEBUG -I . --debug-level full tests/integration/udp/udp_server.mojo)
(pixi run mojo build -D LB_LOG_LEVEL=DEBUG -I . --debug-level full tests/integration/udp/udp_client.mojo)

echo "[INFO] Starting UDP server..."
./udp_server &
Expand Down