Skip to content

Commit

Permalink
remove zig port (from master)
Browse files Browse the repository at this point in the history
  • Loading branch information
azuline committed May 13, 2024
1 parent d168498 commit 6d2342d
Show file tree
Hide file tree
Showing 14 changed files with 6 additions and 253 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ jobs:
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build Nix
run: nix build -j8 .#devShells.x86_64-linux.default
- name: Zig Cache
uses: actions/cache@v4
with:
path: rose-zig/zig-cache
key: ${{ runner.os }}-rose-zig
save-always: true
- name: Typecheck
if: success() || failure() # Means that we run all steps even if one fails.
run: nix develop --command make typecheck
Expand Down
20 changes: 4 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
check: typecheck test lintcheck

# Build the Zig library for development.
build-zig:
cd rose-zig && zig build -Doptimize=Debug

typecheck: build-zig
typecheck:
mypy .

test-py: build-zig
test:
pytest -n logical .
coverage html

test-zig:
cd rose-zig && zig build test --summary all

test: test-zig test-py

snapshot: build-zig
snapshot:
pytest --snapshot-update .

lintcheck:
Expand All @@ -32,7 +23,4 @@ lint:
clean:
git clean -xdf

nixify-zig-deps:
cd rose-zig && zon2nix > deps.nix

.PHONY: check build-zig test-py test-zig test typecheck lintcheck lint clean nixify-zig-deps
.PHONY: check test typecheck lintcheck lint clean
9 changes: 2 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
inherit
# Runtime deps.
appdirs
cffi
click
jinja2
llfuse
Expand Down Expand Up @@ -69,7 +68,6 @@
echo "$path"
}
export ROSE_ROOT="$(find-up flake.nix)"
export ROSE_SO_PATH="$ROSE_ROOT/rose-zig/zig-out/lib/librose.so"
export PYTHONPATH="$ROSE_ROOT/rose-py:''${PYTHONPATH:-}"
export PYTHONPATH="$ROSE_ROOT/rose-watch:$PYTHONPATH"
export PYTHONPATH="$ROSE_ROOT/rose-vfs:$PYTHONPATH"
Expand All @@ -82,23 +80,20 @@
pkgs.ruff
pkgs.nodePackages.pyright
pkgs.nodePackages.prettier
pkgs.zig
pkgs.zls
python-with-deps
zon2nix
];
})
];
};
packages = rec {
rose-zig = pkgs.callPackage ./rose-zig { inherit version; };
rose-py = pkgs.callPackage ./rose-py { inherit version python-pin py-deps rose-zig; };
rose-py = pkgs.callPackage ./rose-py { inherit version python-pin py-deps; };
rose-watch = pkgs.callPackage ./rose-watch { inherit version python-pin py-deps rose-py; };
rose-vfs = pkgs.callPackage ./rose-vfs { inherit version python-pin py-deps rose-py; };
rose-cli = pkgs.callPackage ./rose-cli { inherit version python-pin py-deps rose-py rose-vfs rose-watch; };
all = pkgs.buildEnv {
name = "rose-all";
paths = [ rose-zig rose-py rose-watch rose-vfs rose-cli ];
paths = [ rose-py rose-watch rose-vfs rose-cli ];
};
};
});
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "snapshottest"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "cffi"
ignore_missing_imports = true

[tool.pytest.ini_options]
addopts = [
Expand Down
8 changes: 0 additions & 8 deletions rose-cli/rose_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,6 @@ def version() -> None:
click.echo(VERSION)


@cli.command()
def tmp() -> None:
"""Temporary development command for FFI testing. If you see this, it's a bug."""
from rose.ffi import get_release

print(get_release())


@cli.group()
def config() -> None:
"""Utilites for configuring Rosé."""
Expand Down
5 changes: 0 additions & 5 deletions rose-cli/rose_cli/cli_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pytest
from click.testing import CliRunner
from rose import AudioTags, Config
from rose.ffi import get_release
from rose_vfs.virtualfs_test import start_virtual_fs

from rose_cli.cli import (
Expand Down Expand Up @@ -126,7 +125,3 @@ def mock_exit(x: int) -> None:
# Assert that we can't kill a non-existent watchdog.
res = runner.invoke(unwatch, obj=ctx)
assert res.exit_code == 1


def test_ffi() -> None:
assert get_release() == "hello"
4 changes: 0 additions & 4 deletions rose-py/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
{ python-pin
, version
, py-deps
, rose-zig
}:

python-pin.pkgs.buildPythonPackage {
pname = "rose";
version = version;
src = ./.;
propagatedBuildInputs = [
rose-zig
py-deps.appdirs
py-deps.cffi
py-deps.click
py-deps.jinja2
py-deps.mutagen
Expand All @@ -20,5 +17,4 @@ python-pin.pkgs.buildPythonPackage {
py-deps.uuid6
];
doCheck = false;
ROSE_SO_PATH = "${rose-zig}/lib/librose.so";
}
22 changes: 0 additions & 22 deletions rose-py/rose/ffi.py

This file was deleted.

47 changes: 0 additions & 47 deletions rose-zig/build.zig

This file was deleted.

15 changes: 0 additions & 15 deletions rose-zig/build.zig.zon

This file was deleted.

15 changes: 0 additions & 15 deletions rose-zig/default.nix

This file was deleted.

62 changes: 0 additions & 62 deletions rose-zig/deps.nix

This file was deleted.

17 changes: 0 additions & 17 deletions rose-zig/ffi/root.zig

This file was deleted.

26 changes: 0 additions & 26 deletions rose-zig/rose/root.zig

This file was deleted.

0 comments on commit 6d2342d

Please sign in to comment.