Skip to content

Commit

Permalink
"INP"
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-q committed Jan 15, 2025
1 parent 8677316 commit 7dd7c50
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
21 changes: 14 additions & 7 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@
cfg = config.hugr-qir;
libllvm = pkgs."llvmPackages_${cfg.llvmVersion}".libllvm;
in {
# set these options in devenv.local.nix
options.hugr-qir = {
llvmVersion = lib.mkOption {
type = lib.types.str;
default = "14";
};
patch-ruff = lib.mkEnableOption "patch-ruff";
};
config = {
config = lib.mkMerge [{
packages = [
pkgs.pre-commit
# These are required for hugr-llvm to be able to link to llvm.
pkgs.libffi
pkgs.libxml2
Expand All @@ -22,11 +25,6 @@ in {
# '';

# https://devenv.sh/tasks/
# tasks = {
# "myproj:setup".exec = "mytool build";
# "devenv:enterShell".after = [ "myproj:setup" ];
# };

env = {
"LLVM_SYS_${cfg.llvmVersion}0_PREFIX" = "${libllvm.dev}";
};
Expand All @@ -46,5 +44,14 @@ in {
};
};
};
};
} (lib.mkIf cfg.patch-ruff {
tasks = {
# Patch ruff to make it runnable
"venv:patchelf" = {
exec = "${lib.getExe pkgs.patchelf} --set-interpreter ${pkgs.stdenv.cc.bintools.dynamicLinker} $VIRTUAL_ENV/bin/ruff";
after = [ "devenv:python:virtualenv" ]; # Runs after this
before = [ "devenv:enterShell" ]; # Runs before this
};
};
})];
}
Empty file added python/hugr_qir/__init__.py
Empty file.
Empty file.
3 changes: 1 addition & 2 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lint.select = [
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
# "INP", # flake8-no-pep420
"INP", # flake8-no-pep420
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
Expand Down Expand Up @@ -63,4 +63,3 @@ convention = "google"

[lint.per-file-ignores]
"guppy_examples/*" = ["INP"]

0 comments on commit 7dd7c50

Please sign in to comment.