From 888d81d071be3b6fde07daf6a01d7d4203de7a97 Mon Sep 17 00:00:00 2001 From: Seyon Sivarajah Date: Wed, 17 Jan 2024 16:03:51 +0000 Subject: [PATCH] chore!: rename package to guppylang (#108) Closes #80 For some reason some ruff lints (about using `getattr` and `setattr` only appeared after the package rename so I've resolved those. BREAKING_CHANGES: package name changed from `guppy` to `guppylang` --- .github/workflows/pull-request.yaml | 6 ++-- examples/demo.ipynb | 10 +++--- {guppy => guppylang}/__init__.py | 0 {guppy => guppylang}/ast_util.py | 20 +++++------ {guppy => guppylang}/cfg/__init__.py | 0 {guppy => guppylang}/cfg/analysis.py | 2 +- {guppy => guppylang}/cfg/bb.py | 8 ++--- {guppy => guppylang}/cfg/builder.py | 16 ++++----- {guppy => guppylang}/cfg/cfg.py | 4 +-- {guppy => guppylang}/checker/__init__.py | 0 {guppy => guppylang}/checker/cfg_checker.py | 16 ++++----- {guppy => guppylang}/checker/core.py | 4 +-- {guppy => guppylang}/checker/expr_checker.py | 18 ++++++---- {guppy => guppylang}/checker/func_checker.py | 18 +++++----- {guppy => guppylang}/checker/stmt_checker.py | 16 ++++----- {guppy => guppylang}/compiler/__init__.py | 0 {guppy => guppylang}/compiler/cfg_compiler.py | 14 ++++---- {guppy => guppylang}/compiler/core.py | 8 ++--- .../compiler/expr_compiler.py | 22 ++++++------ .../compiler/func_compiler.py | 14 ++++---- .../compiler/stmt_compiler.py | 16 ++++----- {guppy => guppylang}/custom.py | 20 +++++------ {guppy => guppylang}/declared.py | 18 +++++----- {guppy => guppylang}/decorator.py | 16 ++++----- {guppy => guppylang}/error.py | 6 ++-- {guppy => guppylang}/gtypes.py | 22 ++++++------ {guppy => guppylang}/hugr/__init__.py | 0 {guppy => guppylang}/hugr/hugr.py | 8 ++--- {guppy => guppylang}/hugr/ops.py | 2 +- {guppy => guppylang}/hugr/raw.py | 2 +- {guppy => guppylang}/hugr/tys.py | 0 {guppy => guppylang}/hugr/val.py | 0 {guppy => guppylang}/hugr/visualise.py | 8 ++--- {guppy => guppylang}/module.py | 25 +++++++------ {guppy => guppylang}/nodes.py | 8 ++--- {guppy => guppylang}/prelude/__init__.py | 0 {guppy => guppylang}/prelude/_internal.py | 18 +++++----- {guppy => guppylang}/prelude/builtins.py | 12 +++---- {guppy => guppylang}/prelude/quantum.py | 8 ++--- poetry.lock | 36 +++++++++---------- pyproject.toml | 2 +- scripts/generate_schema.py | 2 +- tests/error/comprehension_errors/capture1.py | 10 +++--- tests/error/comprehension_errors/capture2.py | 10 +++--- tests/error/comprehension_errors/guarded1.py | 10 +++--- tests/error/comprehension_errors/guarded2.py | 10 +++--- .../illegal_short_circuit.py | 2 +- .../comprehension_errors/illegal_ternary.py | 2 +- .../comprehension_errors/illegal_walrus.py | 2 +- .../error/comprehension_errors/multi_use1.py | 10 +++--- .../error/comprehension_errors/multi_use2.py | 10 +++--- .../error/comprehension_errors/multi_use3.py | 10 +++--- tests/error/comprehension_errors/not_used.py | 10 +++--- .../comprehension_errors/pattern_override1.py | 10 +++--- .../comprehension_errors/pattern_override2.py | 10 +++--- .../error/comprehension_errors/used_twice1.py | 10 +++--- .../error/comprehension_errors/used_twice2.py | 10 +++--- .../error/comprehension_errors/used_twice3.py | 10 +++--- .../error/errors_on_usage/and_not_defined.py | 2 +- .../errors_on_usage/else_expr_not_defined.py | 2 +- .../errors_on_usage/else_expr_type_change.py | 2 +- .../error/errors_on_usage/else_not_defined.py | 2 +- .../else_not_defined_functional.py | 2 +- .../error/errors_on_usage/else_type_change.py | 2 +- .../else_type_change_functional.py | 2 +- tests/error/errors_on_usage/for_new_var.py | 2 +- tests/error/errors_on_usage/for_target.py | 2 +- .../errors_on_usage/for_target_type_change.py | 2 +- .../error/errors_on_usage/for_type_change.py | 2 +- .../errors_on_usage/if_different_types.py | 2 +- .../if_different_types_functional.py | 2 +- .../if_expr_cond_type_change.py | 2 +- .../errors_on_usage/if_expr_not_defined.py | 2 +- .../errors_on_usage/if_expr_type_change.py | 2 +- .../errors_on_usage/if_expr_type_conflict.py | 2 +- tests/error/errors_on_usage/if_not_defined.py | 2 +- .../if_not_defined_functional.py | 2 +- tests/error/errors_on_usage/if_type_change.py | 2 +- .../if_type_change_functional.py | 2 +- tests/error/errors_on_usage/or_not_defined.py | 2 +- tests/error/errors_on_usage/while_new_var.py | 2 +- .../while_new_var_functional.py | 2 +- .../errors_on_usage/while_type_change.py | 2 +- .../while_type_change_functional.py | 2 +- tests/error/iter_errors/end_missing.py | 6 ++-- tests/error/iter_errors/end_wrong_type.py | 6 ++-- tests/error/iter_errors/hasnext_missing.py | 6 ++-- tests/error/iter_errors/hasnext_wrong_type.py | 6 ++-- tests/error/iter_errors/iter_missing.py | 6 ++-- tests/error/iter_errors/iter_wrong_type.py | 6 ++-- tests/error/iter_errors/next_missing.py | 6 ++-- tests/error/iter_errors/next_wrong_type.py | 6 ++-- tests/error/linear_errors/branch_use.py | 8 ++--- tests/error/linear_errors/break_unused.py | 8 ++--- tests/error/linear_errors/continue_unused.py | 8 ++--- tests/error/linear_errors/copy.py | 8 ++--- tests/error/linear_errors/for_break.py | 10 +++--- tests/error/linear_errors/for_return.py | 10 +++--- tests/error/linear_errors/if_both_unused.py | 8 ++--- .../linear_errors/if_both_unused_reassign.py | 8 ++--- tests/error/linear_errors/reassign_unused.py | 8 ++--- .../linear_errors/reassign_unused_tuple.py | 8 ++--- tests/error/linear_errors/unused.py | 8 ++--- tests/error/linear_errors/unused_expr.py | 8 ++--- .../error/linear_errors/unused_same_block.py | 8 ++--- tests/error/misc_errors/arg_not_annotated.py | 2 +- tests/error/misc_errors/functional_break.py | 2 +- .../error/misc_errors/functional_continue.py | 2 +- tests/error/misc_errors/functional_return.py | 2 +- tests/error/misc_errors/list_linear.py | 8 ++--- tests/error/misc_errors/nested_functional.py | 2 +- tests/error/misc_errors/no_return.py | 2 +- .../error/misc_errors/return_not_annotated.py | 2 +- .../misc_errors/return_not_annotated_none1.py | 2 +- .../misc_errors/return_not_annotated_none2.py | 2 +- tests/error/misc_errors/undefined_var.py | 2 +- tests/error/misc_errors/unreachable_1.py | 2 +- tests/error/misc_errors/unreachable_2.py | 2 +- tests/error/misc_errors/unreachable_3.py | 2 +- tests/error/misc_errors/unreachable_4.py | 2 +- tests/error/misc_errors/unreachable_5.py | 2 +- .../error/nested_errors/different_types_if.py | 2 +- tests/error/nested_errors/linear_capture.py | 8 ++--- tests/error/nested_errors/not_defined_if.py | 2 +- .../error/nested_errors/reassign_capture_1.py | 2 +- .../error/nested_errors/reassign_capture_2.py | 2 +- .../error/nested_errors/reassign_capture_3.py | 2 +- tests/error/nested_errors/var_not_defined.py | 2 +- tests/error/poly_errors/arg_mismatch1.py | 4 +-- tests/error/poly_errors/arg_mismatch2.py | 4 +-- tests/error/poly_errors/define.py | 4 +-- tests/error/poly_errors/free_return_var.py | 4 +-- .../error/poly_errors/inst_return_mismatch.py | 4 +-- .../inst_return_mismatch_nested.py | 4 +-- tests/error/poly_errors/non_linear1.py | 8 ++--- tests/error/poly_errors/non_linear2.py | 8 ++--- tests/error/poly_errors/pass_poly_free.py | 4 +-- tests/error/poly_errors/return_mismatch.py | 4 +-- tests/error/poly_errors/right_to_left.py | 4 +-- tests/error/py_errors/guppy_name1.py | 2 +- tests/error/py_errors/guppy_name2.py | 2 +- tests/error/py_errors/no_args.py | 2 +- tests/error/py_errors/python_err.py | 2 +- tests/error/py_errors/unsupported.py | 2 +- tests/error/type_errors/and_not_bool_left.py | 4 +-- tests/error/type_errors/and_not_bool_right.py | 4 +-- .../type_errors/binary_not_arith_left.py | 2 +- .../type_errors/binary_not_arith_right.py | 2 +- tests/error/type_errors/call_missing_arg.py | 2 +- tests/error/type_errors/call_not_function.py | 2 +- .../error/type_errors/call_unexpected_arg.py | 2 +- tests/error/type_errors/call_wrong_arg.py | 2 +- tests/error/type_errors/fun_ty_mismatch_1.py | 2 +- tests/error/type_errors/fun_ty_mismatch_2.py | 2 +- tests/error/type_errors/fun_ty_mismatch_3.py | 2 +- tests/error/type_errors/if_expr_not_bool.py | 4 +-- tests/error/type_errors/if_not_bool.py | 4 +-- .../type_errors/if_not_bool_functional.py | 2 +- tests/error/type_errors/invert_not_int.py | 2 +- tests/error/type_errors/not_not_bool.py | 4 +-- tests/error/type_errors/or_not_bool_left.py | 4 +-- tests/error/type_errors/or_not_bool_right.py | 4 +-- tests/error/type_errors/return_mismatch.py | 2 +- tests/error/type_errors/unary_not_arith.py | 2 +- tests/error/type_errors/unpack_not_enough.py | 2 +- tests/error/type_errors/unpack_too_many.py | 2 +- tests/error/type_errors/while_not_bool.py | 4 +-- .../type_errors/while_not_bool_functional.py | 2 +- tests/error/util.py | 8 ++--- tests/hugr/test_dummy_nodes.py | 6 ++-- tests/hugr/test_ports.py | 4 +-- tests/integration/test_arithmetic.py | 2 +- tests/integration/test_basic.py | 6 ++-- tests/integration/test_call.py | 4 +-- tests/integration/test_comprehension.py | 12 +++---- tests/integration/test_for.py | 2 +- tests/integration/test_functional.py | 2 +- tests/integration/test_higher_order.py | 4 +-- tests/integration/test_if.py | 2 +- tests/integration/test_linear.py | 16 ++++----- tests/integration/test_linst.py | 10 +++--- tests/integration/test_list.py | 2 +- tests/integration/test_nested.py | 2 +- tests/integration/test_poly.py | 8 ++--- tests/integration/test_programs.py | 4 +-- tests/integration/test_py.py | 2 +- tests/integration/test_unused.py | 2 +- tests/integration/test_while.py | 2 +- 188 files changed, 531 insertions(+), 522 deletions(-) rename {guppy => guppylang}/__init__.py (100%) rename {guppy => guppylang}/ast_util.py (95%) rename {guppy => guppylang}/cfg/__init__.py (100%) rename {guppy => guppylang}/cfg/analysis.py (99%) rename {guppy => guppylang}/cfg/bb.py (95%) rename {guppy => guppylang}/cfg/builder.py (98%) rename {guppy => guppylang}/cfg/cfg.py (95%) rename {guppy => guppylang}/checker/__init__.py (100%) rename {guppy => guppylang}/checker/cfg_checker.py (95%) rename {guppy => guppylang}/checker/core.py (98%) rename {guppy => guppylang}/checker/expr_checker.py (99%) rename {guppy => guppylang}/checker/func_checker.py (93%) rename {guppy => guppylang}/checker/stmt_checker.py (92%) rename {guppy => guppylang}/compiler/__init__.py (100%) rename {guppy => guppylang}/compiler/cfg_compiler.py (94%) rename {guppy => guppylang}/compiler/core.py (93%) rename {guppy => guppylang}/compiler/expr_compiler.py (95%) rename {guppy => guppylang}/compiler/func_compiler.py (91%) rename {guppy => guppylang}/compiler/stmt_compiler.py (88%) rename {guppy => guppylang}/custom.py (93%) rename {guppy => guppylang}/declared.py (82%) rename {guppy => guppylang}/decorator.py (94%) rename {guppy => guppylang}/error.py (96%) rename {guppy => guppylang}/gtypes.py (97%) rename {guppy => guppylang}/hugr/__init__.py (100%) rename {guppy => guppylang}/hugr/hugr.py (99%) rename {guppy => guppylang}/hugr/ops.py (99%) rename {guppy => guppylang}/hugr/raw.py (94%) rename {guppy => guppylang}/hugr/tys.py (100%) rename {guppy => guppylang}/hugr/val.py (100%) rename {guppy => guppylang}/hugr/visualise.py (97%) rename {guppy => guppylang}/module.py (94%) rename {guppy => guppylang}/nodes.py (94%) rename {guppy => guppylang}/prelude/__init__.py (100%) rename {guppy => guppylang}/prelude/_internal.py (95%) rename {guppy => guppylang}/prelude/builtins.py (98%) rename {guppy => guppylang}/prelude/quantum.py (88%) diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index dd92f9b2..aa67db7b 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -36,18 +36,18 @@ jobs: run: poetry add validator/target/wheels/* - name: Type check with mypy - run: poetry run mypy guppy + run: poetry run mypy guppylang - name: Check formatting with ruff uses: chartboost/ruff-action@v1 with: - src: "./guppy" + src: "./guppylang" args: format --check - name: Lint with ruff uses: chartboost/ruff-action@v1 with: - src: "./guppy" + src: "./guppylang" args: check - name: Run tests diff --git a/examples/demo.ipynb b/examples/demo.ipynb index 46198f31..4e2416ce 100644 --- a/examples/demo.ipynb +++ b/examples/demo.ipynb @@ -20,9 +20,9 @@ "import sys\n", "sys.path.append(\"..\")\n", "\n", - "from guppy.hugr.hugr import Hugr\n", - "from guppy.hugr.visualise import hugr_to_graphviz\n", - "from guppy.compiler import GuppyModule, guppy\n", + "from guppylang.hugr.hugr import Hugr\n", + "from guppylang.hugr.visualise import hugr_to_graphviz\n", + "from guppylang.compiler import GuppyModule, guppy\n", "from typing import Callable\n", "\n", "setattr(\n", @@ -6732,8 +6732,8 @@ } ], "source": [ - "import guppy.prelude.quantum as quantum\n", - "from guppy.prelude.quantum import Qubit\n", + "import guppylang.prelude.quantum as quantum\n", + "from guppylang.prelude.quantum import Qubit\n", "\n", "module = GuppyModule(\"test\")\n", "module.load(quantum)\n", diff --git a/guppy/__init__.py b/guppylang/__init__.py similarity index 100% rename from guppy/__init__.py rename to guppylang/__init__.py diff --git a/guppy/ast_util.py b/guppylang/ast_util.py similarity index 95% rename from guppy/ast_util.py rename to guppylang/ast_util.py index b5362b46..6c435f8e 100644 --- a/guppy/ast_util.py +++ b/guppylang/ast_util.py @@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, Any, Generic, Optional, TypeVar, cast if TYPE_CHECKING: - from guppy.gtypes import GuppyType + from guppylang.gtypes import GuppyType AstNode = ( ast.AST @@ -236,9 +236,9 @@ def set_location_from(node: ast.AST, loc: ast.AST) -> None: def annotate_location( node: ast.AST, source: str, file: str, line_offset: int, recurse: bool = True ) -> None: - setattr(node, "line_offset", line_offset) - setattr(node, "file", file) - setattr(node, "source", source) + node.line_offset = line_offset # type: ignore[attr-defined] + node.file = file # type: ignore[attr-defined] + node.source = source # type: ignore[attr-defined] if recurse: for _field, value in ast.iter_fields(node): @@ -253,7 +253,7 @@ def annotate_location( def get_file(node: AstNode) -> str | None: """Tries to retrieve a file annotation from an AST node.""" try: - file = getattr(node, "file") + file = node.file # type: ignore[union-attr] return file if isinstance(file, str) else None except AttributeError: return None @@ -262,7 +262,7 @@ def get_file(node: AstNode) -> str | None: def get_source(node: AstNode) -> str | None: """Tries to retrieve a source annotation from an AST node.""" try: - source = getattr(node, "source") + source = node.source # type: ignore[union-attr] return source if isinstance(source, str) else None except AttributeError: return None @@ -271,7 +271,7 @@ def get_source(node: AstNode) -> str | None: def get_line_offset(node: AstNode) -> int | None: """Tries to retrieve a line offset annotation from an AST node.""" try: - line_offset = getattr(node, "line_offset") + line_offset = node.line_offset # type: ignore[union-attr] return line_offset if isinstance(line_offset, int) else None except AttributeError: return None @@ -288,16 +288,16 @@ def with_loc(loc: ast.AST, node: A) -> A: def with_type(ty: "GuppyType", node: A) -> A: """Annotates an AST node with a type.""" - setattr(node, "type", ty) + node.type = ty # type: ignore[attr-defined] return node def get_type_opt(node: AstNode) -> Optional["GuppyType"]: """Tries to retrieve a type annotation from an AST node.""" - from guppy.gtypes import GuppyType + from guppylang.gtypes import GuppyType try: - ty = getattr(node, "type") + ty = node.type # type: ignore[union-attr] return ty if isinstance(ty, GuppyType) else None except AttributeError: return None diff --git a/guppy/cfg/__init__.py b/guppylang/cfg/__init__.py similarity index 100% rename from guppy/cfg/__init__.py rename to guppylang/cfg/__init__.py diff --git a/guppy/cfg/analysis.py b/guppylang/cfg/analysis.py similarity index 99% rename from guppy/cfg/analysis.py rename to guppylang/cfg/analysis.py index 36ee8780..52ec26bf 100644 --- a/guppy/cfg/analysis.py +++ b/guppylang/cfg/analysis.py @@ -2,7 +2,7 @@ from collections.abc import Iterable from typing import Generic, TypeVar -from guppy.cfg.bb import BB +from guppylang.cfg.bb import BB # Type variable for the lattice domain T = TypeVar("T") diff --git a/guppy/cfg/bb.py b/guppylang/cfg/bb.py similarity index 95% rename from guppy/cfg/bb.py rename to guppylang/cfg/bb.py index d5c89af7..ec08d181 100644 --- a/guppy/cfg/bb.py +++ b/guppylang/cfg/bb.py @@ -5,11 +5,11 @@ from typing_extensions import Self -from guppy.ast_util import AstNode, name_nodes_in_ast -from guppy.nodes import DesugaredListComp, NestedFunctionDef, PyExpr +from guppylang.ast_util import AstNode, name_nodes_in_ast +from guppylang.nodes import DesugaredListComp, NestedFunctionDef, PyExpr if TYPE_CHECKING: - from guppy.cfg.cfg import BaseCFG + from guppylang.cfg.cfg import BaseCFG @dataclass @@ -145,7 +145,7 @@ def visit_PyExpr(self, node: PyExpr) -> None: def visit_NestedFunctionDef(self, node: NestedFunctionDef) -> None: # In order to compute the used external variables in a nested function # definition, we have to run live variable analysis first - from guppy.cfg.analysis import LivenessAnalysis + from guppylang.cfg.analysis import LivenessAnalysis for bb in node.cfg.bbs: bb.compute_variable_stats() diff --git a/guppy/cfg/builder.py b/guppylang/cfg/builder.py similarity index 98% rename from guppy/cfg/builder.py rename to guppylang/cfg/builder.py index 1310562e..b99c2a7d 100644 --- a/guppy/cfg/builder.py +++ b/guppylang/cfg/builder.py @@ -3,7 +3,7 @@ from collections.abc import Iterator from typing import NamedTuple -from guppy.ast_util import ( +from guppylang.ast_util import ( AstVisitor, ContextAdjuster, find_nodes, @@ -11,12 +11,12 @@ template_replace, with_loc, ) -from guppy.cfg.bb import BB, BBStatement -from guppy.cfg.cfg import CFG -from guppy.checker.core import Globals -from guppy.error import GuppyError, InternalGuppyError -from guppy.gtypes import NoneType -from guppy.nodes import ( +from guppylang.cfg.bb import BB, BBStatement +from guppylang.cfg.cfg import CFG +from guppylang.checker.core import Globals +from guppylang.error import GuppyError, InternalGuppyError +from guppylang.gtypes import NoneType +from guppylang.nodes import ( DesugaredGenerator, DesugaredListComp, IterEnd, @@ -210,7 +210,7 @@ def visit_Pass(self, node: ast.Pass, bb: BB, jumps: Jumps) -> BB | None: def visit_FunctionDef( self, node: ast.FunctionDef, bb: BB, jumps: Jumps ) -> BB | None: - from guppy.checker.func_checker import check_signature + from guppylang.checker.func_checker import check_signature func_ty = check_signature(node, self.globals) returns_none = isinstance(func_ty.returns, NoneType) diff --git a/guppy/cfg/cfg.py b/guppylang/cfg/cfg.py similarity index 95% rename from guppy/cfg/cfg.py rename to guppylang/cfg/cfg.py index 986988d5..a6028036 100644 --- a/guppy/cfg/cfg.py +++ b/guppylang/cfg/cfg.py @@ -1,6 +1,6 @@ from typing import Generic, TypeVar -from guppy.cfg.analysis import ( +from guppylang.cfg.analysis import ( AssignmentAnalysis, DefAssignmentDomain, LivenessAnalysis, @@ -8,7 +8,7 @@ MaybeAssignmentDomain, Result, ) -from guppy.cfg.bb import BB, BBStatement +from guppylang.cfg.bb import BB, BBStatement T = TypeVar("T", bound=BB) diff --git a/guppy/checker/__init__.py b/guppylang/checker/__init__.py similarity index 100% rename from guppy/checker/__init__.py rename to guppylang/checker/__init__.py diff --git a/guppy/checker/cfg_checker.py b/guppylang/checker/cfg_checker.py similarity index 95% rename from guppy/checker/cfg_checker.py rename to guppylang/checker/cfg_checker.py index ada6fd02..76d0cd50 100644 --- a/guppy/checker/cfg_checker.py +++ b/guppylang/checker/cfg_checker.py @@ -8,14 +8,14 @@ from collections.abc import Sequence from dataclasses import dataclass -from guppy.ast_util import line_col -from guppy.cfg.bb import BB -from guppy.cfg.cfg import CFG, BaseCFG -from guppy.checker.core import Context, Globals, Locals, Variable -from guppy.checker.expr_checker import ExprSynthesizer, to_bool -from guppy.checker.stmt_checker import StmtChecker -from guppy.error import GuppyError -from guppy.gtypes import GuppyType +from guppylang.ast_util import line_col +from guppylang.cfg.bb import BB +from guppylang.cfg.cfg import CFG, BaseCFG +from guppylang.checker.core import Context, Globals, Locals, Variable +from guppylang.checker.expr_checker import ExprSynthesizer, to_bool +from guppylang.checker.stmt_checker import StmtChecker +from guppylang.error import GuppyError +from guppylang.gtypes import GuppyType VarRow = Sequence[Variable] diff --git a/guppy/checker/core.py b/guppylang/checker/core.py similarity index 98% rename from guppy/checker/core.py rename to guppylang/checker/core.py index 7a65083b..ac5a4288 100644 --- a/guppy/checker/core.py +++ b/guppylang/checker/core.py @@ -6,8 +6,8 @@ from dataclasses import dataclass from typing import Any, NamedTuple -from guppy.ast_util import AstNode, name_nodes_in_ast -from guppy.gtypes import ( +from guppylang.ast_util import AstNode, name_nodes_in_ast +from guppylang.gtypes import ( BoolType, FunctionType, GuppyType, diff --git a/guppy/checker/expr_checker.py b/guppylang/checker/expr_checker.py similarity index 99% rename from guppy/checker/expr_checker.py rename to guppylang/checker/expr_checker.py index 776bfe9b..4b6a2ea2 100644 --- a/guppy/checker/expr_checker.py +++ b/guppylang/checker/expr_checker.py @@ -26,7 +26,7 @@ from contextlib import suppress from typing import Any, NoReturn, cast -from guppy.ast_util import ( +from guppylang.ast_util import ( AstNode, AstVisitor, breaks_in_loop, @@ -36,14 +36,20 @@ with_loc, with_type, ) -from guppy.checker.core import CallableVariable, Context, DummyEvalDict, Globals, Locals -from guppy.error import ( +from guppylang.checker.core import ( + CallableVariable, + Context, + DummyEvalDict, + Globals, + Locals, +) +from guppylang.error import ( GuppyError, GuppyTypeError, GuppyTypeInferenceError, InternalGuppyError, ) -from guppy.gtypes import ( +from guppylang.gtypes import ( BoolType, ExistentialTypeVar, FunctionType, @@ -56,7 +62,7 @@ TupleType, unify, ) -from guppy.nodes import ( +from guppylang.nodes import ( DesugaredGenerator, DesugaredListComp, GlobalName, @@ -807,7 +813,7 @@ def synthesize_comprehension( node: DesugaredListComp, gens: list[DesugaredGenerator], ctx: Context ) -> tuple[DesugaredListComp, GuppyType]: """Helper function to synthesise the element type of a list comprehension.""" - from guppy.checker.stmt_checker import StmtChecker + from guppylang.checker.stmt_checker import StmtChecker def check_linear_use_from_outer_scope(expr: ast.expr, locals: Locals) -> None: """Checks if an expression uses a linear variable from an outer scope. diff --git a/guppy/checker/func_checker.py b/guppylang/checker/func_checker.py similarity index 93% rename from guppy/checker/func_checker.py rename to guppylang/checker/func_checker.py index 0847d609..f224bd99 100644 --- a/guppy/checker/func_checker.py +++ b/guppylang/checker/func_checker.py @@ -8,14 +8,14 @@ import ast from dataclasses import dataclass -from guppy.ast_util import AstNode, return_nodes_in_ast, with_loc -from guppy.cfg.bb import BB -from guppy.cfg.builder import CFGBuilder -from guppy.checker.cfg_checker import CheckedCFG, check_cfg -from guppy.checker.core import CallableVariable, Context, Globals, Variable -from guppy.checker.expr_checker import check_call, synthesize_call -from guppy.error import GuppyError -from guppy.gtypes import ( +from guppylang.ast_util import AstNode, return_nodes_in_ast, with_loc +from guppylang.cfg.bb import BB +from guppylang.cfg.builder import CFGBuilder +from guppylang.checker.cfg_checker import CheckedCFG, check_cfg +from guppylang.checker.core import CallableVariable, Context, Globals, Variable +from guppylang.checker.expr_checker import check_call, synthesize_call +from guppylang.error import GuppyError +from guppylang.gtypes import ( BoundTypeVar, FunctionType, GuppyType, @@ -23,7 +23,7 @@ Subst, type_from_ast, ) -from guppy.nodes import CheckedNestedFunctionDef, GlobalCall, NestedFunctionDef +from guppylang.nodes import CheckedNestedFunctionDef, GlobalCall, NestedFunctionDef @dataclass diff --git a/guppy/checker/stmt_checker.py b/guppylang/checker/stmt_checker.py similarity index 92% rename from guppy/checker/stmt_checker.py rename to guppylang/checker/stmt_checker.py index 85efc2b5..686003fb 100644 --- a/guppy/checker/stmt_checker.py +++ b/guppylang/checker/stmt_checker.py @@ -11,13 +11,13 @@ import ast from collections.abc import Sequence -from guppy.ast_util import AstVisitor, with_loc -from guppy.cfg.bb import BB, BBStatement -from guppy.checker.core import Context, Variable -from guppy.checker.expr_checker import ExprChecker, ExprSynthesizer -from guppy.error import GuppyError, GuppyTypeError, InternalGuppyError -from guppy.gtypes import GuppyType, NoneType, Subst, TupleType, type_from_ast -from guppy.nodes import NestedFunctionDef +from guppylang.ast_util import AstVisitor, with_loc +from guppylang.cfg.bb import BB, BBStatement +from guppylang.checker.core import Context, Variable +from guppylang.checker.expr_checker import ExprChecker, ExprSynthesizer +from guppylang.error import GuppyError, GuppyTypeError, InternalGuppyError +from guppylang.gtypes import GuppyType, NoneType, Subst, TupleType, type_from_ast +from guppylang.nodes import NestedFunctionDef class StmtChecker(AstVisitor[BBStatement]): @@ -130,7 +130,7 @@ def visit_Return(self, node: ast.Return) -> ast.stmt: return node def visit_NestedFunctionDef(self, node: NestedFunctionDef) -> ast.stmt: - from guppy.checker.func_checker import check_nested_func_def + from guppylang.checker.func_checker import check_nested_func_def if not self.bb: raise InternalGuppyError("BB required to check nested function def!") diff --git a/guppy/compiler/__init__.py b/guppylang/compiler/__init__.py similarity index 100% rename from guppy/compiler/__init__.py rename to guppylang/compiler/__init__.py diff --git a/guppy/compiler/cfg_compiler.py b/guppylang/compiler/cfg_compiler.py similarity index 94% rename from guppy/compiler/cfg_compiler.py rename to guppylang/compiler/cfg_compiler.py index 0b9c9a9a..2af09078 100644 --- a/guppy/compiler/cfg_compiler.py +++ b/guppylang/compiler/cfg_compiler.py @@ -1,19 +1,19 @@ import functools from typing import TYPE_CHECKING -from guppy.checker.cfg_checker import CheckedBB, CheckedCFG, Signature, VarRow -from guppy.checker.core import Variable -from guppy.compiler.core import ( +from guppylang.checker.cfg_checker import CheckedBB, CheckedCFG, Signature, VarRow +from guppylang.checker.core import Variable +from guppylang.compiler.core import ( CompiledGlobals, DFContainer, PortVariable, is_return_var, return_var, ) -from guppy.compiler.expr_compiler import ExprCompiler -from guppy.compiler.stmt_compiler import StmtCompiler -from guppy.gtypes import SumType, TupleType, type_to_row -from guppy.hugr.hugr import CFNode, Hugr, Node, OutPortV +from guppylang.compiler.expr_compiler import ExprCompiler +from guppylang.compiler.stmt_compiler import StmtCompiler +from guppylang.gtypes import SumType, TupleType, type_to_row +from guppylang.hugr.hugr import CFNode, Hugr, Node, OutPortV if TYPE_CHECKING: from collections.abc import Sequence diff --git a/guppy/compiler/core.py b/guppylang/compiler/core.py similarity index 93% rename from guppy/compiler/core.py rename to guppylang/compiler/core.py index 5f00f715..9e9026a8 100644 --- a/guppy/compiler/core.py +++ b/guppylang/compiler/core.py @@ -2,10 +2,10 @@ from collections.abc import Iterator from dataclasses import dataclass -from guppy.ast_util import AstNode -from guppy.checker.core import CallableVariable, Variable -from guppy.gtypes import FunctionType, Inst -from guppy.hugr.hugr import DFContainingNode, Hugr, OutPortV +from guppylang.ast_util import AstNode +from guppylang.checker.core import CallableVariable, Variable +from guppylang.gtypes import FunctionType, Inst +from guppylang.hugr.hugr import DFContainingNode, Hugr, OutPortV @dataclass diff --git a/guppy/compiler/expr_compiler.py b/guppylang/compiler/expr_compiler.py similarity index 95% rename from guppy/compiler/expr_compiler.py rename to guppylang/compiler/expr_compiler.py index 1d71556e..7271a990 100644 --- a/guppy/compiler/expr_compiler.py +++ b/guppylang/compiler/expr_compiler.py @@ -3,16 +3,16 @@ from contextlib import contextmanager from typing import Any -from guppy.ast_util import AstVisitor, get_type, with_loc, with_type -from guppy.cfg.builder import tmp_vars -from guppy.compiler.core import ( +from guppylang.ast_util import AstVisitor, get_type, with_loc, with_type +from guppylang.cfg.builder import tmp_vars +from guppylang.compiler.core import ( CompiledFunction, CompilerBase, DFContainer, PortVariable, ) -from guppy.error import GuppyError, InternalGuppyError -from guppy.gtypes import ( +from guppylang.error import GuppyError, InternalGuppyError +from guppylang.gtypes import ( BoolType, BoundTypeVar, FunctionType, @@ -21,9 +21,9 @@ TupleType, type_to_row, ) -from guppy.hugr import ops, val -from guppy.hugr.hugr import DFContainingNode, OutPortV, VNode -from guppy.nodes import ( +from guppylang.hugr import ops, val +from guppylang.hugr.hugr import DFContainingNode, OutPortV, VNode +from guppylang.nodes import ( DesugaredGenerator, DesugaredListComp, GlobalCall, @@ -35,7 +35,7 @@ class ExprCompiler(CompilerBase, AstVisitor[OutPortV]): - """A compiler from Guppy expressions to Hugr.""" + """A compiler from guppylang expressions to Hugr.""" dfg: DFContainer @@ -220,7 +220,7 @@ def visit_UnaryOp(self, node: ast.UnaryOp) -> OutPortV: raise InternalGuppyError("Node should have been removed during type checking.") def visit_DesugaredListComp(self, node: DesugaredListComp) -> OutPortV: - from guppy.compiler.stmt_compiler import StmtCompiler + from guppylang.compiler.stmt_compiler import StmtCompiler compiler = StmtCompiler(self.graph, self.globals) @@ -299,7 +299,7 @@ def python_value_to_hugr(v: Any) -> val.Value | None: Returns None if the Python value cannot be represented in Guppy. """ - from guppy.prelude._internal import bool_value, float_value, int_value + from guppylang.prelude._internal import bool_value, float_value, int_value match v: case bool(): diff --git a/guppy/compiler/func_compiler.py b/guppylang/compiler/func_compiler.py similarity index 91% rename from guppy/compiler/func_compiler.py rename to guppylang/compiler/func_compiler.py index 1869c8ac..e67b900b 100644 --- a/guppy/compiler/func_compiler.py +++ b/guppylang/compiler/func_compiler.py @@ -1,17 +1,17 @@ from dataclasses import dataclass -from guppy.ast_util import AstNode -from guppy.checker.func_checker import CheckedFunction, DefinedFunction -from guppy.compiler.cfg_compiler import compile_cfg -from guppy.compiler.core import ( +from guppylang.ast_util import AstNode +from guppylang.checker.func_checker import CheckedFunction, DefinedFunction +from guppylang.compiler.cfg_compiler import compile_cfg +from guppylang.compiler.core import ( CompiledFunction, CompiledGlobals, DFContainer, PortVariable, ) -from guppy.gtypes import FunctionType, Inst, type_to_row -from guppy.hugr.hugr import DFContainingVNode, Hugr, OutPortV -from guppy.nodes import CheckedNestedFunctionDef +from guppylang.gtypes import FunctionType, Inst, type_to_row +from guppylang.hugr.hugr import DFContainingVNode, Hugr, OutPortV +from guppylang.nodes import CheckedNestedFunctionDef @dataclass diff --git a/guppy/compiler/stmt_compiler.py b/guppylang/compiler/stmt_compiler.py similarity index 88% rename from guppy/compiler/stmt_compiler.py rename to guppylang/compiler/stmt_compiler.py index a2ab4f6a..85e2ae53 100644 --- a/guppy/compiler/stmt_compiler.py +++ b/guppylang/compiler/stmt_compiler.py @@ -1,19 +1,19 @@ import ast from collections.abc import Sequence -from guppy.ast_util import AstVisitor -from guppy.compiler.core import ( +from guppylang.ast_util import AstVisitor +from guppylang.compiler.core import ( CompiledGlobals, CompilerBase, DFContainer, PortVariable, return_var, ) -from guppy.compiler.expr_compiler import ExprCompiler -from guppy.error import InternalGuppyError -from guppy.gtypes import TupleType -from guppy.hugr.hugr import Hugr, OutPortV -from guppy.nodes import CheckedNestedFunctionDef +from guppylang.compiler.expr_compiler import ExprCompiler +from guppylang.error import InternalGuppyError +from guppylang.gtypes import TupleType +from guppylang.hugr.hugr import Hugr, OutPortV +from guppylang.nodes import CheckedNestedFunctionDef class StmtCompiler(CompilerBase, AstVisitor[None]): @@ -85,7 +85,7 @@ def visit_Return(self, node: ast.Return) -> None: self.dfg[name] = PortVariable(name, port, node) def visit_CheckedNestedFunctionDef(self, node: CheckedNestedFunctionDef) -> None: - from guppy.compiler.func_compiler import compile_local_func_def + from guppylang.compiler.func_compiler import compile_local_func_def self.dfg[node.name] = compile_local_func_def( node, self.dfg, self.graph, self.globals diff --git a/guppy/custom.py b/guppylang/custom.py similarity index 93% rename from guppy/custom.py rename to guppylang/custom.py index bd109f15..e1142448 100644 --- a/guppy/custom.py +++ b/guppylang/custom.py @@ -1,20 +1,20 @@ import ast from abc import ABC, abstractmethod -from guppy.ast_util import AstNode, get_type, with_loc, with_type -from guppy.checker.core import Context, Globals -from guppy.checker.expr_checker import check_call, synthesize_call -from guppy.checker.func_checker import check_signature -from guppy.compiler.core import CompiledFunction, CompiledGlobals, DFContainer -from guppy.error import ( +from guppylang.ast_util import AstNode, get_type, with_loc, with_type +from guppylang.checker.core import Context, Globals +from guppylang.checker.expr_checker import check_call, synthesize_call +from guppylang.checker.func_checker import check_signature +from guppylang.compiler.core import CompiledFunction, CompiledGlobals, DFContainer +from guppylang.error import ( GuppyError, InternalGuppyError, UnknownFunctionType, ) -from guppy.gtypes import FunctionType, GuppyType, Inst, Subst, type_to_row -from guppy.hugr import ops -from guppy.hugr.hugr import DFContainingVNode, Hugr, Node, OutPortV -from guppy.nodes import GlobalCall +from guppylang.gtypes import FunctionType, GuppyType, Inst, Subst, type_to_row +from guppylang.hugr import ops +from guppylang.hugr.hugr import DFContainingVNode, Hugr, Node, OutPortV +from guppylang.nodes import GlobalCall class CustomFunction(CompiledFunction): diff --git a/guppy/declared.py b/guppylang/declared.py similarity index 82% rename from guppy/declared.py rename to guppylang/declared.py index df1c0f29..7fc5923e 100644 --- a/guppy/declared.py +++ b/guppylang/declared.py @@ -1,15 +1,15 @@ import ast from dataclasses import dataclass -from guppy.ast_util import AstNode, has_empty_body, with_loc -from guppy.checker.core import Context, Globals -from guppy.checker.expr_checker import check_call, synthesize_call -from guppy.checker.func_checker import check_signature -from guppy.compiler.core import CompiledFunction, CompiledGlobals, DFContainer -from guppy.error import GuppyError -from guppy.gtypes import GuppyType, Inst, Subst, type_to_row -from guppy.hugr.hugr import Hugr, Node, OutPortV, VNode -from guppy.nodes import GlobalCall +from guppylang.ast_util import AstNode, has_empty_body, with_loc +from guppylang.checker.core import Context, Globals +from guppylang.checker.expr_checker import check_call, synthesize_call +from guppylang.checker.func_checker import check_signature +from guppylang.compiler.core import CompiledFunction, CompiledGlobals, DFContainer +from guppylang.error import GuppyError +from guppylang.gtypes import GuppyType, Inst, Subst, type_to_row +from guppylang.hugr.hugr import Hugr, Node, OutPortV, VNode +from guppylang.nodes import GlobalCall @dataclass diff --git a/guppy/decorator.py b/guppylang/decorator.py similarity index 94% rename from guppy/decorator.py rename to guppylang/decorator.py index d7e728e7..72e65d3c 100644 --- a/guppy/decorator.py +++ b/guppylang/decorator.py @@ -3,8 +3,8 @@ from dataclasses import dataclass from typing import Any, ClassVar, TypeVar -from guppy.ast_util import AstNode, has_empty_body -from guppy.custom import ( +from guppylang.ast_util import AstNode, has_empty_body +from guppylang.custom import ( CustomCallChecker, CustomCallCompiler, CustomFunction, @@ -12,11 +12,11 @@ DefaultCallCompiler, OpCompiler, ) -from guppy.error import GuppyError, pretty_errors -from guppy.gtypes import GuppyType, TypeTransformer -from guppy.hugr import ops, tys -from guppy.hugr.hugr import Hugr -from guppy.module import GuppyModule, PyFunc, parse_py_func +from guppylang.error import GuppyError, pretty_errors +from guppylang.gtypes import GuppyType, TypeTransformer +from guppylang.hugr import ops, tys +from guppylang.hugr.hugr import Hugr +from guppylang.module import GuppyModule, PyFunc, parse_py_func FuncDecorator = Callable[[PyFunc], PyFunc] CustomFuncDecorator = Callable[[PyFunc], CustomFunction] @@ -133,7 +133,7 @@ def __str__(self) -> str: NewType.__qualname__ = _name module.register_type(_name, NewType) module._register_buffered_instance_funcs(NewType) - setattr(c, "_guppy_type", NewType) + c._guppy_type = NewType # type: ignore[attr-defined] return c return dec diff --git a/guppy/error.py b/guppylang/error.py similarity index 96% rename from guppy/error.py rename to guppylang/error.py index 14bb5813..6677cb88 100644 --- a/guppy/error.py +++ b/guppylang/error.py @@ -6,9 +6,9 @@ from dataclasses import dataclass, field from typing import Any, TypeVar, cast -from guppy.ast_util import AstNode, get_file, get_line_offset, get_source -from guppy.gtypes import BoundTypeVar, ExistentialTypeVar, FunctionType, GuppyType -from guppy.hugr.hugr import Node, OutPortV +from guppylang.ast_util import AstNode, get_file, get_line_offset, get_source +from guppylang.gtypes import BoundTypeVar, ExistentialTypeVar, FunctionType, GuppyType +from guppylang.hugr.hugr import Node, OutPortV # Whether the interpreter should exit when a Guppy error occurs EXIT_ON_ERROR: bool = True diff --git a/guppy/gtypes.py b/guppylang/gtypes.py similarity index 97% rename from guppy/gtypes.py rename to guppylang/gtypes.py index 66290503..04d1c873 100644 --- a/guppy/gtypes.py +++ b/guppylang/gtypes.py @@ -9,11 +9,11 @@ Literal, ) -import guppy.hugr.tys as tys -from guppy.ast_util import AstNode +import guppylang.hugr.tys as tys +from guppylang.ast_util import AstNode if TYPE_CHECKING: - from guppy.checker.core import Globals + from guppylang.checker.core import Globals Subst = dict["ExistentialTypeVar", "GuppyType"] @@ -36,7 +36,7 @@ def __post_init__(self) -> None: # Make sure that we don't have higher-rank polymorphic types for arg in self.type_args: if isinstance(arg, FunctionType) and arg.quantified: - from guppy.error import InternalGuppyError + from guppylang.error import InternalGuppyError raise InternalGuppyError( "Tried to construct a higher-rank polymorphic type!" @@ -157,7 +157,7 @@ def __hash__(self) -> int: return self.id def to_hugr(self) -> tys.Type: - from guppy.error import InternalGuppyError + from guppylang.error import InternalGuppyError raise InternalGuppyError("Tried to convert free type variable to Hugr") @@ -260,7 +260,7 @@ class TupleType(GuppyType): @staticmethod def build(*args: GuppyType, node: AstNode | None = None) -> GuppyType: - from guppy.error import GuppyError + from guppylang.error import GuppyError # TODO: Parse empty tuples via `tuple[()]` if len(args) == 0: @@ -334,7 +334,7 @@ class ListType(GuppyType): @staticmethod def build(*args: GuppyType, node: AstNode | None = None) -> GuppyType: - from guppy.error import GuppyError + from guppylang.error import GuppyError if len(args) == 0: raise GuppyError("Missing type parameter for generic type `list`", node) @@ -376,7 +376,7 @@ class LinstType(GuppyType): @staticmethod def build(*args: GuppyType, node: AstNode | None = None) -> GuppyType: - from guppy.error import GuppyError + from guppylang.error import GuppyError if len(args) == 0: raise GuppyError("Missing type parameter for generic type `linst`", node) @@ -422,7 +422,7 @@ class NoneType(GuppyType): @staticmethod def build(*args: GuppyType, node: AstNode | None = None) -> GuppyType: if len(args) > 0: - from guppy.error import GuppyError + from guppylang.error import GuppyError raise GuppyError("Type `None` is not generic", node) return NoneType() @@ -458,7 +458,7 @@ def __init__(self) -> None: @staticmethod def build(*args: GuppyType, node: AstNode | None = None) -> GuppyType: if len(args) > 0: - from guppy.error import GuppyError + from guppylang.error import GuppyError raise GuppyError("Type `bool` is not generic", node) return BoolType() @@ -554,7 +554,7 @@ def type_from_ast( type_var_mapping: dict[str, BoundTypeVar] | None = None, ) -> GuppyType: """Turns an AST expression into a Guppy type.""" - from guppy.error import GuppyError + from guppylang.error import GuppyError if isinstance(node, ast.Name): x = node.id diff --git a/guppy/hugr/__init__.py b/guppylang/hugr/__init__.py similarity index 100% rename from guppy/hugr/__init__.py rename to guppylang/hugr/__init__.py diff --git a/guppy/hugr/hugr.py b/guppylang/hugr/hugr.py similarity index 99% rename from guppy/hugr/hugr.py rename to guppylang/hugr/hugr.py index ab0e2b1a..9059c3c7 100644 --- a/guppy/hugr/hugr.py +++ b/guppylang/hugr/hugr.py @@ -7,9 +7,9 @@ import networkx as nx # type: ignore[import-untyped] -import guppy.hugr.ops as ops -import guppy.hugr.raw as raw -from guppy.gtypes import ( +import guppylang.hugr.ops as ops +import guppylang.hugr.raw as raw +from guppylang.gtypes import ( FunctionType, GuppyType, Inst, @@ -18,7 +18,7 @@ row_to_type, type_to_row, ) -from guppy.hugr import tys, val +from guppylang.hugr import tys, val NodeIdx = int PortOffset = int diff --git a/guppy/hugr/ops.py b/guppylang/hugr/ops.py similarity index 99% rename from guppy/hugr/ops.py rename to guppylang/hugr/ops.py index 7d60a6d8..6bb0d067 100644 --- a/guppy/hugr/ops.py +++ b/guppylang/hugr/ops.py @@ -6,7 +6,7 @@ from pydantic import BaseModel, Field from typing_extensions import TypeAliasType -import guppy.hugr.tys as tys +import guppylang.hugr.tys as tys from .tys import ( ExtensionId, diff --git a/guppy/hugr/raw.py b/guppylang/hugr/raw.py similarity index 94% rename from guppy/hugr/raw.py rename to guppylang/hugr/raw.py index cefd842f..12592672 100644 --- a/guppy/hugr/raw.py +++ b/guppylang/hugr/raw.py @@ -3,7 +3,7 @@ import ormsgpack from pydantic import BaseModel -from guppy.hugr.ops import NodeID, OpType +from guppylang.hugr.ops import NodeID, OpType Port = tuple[NodeID, int | None] # (node, offset) Edge = tuple[Port, Port] diff --git a/guppy/hugr/tys.py b/guppylang/hugr/tys.py similarity index 100% rename from guppy/hugr/tys.py rename to guppylang/hugr/tys.py diff --git a/guppy/hugr/val.py b/guppylang/hugr/val.py similarity index 100% rename from guppy/hugr/val.py rename to guppylang/hugr/val.py diff --git a/guppy/hugr/visualise.py b/guppylang/hugr/visualise.py similarity index 97% rename from guppy/hugr/visualise.py rename to guppylang/hugr/visualise.py index 686eeacb..08375a4f 100644 --- a/guppy/hugr/visualise.py +++ b/guppylang/hugr/visualise.py @@ -5,16 +5,16 @@ import graphviz as gv # type: ignore[import-untyped] -from guppy.cfg.analysis import ( +from guppylang.cfg.analysis import ( DefAssignmentDomain, LivenessDomain, MaybeAssignmentDomain, ) -from guppy.cfg.bb import BB -from guppy.hugr.hugr import Hugr, InPort, Node, OutPort, OutPortV +from guppylang.cfg.bb import BB +from guppylang.hugr.hugr import Hugr, InPort, Node, OutPort, OutPortV if TYPE_CHECKING: - from guppy.cfg.cfg import CFG + from guppylang.cfg.cfg import CFG # old palettte: https://colorhunt.co/palette/343a407952b3ffc107e1e8eb # _COLOURS = { diff --git a/guppy/module.py b/guppylang/module.py similarity index 94% rename from guppy/module.py rename to guppylang/module.py index 65c9a81d..d24d1cd7 100644 --- a/guppy/module.py +++ b/guppylang/module.py @@ -6,16 +6,19 @@ from types import ModuleType from typing import Any, Union -from guppy.ast_util import AstNode, annotate_location -from guppy.checker.core import Globals, PyScope, TypeVarDecl, qualified_name -from guppy.checker.func_checker import DefinedFunction, check_global_func_def -from guppy.compiler.core import CompiledGlobals -from guppy.compiler.func_compiler import CompiledFunctionDef, compile_global_func_def -from guppy.custom import CustomFunction -from guppy.declared import DeclaredFunction -from guppy.error import GuppyError, pretty_errors -from guppy.gtypes import GuppyType -from guppy.hugr.hugr import Hugr +from guppylang.ast_util import AstNode, annotate_location +from guppylang.checker.core import Globals, PyScope, TypeVarDecl, qualified_name +from guppylang.checker.func_checker import DefinedFunction, check_global_func_def +from guppylang.compiler.core import CompiledGlobals +from guppylang.compiler.func_compiler import ( + CompiledFunctionDef, + compile_global_func_def, +) +from guppylang.custom import CustomFunction +from guppylang.declared import DeclaredFunction +from guppylang.error import GuppyError, pretty_errors +from guppylang.gtypes import GuppyType +from guppylang.hugr.hugr import Hugr PyFunc = Callable[..., Any] PyFuncDefOrDecl = tuple[bool, PyFunc] @@ -62,7 +65,7 @@ def __init__(self, name: str, import_builtins: bool = True): # Import builtin module if import_builtins: - import guppy.prelude.builtins as builtins + import guppylang.prelude.builtins as builtins self.load(builtins) diff --git a/guppy/nodes.py b/guppylang/nodes.py similarity index 94% rename from guppy/nodes.py rename to guppylang/nodes.py index 2fd72a8a..908fe55f 100644 --- a/guppy/nodes.py +++ b/guppylang/nodes.py @@ -4,12 +4,12 @@ from collections.abc import Mapping, Sequence from typing import TYPE_CHECKING, Any -from guppy.gtypes import FunctionType, GuppyType, Inst +from guppylang.gtypes import FunctionType, GuppyType, Inst if TYPE_CHECKING: - from guppy.cfg.cfg import CFG - from guppy.checker.cfg_checker import CheckedCFG - from guppy.checker.core import CallableVariable, Variable + from guppylang.cfg.cfg import CFG + from guppylang.checker.cfg_checker import CheckedCFG + from guppylang.checker.core import CallableVariable, Variable class LocalName(ast.Name): diff --git a/guppy/prelude/__init__.py b/guppylang/prelude/__init__.py similarity index 100% rename from guppy/prelude/__init__.py rename to guppylang/prelude/__init__.py diff --git a/guppy/prelude/_internal.py b/guppylang/prelude/_internal.py similarity index 95% rename from guppy/prelude/_internal.py rename to guppylang/prelude/_internal.py index 196b7663..e98e40ef 100644 --- a/guppy/prelude/_internal.py +++ b/guppylang/prelude/_internal.py @@ -3,20 +3,20 @@ from pydantic import BaseModel -from guppy.ast_util import AstNode, get_type, with_loc, with_type -from guppy.checker.core import CallableVariable, Context -from guppy.checker.expr_checker import ExprSynthesizer, check_num_args -from guppy.custom import ( +from guppylang.ast_util import AstNode, get_type, with_loc, with_type +from guppylang.checker.core import CallableVariable, Context +from guppylang.checker.expr_checker import ExprSynthesizer, check_num_args +from guppylang.custom import ( CustomCallChecker, CustomCallCompiler, CustomFunction, DefaultCallChecker, ) -from guppy.error import GuppyError, GuppyTypeError -from guppy.gtypes import BoolType, FunctionType, GuppyType, Subst, unify -from guppy.hugr import ops, tys, val -from guppy.hugr.hugr import OutPortV -from guppy.nodes import GlobalCall +from guppylang.error import GuppyError, GuppyTypeError +from guppylang.gtypes import BoolType, FunctionType, GuppyType, Subst, unify +from guppylang.hugr import ops, tys, val +from guppylang.hugr.hugr import OutPortV +from guppylang.nodes import GlobalCall INT_WIDTH = 6 # 2^6 = 64 bit diff --git a/guppy/prelude/builtins.py b/guppylang/prelude/builtins.py similarity index 98% rename from guppy/prelude/builtins.py rename to guppylang/prelude/builtins.py index 563aeb2f..37fdc270 100644 --- a/guppy/prelude/builtins.py +++ b/guppylang/prelude/builtins.py @@ -2,12 +2,12 @@ # mypy: disable-error-code="empty-body, misc, override, valid-type, no-untyped-def" -from guppy.custom import DefaultCallChecker, NoopCompiler -from guppy.decorator import guppy -from guppy.gtypes import BoolType, LinstType, ListType -from guppy.hugr import ops, tys -from guppy.module import GuppyModule -from guppy.prelude._internal import ( +from guppylang.custom import DefaultCallChecker, NoopCompiler +from guppylang.decorator import guppy +from guppylang.gtypes import BoolType, LinstType, ListType +from guppylang.hugr import ops, tys +from guppylang.module import GuppyModule +from guppylang.prelude._internal import ( CallableChecker, CoercingChecker, DunderChecker, diff --git a/guppy/prelude/quantum.py b/guppylang/prelude/quantum.py similarity index 88% rename from guppy/prelude/quantum.py rename to guppylang/prelude/quantum.py index dcfc794b..eb3d395f 100644 --- a/guppy/prelude/quantum.py +++ b/guppylang/prelude/quantum.py @@ -2,10 +2,10 @@ # mypy: disable-error-code=empty-body -from guppy.decorator import guppy -from guppy.hugr import ops, tys -from guppy.hugr.tys import TypeBound -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.hugr import ops, tys +from guppylang.hugr.tys import TypeBound +from guppylang.module import GuppyModule quantum = GuppyModule("quantum") diff --git a/poetry.lock b/poetry.lock index 7616bebb..3fe7ff53 100644 --- a/poetry.lock +++ b/poetry.lock @@ -542,28 +542,28 @@ files = [ [[package]] name = "ruff" -version = "0.1.12" +version = "0.1.13" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.1.12-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:544038693543c11edc56bb94a9875df2dc249e3616f90c15964c720dcccf0745"}, - {file = "ruff-0.1.12-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:8a0e3ef6299c4eab75a7740730e4b4bd4a36e0bd8102ded01553403cad088fd4"}, - {file = "ruff-0.1.12-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:47f6d939461e3273f10f4cd059fd0b83c249d73f1736032fffbac83a62939395"}, - {file = "ruff-0.1.12-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:25be18abc1fc3f3d3fb55855c41ed5d52063316defde202f413493bb3888218c"}, - {file = "ruff-0.1.12-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d41e9f100b50526d80b076fc9c103c729387ff3f10f63606ed1038c30a372a40"}, - {file = "ruff-0.1.12-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:472a0548738d4711549c7874b43fab61aacafb1fede29c5232d4cfb8e2d13f69"}, - {file = "ruff-0.1.12-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:46685ef2f106b827705df876d38617741ed4f858bbdbc0817f94476c45ab6669"}, - {file = "ruff-0.1.12-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cf6073749c70b616d7929897b14824ec6713a6c3a8195dfd2ffdcc66594d880c"}, - {file = "ruff-0.1.12-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4bdf26e5a2efab4c3aaf6b61648ea47a525dc12775810a85c285dc9ca03e5ac0"}, - {file = "ruff-0.1.12-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b631c6a95e4b6d5c4299e599067b5a89f5b18e2f2d9a6c22b879b3c4b077c96e"}, - {file = "ruff-0.1.12-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:f193f460e231e63af5fc7516897cf5ab257cbda72ae83cf9a654f1c80c3b758a"}, - {file = "ruff-0.1.12-py3-none-musllinux_1_2_i686.whl", hash = "sha256:718523c3a0b787590511f212d30cc9b194228ef369c8bdd72acd1282cc27c468"}, - {file = "ruff-0.1.12-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:1c49e826de55d81a6ef93808b760925e492bad7cc470aaa114a3be158b2c7f99"}, - {file = "ruff-0.1.12-py3-none-win32.whl", hash = "sha256:fbb1c002eeacb60161e51d77b2274c968656599477a1c8c65066953276e8ee2b"}, - {file = "ruff-0.1.12-py3-none-win_amd64.whl", hash = "sha256:7fe06ba77e5b7b78db1d058478c47176810f69bb5be7c1b0d06876af59198203"}, - {file = "ruff-0.1.12-py3-none-win_arm64.whl", hash = "sha256:bb29f8e3e6c95024902eaec5a9ce1fd5ac4e77f4594f4554e67fbb0f6d9a2f37"}, - {file = "ruff-0.1.12.tar.gz", hash = "sha256:97189f38c655e573f6bea0d12e9f18aad5539fd08ab50651449450999f45383a"}, + {file = "ruff-0.1.13-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:e3fd36e0d48aeac672aa850045e784673449ce619afc12823ea7868fcc41d8ba"}, + {file = "ruff-0.1.13-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:9fb6b3b86450d4ec6a6732f9f60c4406061b6851c4b29f944f8c9d91c3611c7a"}, + {file = "ruff-0.1.13-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b13ba5d7156daaf3fd08b6b993360a96060500aca7e307d95ecbc5bb47a69296"}, + {file = "ruff-0.1.13-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9ebb40442f7b531e136d334ef0851412410061e65d61ca8ce90d894a094feb22"}, + {file = "ruff-0.1.13-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:226b517f42d59a543d6383cfe03cccf0091e3e0ed1b856c6824be03d2a75d3b6"}, + {file = "ruff-0.1.13-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:5f0312ba1061e9b8c724e9a702d3c8621e3c6e6c2c9bd862550ab2951ac75c16"}, + {file = "ruff-0.1.13-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2f59bcf5217c661254bd6bc42d65a6fd1a8b80c48763cb5c2293295babd945dd"}, + {file = "ruff-0.1.13-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e6894b00495e00c27b6ba61af1fc666f17de6140345e5ef27dd6e08fb987259d"}, + {file = "ruff-0.1.13-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9a1600942485c6e66119da294c6294856b5c86fd6df591ce293e4a4cc8e72989"}, + {file = "ruff-0.1.13-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:ee3febce7863e231a467f90e681d3d89210b900d49ce88723ce052c8761be8c7"}, + {file = "ruff-0.1.13-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:dcaab50e278ff497ee4d1fe69b29ca0a9a47cd954bb17963628fa417933c6eb1"}, + {file = "ruff-0.1.13-py3-none-musllinux_1_2_i686.whl", hash = "sha256:f57de973de4edef3ad3044d6a50c02ad9fc2dff0d88587f25f1a48e3f72edf5e"}, + {file = "ruff-0.1.13-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:7a36fa90eb12208272a858475ec43ac811ac37e91ef868759770b71bdabe27b6"}, + {file = "ruff-0.1.13-py3-none-win32.whl", hash = "sha256:a623349a505ff768dad6bd57087e2461be8db58305ebd5577bd0e98631f9ae69"}, + {file = "ruff-0.1.13-py3-none-win_amd64.whl", hash = "sha256:f988746e3c3982bea7f824c8fa318ce7f538c4dfefec99cd09c8770bd33e6539"}, + {file = "ruff-0.1.13-py3-none-win_arm64.whl", hash = "sha256:6bbbc3042075871ec17f28864808540a26f0f79a4478c357d3e3d2284e832998"}, + {file = "ruff-0.1.13.tar.gz", hash = "sha256:e261f1baed6291f434ffb1d5c6bd8051d1c2a26958072d38dfbec39b3dda7352"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 9818cbea..0b0d64f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "guppy" +name = "guppylang" version = "0.1.0" description = "" authors = ["Mark Koch "] diff --git a/scripts/generate_schema.py b/scripts/generate_schema.py index fb03b89e..38f70886 100644 --- a/scripts/generate_schema.py +++ b/scripts/generate_schema.py @@ -6,7 +6,7 @@ from pydantic import TypeAdapter -from guppy.hugr.raw import RawHugr +from guppylang.hugr.raw import RawHugr if __name__ == "__main__": out_dir = Path(sys.argv[-1]) diff --git a/tests/error/comprehension_errors/capture1.py b/tests/error/comprehension_errors/capture1.py index 9af5781a..bb72e2b0 100644 --- a/tests/error/comprehension_errors/capture1.py +++ b/tests/error/comprehension_errors/capture1.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/capture2.py b/tests/error/comprehension_errors/capture2.py index 27970631..8c95712d 100644 --- a/tests/error/comprehension_errors/capture2.py +++ b/tests/error/comprehension_errors/capture2.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/guarded1.py b/tests/error/comprehension_errors/guarded1.py index ecb264a9..300c48a3 100644 --- a/tests/error/comprehension_errors/guarded1.py +++ b/tests/error/comprehension_errors/guarded1.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/guarded2.py b/tests/error/comprehension_errors/guarded2.py index 5413b8c0..3d079f0e 100644 --- a/tests/error/comprehension_errors/guarded2.py +++ b/tests/error/comprehension_errors/guarded2.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/illegal_short_circuit.py b/tests/error/comprehension_errors/illegal_short_circuit.py index dfd0b0a2..f54d5209 100644 --- a/tests/error/comprehension_errors/illegal_short_circuit.py +++ b/tests/error/comprehension_errors/illegal_short_circuit.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/comprehension_errors/illegal_ternary.py b/tests/error/comprehension_errors/illegal_ternary.py index 3b587938..7c1a7715 100644 --- a/tests/error/comprehension_errors/illegal_ternary.py +++ b/tests/error/comprehension_errors/illegal_ternary.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/comprehension_errors/illegal_walrus.py b/tests/error/comprehension_errors/illegal_walrus.py index d95a345b..cf252b96 100644 --- a/tests/error/comprehension_errors/illegal_walrus.py +++ b/tests/error/comprehension_errors/illegal_walrus.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/comprehension_errors/multi_use1.py b/tests/error/comprehension_errors/multi_use1.py index d80f6a38..e13fa34b 100644 --- a/tests/error/comprehension_errors/multi_use1.py +++ b/tests/error/comprehension_errors/multi_use1.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/multi_use2.py b/tests/error/comprehension_errors/multi_use2.py index 9dc78ba7..edf42b95 100644 --- a/tests/error/comprehension_errors/multi_use2.py +++ b/tests/error/comprehension_errors/multi_use2.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/multi_use3.py b/tests/error/comprehension_errors/multi_use3.py index cdf10bc4..6bc493ee 100644 --- a/tests/error/comprehension_errors/multi_use3.py +++ b/tests/error/comprehension_errors/multi_use3.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/not_used.py b/tests/error/comprehension_errors/not_used.py index c5854103..bdfa6337 100644 --- a/tests/error/comprehension_errors/not_used.py +++ b/tests/error/comprehension_errors/not_used.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/pattern_override1.py b/tests/error/comprehension_errors/pattern_override1.py index 0a46bed3..24e689fa 100644 --- a/tests/error/comprehension_errors/pattern_override1.py +++ b/tests/error/comprehension_errors/pattern_override1.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/pattern_override2.py b/tests/error/comprehension_errors/pattern_override2.py index b684e202..ec280ddd 100644 --- a/tests/error/comprehension_errors/pattern_override2.py +++ b/tests/error/comprehension_errors/pattern_override2.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/used_twice1.py b/tests/error/comprehension_errors/used_twice1.py index 920ae354..83f7a72a 100644 --- a/tests/error/comprehension_errors/used_twice1.py +++ b/tests/error/comprehension_errors/used_twice1.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/used_twice2.py b/tests/error/comprehension_errors/used_twice2.py index 8d2ffbe1..07fdc5b8 100644 --- a/tests/error/comprehension_errors/used_twice2.py +++ b/tests/error/comprehension_errors/used_twice2.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/comprehension_errors/used_twice3.py b/tests/error/comprehension_errors/used_twice3.py index 784070e0..fd837ef6 100644 --- a/tests/error/comprehension_errors/used_twice3.py +++ b/tests/error/comprehension_errors/used_twice3.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/errors_on_usage/and_not_defined.py b/tests/error/errors_on_usage/and_not_defined.py index 0f29fa58..85d451ae 100644 --- a/tests/error/errors_on_usage/and_not_defined.py +++ b/tests/error/errors_on_usage/and_not_defined.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/else_expr_not_defined.py b/tests/error/errors_on_usage/else_expr_not_defined.py index 04aec300..b462848b 100644 --- a/tests/error/errors_on_usage/else_expr_not_defined.py +++ b/tests/error/errors_on_usage/else_expr_not_defined.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/else_expr_type_change.py b/tests/error/errors_on_usage/else_expr_type_change.py index 0f77ff1e..c0aecc04 100644 --- a/tests/error/errors_on_usage/else_expr_type_change.py +++ b/tests/error/errors_on_usage/else_expr_type_change.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/else_not_defined.py b/tests/error/errors_on_usage/else_not_defined.py index a86d6cec..f54ebeae 100644 --- a/tests/error/errors_on_usage/else_not_defined.py +++ b/tests/error/errors_on_usage/else_not_defined.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/else_not_defined_functional.py b/tests/error/errors_on_usage/else_not_defined_functional.py index eac88f1b..c5a23fcf 100644 --- a/tests/error/errors_on_usage/else_not_defined_functional.py +++ b/tests/error/errors_on_usage/else_not_defined_functional.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/else_type_change.py b/tests/error/errors_on_usage/else_type_change.py index ac3638a5..0f576a8b 100644 --- a/tests/error/errors_on_usage/else_type_change.py +++ b/tests/error/errors_on_usage/else_type_change.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/else_type_change_functional.py b/tests/error/errors_on_usage/else_type_change_functional.py index 34a7a61d..932885de 100644 --- a/tests/error/errors_on_usage/else_type_change_functional.py +++ b/tests/error/errors_on_usage/else_type_change_functional.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/for_new_var.py b/tests/error/errors_on_usage/for_new_var.py index 1054ad61..f3c29ab1 100644 --- a/tests/error/errors_on_usage/for_new_var.py +++ b/tests/error/errors_on_usage/for_new_var.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/for_target.py b/tests/error/errors_on_usage/for_target.py index fe4c0eb1..b2876dc2 100644 --- a/tests/error/errors_on_usage/for_target.py +++ b/tests/error/errors_on_usage/for_target.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/for_target_type_change.py b/tests/error/errors_on_usage/for_target_type_change.py index 7bc2b0b3..4f5f3b08 100644 --- a/tests/error/errors_on_usage/for_target_type_change.py +++ b/tests/error/errors_on_usage/for_target_type_change.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/for_type_change.py b/tests/error/errors_on_usage/for_type_change.py index 96f4017c..e4be618d 100644 --- a/tests/error/errors_on_usage/for_type_change.py +++ b/tests/error/errors_on_usage/for_type_change.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/if_different_types.py b/tests/error/errors_on_usage/if_different_types.py index 5a871696..401d18f5 100644 --- a/tests/error/errors_on_usage/if_different_types.py +++ b/tests/error/errors_on_usage/if_different_types.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/if_different_types_functional.py b/tests/error/errors_on_usage/if_different_types_functional.py index efe65c51..dc89271c 100644 --- a/tests/error/errors_on_usage/if_different_types_functional.py +++ b/tests/error/errors_on_usage/if_different_types_functional.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/if_expr_cond_type_change.py b/tests/error/errors_on_usage/if_expr_cond_type_change.py index 46af4085..24f818e8 100644 --- a/tests/error/errors_on_usage/if_expr_cond_type_change.py +++ b/tests/error/errors_on_usage/if_expr_cond_type_change.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/if_expr_not_defined.py b/tests/error/errors_on_usage/if_expr_not_defined.py index b8b7f21f..b2565829 100644 --- a/tests/error/errors_on_usage/if_expr_not_defined.py +++ b/tests/error/errors_on_usage/if_expr_not_defined.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/if_expr_type_change.py b/tests/error/errors_on_usage/if_expr_type_change.py index 96e57658..3a62c51f 100644 --- a/tests/error/errors_on_usage/if_expr_type_change.py +++ b/tests/error/errors_on_usage/if_expr_type_change.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/if_expr_type_conflict.py b/tests/error/errors_on_usage/if_expr_type_conflict.py index f2e921da..65cc1589 100644 --- a/tests/error/errors_on_usage/if_expr_type_conflict.py +++ b/tests/error/errors_on_usage/if_expr_type_conflict.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/if_not_defined.py b/tests/error/errors_on_usage/if_not_defined.py index f613e168..8755c617 100644 --- a/tests/error/errors_on_usage/if_not_defined.py +++ b/tests/error/errors_on_usage/if_not_defined.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/if_not_defined_functional.py b/tests/error/errors_on_usage/if_not_defined_functional.py index 47aff403..ffccaac1 100644 --- a/tests/error/errors_on_usage/if_not_defined_functional.py +++ b/tests/error/errors_on_usage/if_not_defined_functional.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/if_type_change.py b/tests/error/errors_on_usage/if_type_change.py index 1e688b5b..7139a97a 100644 --- a/tests/error/errors_on_usage/if_type_change.py +++ b/tests/error/errors_on_usage/if_type_change.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/if_type_change_functional.py b/tests/error/errors_on_usage/if_type_change_functional.py index 58ed7baa..791bfae7 100644 --- a/tests/error/errors_on_usage/if_type_change_functional.py +++ b/tests/error/errors_on_usage/if_type_change_functional.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/or_not_defined.py b/tests/error/errors_on_usage/or_not_defined.py index 2435f624..6e91c33c 100644 --- a/tests/error/errors_on_usage/or_not_defined.py +++ b/tests/error/errors_on_usage/or_not_defined.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/while_new_var.py b/tests/error/errors_on_usage/while_new_var.py index 28a63a58..afd32701 100644 --- a/tests/error/errors_on_usage/while_new_var.py +++ b/tests/error/errors_on_usage/while_new_var.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/while_new_var_functional.py b/tests/error/errors_on_usage/while_new_var_functional.py index d596834c..6328b450 100644 --- a/tests/error/errors_on_usage/while_new_var_functional.py +++ b/tests/error/errors_on_usage/while_new_var_functional.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/while_type_change.py b/tests/error/errors_on_usage/while_type_change.py index c8e565b1..be89e06e 100644 --- a/tests/error/errors_on_usage/while_type_change.py +++ b/tests/error/errors_on_usage/while_type_change.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/errors_on_usage/while_type_change_functional.py b/tests/error/errors_on_usage/while_type_change_functional.py index 343e4433..7992abea 100644 --- a/tests/error/errors_on_usage/while_type_change_functional.py +++ b/tests/error/errors_on_usage/while_type_change_functional.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/iter_errors/end_missing.py b/tests/error/iter_errors/end_missing.py index 33eafe12..b4dadc23 100644 --- a/tests/error/iter_errors/end_missing.py +++ b/tests/error/iter_errors/end_missing.py @@ -1,6 +1,6 @@ -from guppy.decorator import guppy -from guppy.hugr import tys -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.hugr import tys +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/iter_errors/end_wrong_type.py b/tests/error/iter_errors/end_wrong_type.py index 82568d2b..547117d9 100644 --- a/tests/error/iter_errors/end_wrong_type.py +++ b/tests/error/iter_errors/end_wrong_type.py @@ -1,6 +1,6 @@ -from guppy.decorator import guppy -from guppy.hugr import tys -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.hugr import tys +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/iter_errors/hasnext_missing.py b/tests/error/iter_errors/hasnext_missing.py index 68b11c7a..1bf7e2a8 100644 --- a/tests/error/iter_errors/hasnext_missing.py +++ b/tests/error/iter_errors/hasnext_missing.py @@ -1,6 +1,6 @@ -from guppy.decorator import guppy -from guppy.hugr import tys -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.hugr import tys +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/iter_errors/hasnext_wrong_type.py b/tests/error/iter_errors/hasnext_wrong_type.py index f276f1b7..f9095b39 100644 --- a/tests/error/iter_errors/hasnext_wrong_type.py +++ b/tests/error/iter_errors/hasnext_wrong_type.py @@ -1,6 +1,6 @@ -from guppy.decorator import guppy -from guppy.hugr import tys -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.hugr import tys +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/iter_errors/iter_missing.py b/tests/error/iter_errors/iter_missing.py index de04fdb6..10f6c57b 100644 --- a/tests/error/iter_errors/iter_missing.py +++ b/tests/error/iter_errors/iter_missing.py @@ -1,6 +1,6 @@ -from guppy.decorator import guppy -from guppy.hugr import tys -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.hugr import tys +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/iter_errors/iter_wrong_type.py b/tests/error/iter_errors/iter_wrong_type.py index 39a34163..fadfb1ab 100644 --- a/tests/error/iter_errors/iter_wrong_type.py +++ b/tests/error/iter_errors/iter_wrong_type.py @@ -1,6 +1,6 @@ -from guppy.decorator import guppy -from guppy.hugr import tys -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.hugr import tys +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/iter_errors/next_missing.py b/tests/error/iter_errors/next_missing.py index 8142d1f6..f06cb732 100644 --- a/tests/error/iter_errors/next_missing.py +++ b/tests/error/iter_errors/next_missing.py @@ -1,6 +1,6 @@ -from guppy.decorator import guppy -from guppy.hugr import tys -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.hugr import tys +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/iter_errors/next_wrong_type.py b/tests/error/iter_errors/next_wrong_type.py index 0d5ae680..77184585 100644 --- a/tests/error/iter_errors/next_wrong_type.py +++ b/tests/error/iter_errors/next_wrong_type.py @@ -1,6 +1,6 @@ -from guppy.decorator import guppy -from guppy.hugr import tys -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.hugr import tys +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/linear_errors/branch_use.py b/tests/error/linear_errors/branch_use.py index 9ba256c1..de233c7d 100644 --- a/tests/error/linear_errors/branch_use.py +++ b/tests/error/linear_errors/branch_use.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/break_unused.py b/tests/error/linear_errors/break_unused.py index b66d2ba4..3c7f0060 100644 --- a/tests/error/linear_errors/break_unused.py +++ b/tests/error/linear_errors/break_unused.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/continue_unused.py b/tests/error/linear_errors/continue_unused.py index 4e6194f8..e31dabff 100644 --- a/tests/error/linear_errors/continue_unused.py +++ b/tests/error/linear_errors/continue_unused.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/copy.py b/tests/error/linear_errors/copy.py index 1f726112..d8a07163 100644 --- a/tests/error/linear_errors/copy.py +++ b/tests/error/linear_errors/copy.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/for_break.py b/tests/error/linear_errors/for_break.py index 3f5f6cff..36e7a241 100644 --- a/tests/error/linear_errors/for_break.py +++ b/tests/error/linear_errors/for_break.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/linear_errors/for_return.py b/tests/error/linear_errors/for_return.py index 05982f9c..de9e44a9 100644 --- a/tests/error/linear_errors/for_return.py +++ b/tests/error/linear_errors/for_return.py @@ -1,8 +1,8 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit -from guppy.prelude.builtins import linst +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit +from guppylang.prelude.builtins import linst module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/linear_errors/if_both_unused.py b/tests/error/linear_errors/if_both_unused.py index 4ce0fe88..da4fafd3 100644 --- a/tests/error/linear_errors/if_both_unused.py +++ b/tests/error/linear_errors/if_both_unused.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/if_both_unused_reassign.py b/tests/error/linear_errors/if_both_unused_reassign.py index dcd83e66..11472b9a 100644 --- a/tests/error/linear_errors/if_both_unused_reassign.py +++ b/tests/error/linear_errors/if_both_unused_reassign.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/reassign_unused.py b/tests/error/linear_errors/reassign_unused.py index 7a936455..85a0e050 100644 --- a/tests/error/linear_errors/reassign_unused.py +++ b/tests/error/linear_errors/reassign_unused.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/reassign_unused_tuple.py b/tests/error/linear_errors/reassign_unused_tuple.py index 162e4163..b4a23660 100644 --- a/tests/error/linear_errors/reassign_unused_tuple.py +++ b/tests/error/linear_errors/reassign_unused_tuple.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/unused.py b/tests/error/linear_errors/unused.py index a22b8f16..0f3bb9dd 100644 --- a/tests/error/linear_errors/unused.py +++ b/tests/error/linear_errors/unused.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/unused_expr.py b/tests/error/linear_errors/unused_expr.py index 6ad60a82..57547c23 100644 --- a/tests/error/linear_errors/unused_expr.py +++ b/tests/error/linear_errors/unused_expr.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/linear_errors/unused_same_block.py b/tests/error/linear_errors/unused_same_block.py index 55031f6b..bbd32fc3 100644 --- a/tests/error/linear_errors/unused_same_block.py +++ b/tests/error/linear_errors/unused_same_block.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/misc_errors/arg_not_annotated.py b/tests/error/misc_errors/arg_not_annotated.py index 503393af..8360f569 100644 --- a/tests/error/misc_errors/arg_not_annotated.py +++ b/tests/error/misc_errors/arg_not_annotated.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/functional_break.py b/tests/error/misc_errors/functional_break.py index 2b03e316..901330a3 100644 --- a/tests/error/misc_errors/functional_break.py +++ b/tests/error/misc_errors/functional_break.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/functional_continue.py b/tests/error/misc_errors/functional_continue.py index eced5d96..8df29c36 100644 --- a/tests/error/misc_errors/functional_continue.py +++ b/tests/error/misc_errors/functional_continue.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/functional_return.py b/tests/error/misc_errors/functional_return.py index 1821020e..7072e37b 100644 --- a/tests/error/misc_errors/functional_return.py +++ b/tests/error/misc_errors/functional_return.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/list_linear.py b/tests/error/misc_errors/list_linear.py index 5b377e53..01ee3369 100644 --- a/tests/error/misc_errors/list_linear.py +++ b/tests/error/misc_errors/list_linear.py @@ -1,8 +1,8 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.prelude.quantum import Qubit +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.prelude.quantum import Qubit -import guppy.prelude.quantum as quantum +import guppylang.prelude.quantum as quantum module = GuppyModule("test") diff --git a/tests/error/misc_errors/nested_functional.py b/tests/error/misc_errors/nested_functional.py index 7094903c..95c194fb 100644 --- a/tests/error/misc_errors/nested_functional.py +++ b/tests/error/misc_errors/nested_functional.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/no_return.py b/tests/error/misc_errors/no_return.py index 3f70926a..705bf071 100644 --- a/tests/error/misc_errors/no_return.py +++ b/tests/error/misc_errors/no_return.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/return_not_annotated.py b/tests/error/misc_errors/return_not_annotated.py index 43ce1a8c..f275e3f0 100644 --- a/tests/error/misc_errors/return_not_annotated.py +++ b/tests/error/misc_errors/return_not_annotated.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/return_not_annotated_none1.py b/tests/error/misc_errors/return_not_annotated_none1.py index b85e6de1..7346dfff 100644 --- a/tests/error/misc_errors/return_not_annotated_none1.py +++ b/tests/error/misc_errors/return_not_annotated_none1.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/return_not_annotated_none2.py b/tests/error/misc_errors/return_not_annotated_none2.py index ffd09c8c..1d4d5d76 100644 --- a/tests/error/misc_errors/return_not_annotated_none2.py +++ b/tests/error/misc_errors/return_not_annotated_none2.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/undefined_var.py b/tests/error/misc_errors/undefined_var.py index 6ff8e942..4640a9c1 100644 --- a/tests/error/misc_errors/undefined_var.py +++ b/tests/error/misc_errors/undefined_var.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/unreachable_1.py b/tests/error/misc_errors/unreachable_1.py index bf4948e5..bdaf8534 100644 --- a/tests/error/misc_errors/unreachable_1.py +++ b/tests/error/misc_errors/unreachable_1.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/unreachable_2.py b/tests/error/misc_errors/unreachable_2.py index 1a9722fd..15f50a03 100644 --- a/tests/error/misc_errors/unreachable_2.py +++ b/tests/error/misc_errors/unreachable_2.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/unreachable_3.py b/tests/error/misc_errors/unreachable_3.py index 9bf3265e..597511ec 100644 --- a/tests/error/misc_errors/unreachable_3.py +++ b/tests/error/misc_errors/unreachable_3.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/unreachable_4.py b/tests/error/misc_errors/unreachable_4.py index 076c4e68..78dee1c1 100644 --- a/tests/error/misc_errors/unreachable_4.py +++ b/tests/error/misc_errors/unreachable_4.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/misc_errors/unreachable_5.py b/tests/error/misc_errors/unreachable_5.py index ba3e5740..dcd27199 100644 --- a/tests/error/misc_errors/unreachable_5.py +++ b/tests/error/misc_errors/unreachable_5.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/nested_errors/different_types_if.py b/tests/error/nested_errors/different_types_if.py index 7641d715..7e2d5176 100644 --- a/tests/error/nested_errors/different_types_if.py +++ b/tests/error/nested_errors/different_types_if.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/nested_errors/linear_capture.py b/tests/error/nested_errors/linear_capture.py index 2c89d1fc..4385d236 100644 --- a/tests/error/nested_errors/linear_capture.py +++ b/tests/error/nested_errors/linear_capture.py @@ -1,7 +1,7 @@ -import guppy.prelude.quantum as quantum -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.hugr.tys import Qubit +import guppylang.prelude.quantum as quantum +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.hugr.tys import Qubit module = GuppyModule("test") diff --git a/tests/error/nested_errors/not_defined_if.py b/tests/error/nested_errors/not_defined_if.py index 40b0833d..886db223 100644 --- a/tests/error/nested_errors/not_defined_if.py +++ b/tests/error/nested_errors/not_defined_if.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/nested_errors/reassign_capture_1.py b/tests/error/nested_errors/reassign_capture_1.py index 33151d92..6a0ec791 100644 --- a/tests/error/nested_errors/reassign_capture_1.py +++ b/tests/error/nested_errors/reassign_capture_1.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/nested_errors/reassign_capture_2.py b/tests/error/nested_errors/reassign_capture_2.py index 83769889..fa1d6cdf 100644 --- a/tests/error/nested_errors/reassign_capture_2.py +++ b/tests/error/nested_errors/reassign_capture_2.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/nested_errors/reassign_capture_3.py b/tests/error/nested_errors/reassign_capture_3.py index b26fdd89..e0d3a947 100644 --- a/tests/error/nested_errors/reassign_capture_3.py +++ b/tests/error/nested_errors/reassign_capture_3.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/nested_errors/var_not_defined.py b/tests/error/nested_errors/var_not_defined.py index 8d7abb7e..226e3a85 100644 --- a/tests/error/nested_errors/var_not_defined.py +++ b/tests/error/nested_errors/var_not_defined.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/poly_errors/arg_mismatch1.py b/tests/error/poly_errors/arg_mismatch1.py index 0e631f22..31e5cc87 100644 --- a/tests/error/poly_errors/arg_mismatch1.py +++ b/tests/error/poly_errors/arg_mismatch1.py @@ -1,5 +1,5 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/poly_errors/arg_mismatch2.py b/tests/error/poly_errors/arg_mismatch2.py index 78f82b0c..eb52c542 100644 --- a/tests/error/poly_errors/arg_mismatch2.py +++ b/tests/error/poly_errors/arg_mismatch2.py @@ -1,5 +1,5 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/poly_errors/define.py b/tests/error/poly_errors/define.py index 433c71d9..4cb064ad 100644 --- a/tests/error/poly_errors/define.py +++ b/tests/error/poly_errors/define.py @@ -1,5 +1,5 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/poly_errors/free_return_var.py b/tests/error/poly_errors/free_return_var.py index 9ac9299e..d03e1e24 100644 --- a/tests/error/poly_errors/free_return_var.py +++ b/tests/error/poly_errors/free_return_var.py @@ -1,5 +1,5 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/poly_errors/inst_return_mismatch.py b/tests/error/poly_errors/inst_return_mismatch.py index 885de5fa..b74af0ad 100644 --- a/tests/error/poly_errors/inst_return_mismatch.py +++ b/tests/error/poly_errors/inst_return_mismatch.py @@ -1,5 +1,5 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/poly_errors/inst_return_mismatch_nested.py b/tests/error/poly_errors/inst_return_mismatch_nested.py index b308f31f..fc146a86 100644 --- a/tests/error/poly_errors/inst_return_mismatch_nested.py +++ b/tests/error/poly_errors/inst_return_mismatch_nested.py @@ -1,5 +1,5 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/poly_errors/non_linear1.py b/tests/error/poly_errors/non_linear1.py index 728dccd7..01959576 100644 --- a/tests/error/poly_errors/non_linear1.py +++ b/tests/error/poly_errors/non_linear1.py @@ -1,8 +1,8 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.prelude.quantum import Qubit +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.prelude.quantum import Qubit -import guppy.prelude.quantum as quantum +import guppylang.prelude.quantum as quantum module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/poly_errors/non_linear2.py b/tests/error/poly_errors/non_linear2.py index b46238c3..369798f6 100644 --- a/tests/error/poly_errors/non_linear2.py +++ b/tests/error/poly_errors/non_linear2.py @@ -1,10 +1,10 @@ from typing import Callable -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.prelude.quantum import h +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.prelude.quantum import h -import guppy.prelude.quantum as quantum +import guppylang.prelude.quantum as quantum module = GuppyModule("test") module.load(quantum) diff --git a/tests/error/poly_errors/pass_poly_free.py b/tests/error/poly_errors/pass_poly_free.py index d88a6b83..1e8d9c97 100644 --- a/tests/error/poly_errors/pass_poly_free.py +++ b/tests/error/poly_errors/pass_poly_free.py @@ -1,7 +1,7 @@ from typing import Callable -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/poly_errors/return_mismatch.py b/tests/error/poly_errors/return_mismatch.py index 7be60db6..14aafd49 100644 --- a/tests/error/poly_errors/return_mismatch.py +++ b/tests/error/poly_errors/return_mismatch.py @@ -1,5 +1,5 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/poly_errors/right_to_left.py b/tests/error/poly_errors/right_to_left.py index 1fec068e..baee3ef7 100644 --- a/tests/error/poly_errors/right_to_left.py +++ b/tests/error/poly_errors/right_to_left.py @@ -1,5 +1,5 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule module = GuppyModule("test") diff --git a/tests/error/py_errors/guppy_name1.py b/tests/error/py_errors/guppy_name1.py index d1697d0a..a9ccabf0 100644 --- a/tests/error/py_errors/guppy_name1.py +++ b/tests/error/py_errors/guppy_name1.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/py_errors/guppy_name2.py b/tests/error/py_errors/guppy_name2.py index 44ca9852..c39d25eb 100644 --- a/tests/error/py_errors/guppy_name2.py +++ b/tests/error/py_errors/guppy_name2.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy x = 42 diff --git a/tests/error/py_errors/no_args.py b/tests/error/py_errors/no_args.py index 26bdda63..9f281714 100644 --- a/tests/error/py_errors/no_args.py +++ b/tests/error/py_errors/no_args.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/py_errors/python_err.py b/tests/error/py_errors/python_err.py index 803ec227..63914253 100644 --- a/tests/error/py_errors/python_err.py +++ b/tests/error/py_errors/python_err.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/py_errors/unsupported.py b/tests/error/py_errors/unsupported.py index e238f300..40ba328c 100644 --- a/tests/error/py_errors/unsupported.py +++ b/tests/error/py_errors/unsupported.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/and_not_bool_left.py b/tests/error/type_errors/and_not_bool_left.py index 30f3b338..45c8c19d 100644 --- a/tests/error/type_errors/and_not_bool_left.py +++ b/tests/error/type_errors/and_not_bool_left.py @@ -1,6 +1,6 @@ import tests.error.util -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule from tests.error.util import NonBool module = GuppyModule("test") diff --git a/tests/error/type_errors/and_not_bool_right.py b/tests/error/type_errors/and_not_bool_right.py index deb16df7..14510fd2 100644 --- a/tests/error/type_errors/and_not_bool_right.py +++ b/tests/error/type_errors/and_not_bool_right.py @@ -1,6 +1,6 @@ import tests.error.util -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule from tests.error.util import NonBool module = GuppyModule("test") diff --git a/tests/error/type_errors/binary_not_arith_left.py b/tests/error/type_errors/binary_not_arith_left.py index fd79799c..c3534b82 100644 --- a/tests/error/type_errors/binary_not_arith_left.py +++ b/tests/error/type_errors/binary_not_arith_left.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/binary_not_arith_right.py b/tests/error/type_errors/binary_not_arith_right.py index 8240774c..56b011ce 100644 --- a/tests/error/type_errors/binary_not_arith_right.py +++ b/tests/error/type_errors/binary_not_arith_right.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/call_missing_arg.py b/tests/error/type_errors/call_missing_arg.py index 26160fbd..6b203136 100644 --- a/tests/error/type_errors/call_missing_arg.py +++ b/tests/error/type_errors/call_missing_arg.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/call_not_function.py b/tests/error/type_errors/call_not_function.py index 0dde7dc9..de79fad3 100644 --- a/tests/error/type_errors/call_not_function.py +++ b/tests/error/type_errors/call_not_function.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/call_unexpected_arg.py b/tests/error/type_errors/call_unexpected_arg.py index 0d1f7975..25865fcf 100644 --- a/tests/error/type_errors/call_unexpected_arg.py +++ b/tests/error/type_errors/call_unexpected_arg.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/call_wrong_arg.py b/tests/error/type_errors/call_wrong_arg.py index 78d37c70..8f4d0692 100644 --- a/tests/error/type_errors/call_wrong_arg.py +++ b/tests/error/type_errors/call_wrong_arg.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/fun_ty_mismatch_1.py b/tests/error/type_errors/fun_ty_mismatch_1.py index 69ba1cfc..3d7f8d57 100644 --- a/tests/error/type_errors/fun_ty_mismatch_1.py +++ b/tests/error/type_errors/fun_ty_mismatch_1.py @@ -1,6 +1,6 @@ from collections.abc import Callable -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/fun_ty_mismatch_2.py b/tests/error/type_errors/fun_ty_mismatch_2.py index 602c00f6..d95b1d24 100644 --- a/tests/error/type_errors/fun_ty_mismatch_2.py +++ b/tests/error/type_errors/fun_ty_mismatch_2.py @@ -1,6 +1,6 @@ from collections.abc import Callable -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/fun_ty_mismatch_3.py b/tests/error/type_errors/fun_ty_mismatch_3.py index bfe5b742..4d5519ed 100644 --- a/tests/error/type_errors/fun_ty_mismatch_3.py +++ b/tests/error/type_errors/fun_ty_mismatch_3.py @@ -1,6 +1,6 @@ from collections.abc import Callable -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/if_expr_not_bool.py b/tests/error/type_errors/if_expr_not_bool.py index 41648464..26b4a652 100644 --- a/tests/error/type_errors/if_expr_not_bool.py +++ b/tests/error/type_errors/if_expr_not_bool.py @@ -1,6 +1,6 @@ import tests.error.util -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule from tests.error.util import NonBool module = GuppyModule("test") diff --git a/tests/error/type_errors/if_not_bool.py b/tests/error/type_errors/if_not_bool.py index a51125fd..a544a72e 100644 --- a/tests/error/type_errors/if_not_bool.py +++ b/tests/error/type_errors/if_not_bool.py @@ -1,6 +1,6 @@ import tests.error.util -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule from tests.error.util import NonBool module = GuppyModule("test") diff --git a/tests/error/type_errors/if_not_bool_functional.py b/tests/error/type_errors/if_not_bool_functional.py index 09ecd285..2840dbc7 100644 --- a/tests/error/type_errors/if_not_bool_functional.py +++ b/tests/error/type_errors/if_not_bool_functional.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/invert_not_int.py b/tests/error/type_errors/invert_not_int.py index c18fd4e1..b9a29e3d 100644 --- a/tests/error/type_errors/invert_not_int.py +++ b/tests/error/type_errors/invert_not_int.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/not_not_bool.py b/tests/error/type_errors/not_not_bool.py index 03e9e083..be1d54e6 100644 --- a/tests/error/type_errors/not_not_bool.py +++ b/tests/error/type_errors/not_not_bool.py @@ -1,6 +1,6 @@ import tests.error.util -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule from tests.error.util import NonBool module = GuppyModule("test") diff --git a/tests/error/type_errors/or_not_bool_left.py b/tests/error/type_errors/or_not_bool_left.py index 9236e3b0..a499c1bf 100644 --- a/tests/error/type_errors/or_not_bool_left.py +++ b/tests/error/type_errors/or_not_bool_left.py @@ -1,6 +1,6 @@ import tests.error.util -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule from tests.error.util import NonBool module = GuppyModule("test") diff --git a/tests/error/type_errors/or_not_bool_right.py b/tests/error/type_errors/or_not_bool_right.py index ebd7c092..7f9af865 100644 --- a/tests/error/type_errors/or_not_bool_right.py +++ b/tests/error/type_errors/or_not_bool_right.py @@ -1,6 +1,6 @@ import tests.error.util -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule from tests.error.util import NonBool module = GuppyModule("test") diff --git a/tests/error/type_errors/return_mismatch.py b/tests/error/type_errors/return_mismatch.py index ca2fd8b5..677cf566 100644 --- a/tests/error/type_errors/return_mismatch.py +++ b/tests/error/type_errors/return_mismatch.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/unary_not_arith.py b/tests/error/type_errors/unary_not_arith.py index 81134390..3fd29c7a 100644 --- a/tests/error/type_errors/unary_not_arith.py +++ b/tests/error/type_errors/unary_not_arith.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/unpack_not_enough.py b/tests/error/type_errors/unpack_not_enough.py index c022b692..57e3d2e6 100644 --- a/tests/error/type_errors/unpack_not_enough.py +++ b/tests/error/type_errors/unpack_not_enough.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/unpack_too_many.py b/tests/error/type_errors/unpack_too_many.py index 71946970..e861c538 100644 --- a/tests/error/type_errors/unpack_too_many.py +++ b/tests/error/type_errors/unpack_too_many.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/type_errors/while_not_bool.py b/tests/error/type_errors/while_not_bool.py index 2fe00a00..0c0889c0 100644 --- a/tests/error/type_errors/while_not_bool.py +++ b/tests/error/type_errors/while_not_bool.py @@ -1,6 +1,6 @@ import tests.error.util -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule from tests.error.util import NonBool module = GuppyModule("test") diff --git a/tests/error/type_errors/while_not_bool_functional.py b/tests/error/type_errors/while_not_bool_functional.py index 53c53bf1..1b55ce26 100644 --- a/tests/error/type_errors/while_not_bool_functional.py +++ b/tests/error/type_errors/while_not_bool_functional.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy @guppy diff --git a/tests/error/util.py b/tests/error/util.py index 0f452c08..821aa2f4 100644 --- a/tests/error/util.py +++ b/tests/error/util.py @@ -5,11 +5,11 @@ from typing import Any from collections.abc import Callable -from guppy.hugr import tys -from guppy.hugr.tys import TypeBound -from guppy.module import GuppyModule +from guppylang.hugr import tys +from guppylang.hugr.tys import TypeBound +from guppylang.module import GuppyModule -import guppy.decorator as decorator +import guppylang.decorator as decorator def run_error_test(file, capsys): diff --git a/tests/hugr/test_dummy_nodes.py b/tests/hugr/test_dummy_nodes.py index d2729326..c7e4e266 100644 --- a/tests/hugr/test_dummy_nodes.py +++ b/tests/hugr/test_dummy_nodes.py @@ -1,6 +1,6 @@ -from guppy.gtypes import FunctionType, BoolType, TupleType -from guppy.hugr import ops -from guppy.hugr.hugr import Hugr +from guppylang.gtypes import FunctionType, BoolType, TupleType +from guppylang.hugr import ops +from guppylang.hugr.hugr import Hugr def test_single_dummy(): diff --git a/tests/hugr/test_ports.py b/tests/hugr/test_ports.py index 299b310e..5d04671a 100644 --- a/tests/hugr/test_ports.py +++ b/tests/hugr/test_ports.py @@ -1,7 +1,7 @@ import pytest -from guppy.error import UndefinedPort, InternalGuppyError -from guppy.gtypes import BoolType +from guppylang.error import UndefinedPort, InternalGuppyError +from guppylang.gtypes import BoolType def test_undefined_port(): diff --git a/tests/integration/test_arithmetic.py b/tests/integration/test_arithmetic.py index c4112fd1..deead8fa 100644 --- a/tests/integration/test_arithmetic.py +++ b/tests/integration/test_arithmetic.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy def test_arith_basic(validate): diff --git a/tests/integration/test_basic.py b/tests/integration/test_basic.py index 487f0197..d082270f 100644 --- a/tests/integration/test_basic.py +++ b/tests/integration/test_basic.py @@ -1,6 +1,6 @@ -from guppy.decorator import guppy -from guppy.hugr import ops -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.hugr import ops +from guppylang.module import GuppyModule def test_id(validate): diff --git a/tests/integration/test_call.py b/tests/integration/test_call.py index 2cb7ec80..0e2f6791 100644 --- a/tests/integration/test_call.py +++ b/tests/integration/test_call.py @@ -1,5 +1,5 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule def test_call(validate): diff --git a/tests/integration/test_comprehension.py b/tests/integration/test_comprehension.py index aec2f459..3b5c0774 100644 --- a/tests/integration/test_comprehension.py +++ b/tests/integration/test_comprehension.py @@ -1,10 +1,10 @@ -from guppy.decorator import guppy -from guppy.hugr import tys -from guppy.module import GuppyModule -from guppy.prelude.builtins import linst -from guppy.prelude.quantum import Qubit, h, cx +from guppylang.decorator import guppy +from guppylang.hugr import tys +from guppylang.module import GuppyModule +from guppylang.prelude.builtins import linst +from guppylang.prelude.quantum import Qubit, h, cx -import guppy.prelude.quantum as quantum +import guppylang.prelude.quantum as quantum def test_basic(validate): diff --git a/tests/integration/test_for.py b/tests/integration/test_for.py index 917c3ffc..08a26e96 100644 --- a/tests/integration/test_for.py +++ b/tests/integration/test_for.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy def test_basic(validate): diff --git a/tests/integration/test_functional.py b/tests/integration/test_functional.py index ae61a30d..761b5c0b 100644 --- a/tests/integration/test_functional.py +++ b/tests/integration/test_functional.py @@ -1,6 +1,6 @@ import pytest -from guppy.decorator import guppy +from guppylang.decorator import guppy from tests.integration.util import functional, _ diff --git a/tests/integration/test_higher_order.py b/tests/integration/test_higher_order.py index fd8856d8..e751e475 100644 --- a/tests/integration/test_higher_order.py +++ b/tests/integration/test_higher_order.py @@ -1,7 +1,7 @@ from collections.abc import Callable -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule def test_basic(validate): diff --git a/tests/integration/test_if.py b/tests/integration/test_if.py index ac4f5f10..ea4a5bcd 100644 --- a/tests/integration/test_if.py +++ b/tests/integration/test_if.py @@ -1,6 +1,6 @@ import pytest -from guppy.decorator import guppy +from guppylang.decorator import guppy def test_if_no_else(validate): diff --git a/tests/integration/test_linear.py b/tests/integration/test_linear.py index cdd975d9..3d7e4207 100644 --- a/tests/integration/test_linear.py +++ b/tests/integration/test_linear.py @@ -1,11 +1,11 @@ -from guppy.decorator import guppy -from guppy.hugr import tys -from guppy.module import GuppyModule -from guppy.prelude.builtins import linst -from guppy.prelude.quantum import Qubit - -import guppy.prelude.quantum as quantum -from guppy.prelude.quantum import h, cx, measure +from guppylang.decorator import guppy +from guppylang.hugr import tys +from guppylang.module import GuppyModule +from guppylang.prelude.builtins import linst +from guppylang.prelude.quantum import Qubit + +import guppylang.prelude.quantum as quantum +from guppylang.prelude.quantum import h, cx, measure def test_id(validate): diff --git a/tests/integration/test_linst.py b/tests/integration/test_linst.py index 4086d234..ababaae6 100644 --- a/tests/integration/test_linst.py +++ b/tests/integration/test_linst.py @@ -1,9 +1,9 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.prelude.builtins import linst -from guppy.prelude.quantum import Qubit, h +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.prelude.builtins import linst +from guppylang.prelude.quantum import Qubit, h -import guppy.prelude.quantum as quantum +import guppylang.prelude.quantum as quantum def test_types(validate): diff --git a/tests/integration/test_list.py b/tests/integration/test_list.py index e59db276..9bee4016 100644 --- a/tests/integration/test_list.py +++ b/tests/integration/test_list.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy def test_types(validate): diff --git a/tests/integration/test_nested.py b/tests/integration/test_nested.py index 23698f59..30dbc414 100644 --- a/tests/integration/test_nested.py +++ b/tests/integration/test_nested.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy def test_basic(validate): diff --git a/tests/integration/test_poly.py b/tests/integration/test_poly.py index ee8f112c..f05e708e 100644 --- a/tests/integration/test_poly.py +++ b/tests/integration/test_poly.py @@ -1,10 +1,10 @@ from collections.abc import Callable -from guppy.decorator import guppy -from guppy.module import GuppyModule -from guppy.prelude.quantum import Qubit +from guppylang.decorator import guppy +from guppylang.module import GuppyModule +from guppylang.prelude.quantum import Qubit -import guppy.prelude.quantum as quantum +import guppylang.prelude.quantum as quantum def test_id(validate): diff --git a/tests/integration/test_programs.py b/tests/integration/test_programs.py index ee7c87cc..1fca9ec6 100644 --- a/tests/integration/test_programs.py +++ b/tests/integration/test_programs.py @@ -1,5 +1,5 @@ -from guppy.decorator import guppy -from guppy.module import GuppyModule +from guppylang.decorator import guppy +from guppylang.module import GuppyModule def test_factorial(validate): diff --git a/tests/integration/test_py.py b/tests/integration/test_py.py index 2e896aee..85b0ec1f 100644 --- a/tests/integration/test_py.py +++ b/tests/integration/test_py.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy from tests.integration.util import py diff --git a/tests/integration/test_unused.py b/tests/integration/test_unused.py index b8592bc4..c2f81c27 100644 --- a/tests/integration/test_unused.py +++ b/tests/integration/test_unused.py @@ -1,6 +1,6 @@ """ All sorts of weird stuff is allowed when variables are not used. """ -from guppy.decorator import guppy +from guppylang.decorator import guppy def test_not_always_defined1(validate): diff --git a/tests/integration/test_while.py b/tests/integration/test_while.py index 28d20dc0..286bf40a 100644 --- a/tests/integration/test_while.py +++ b/tests/integration/test_while.py @@ -1,4 +1,4 @@ -from guppy.decorator import guppy +from guppylang.decorator import guppy def test_infinite_loop(validate):