Skip to content

Commit

Permalink
console scripts correctly (windows)
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Sep 6, 2023
1 parent f39e51b commit f9de8bd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 34 deletions.
21 changes: 3 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,7 @@ jobs:
shell: bash
run: |
pip install .[test,mlir] -f https://makslevental.github.io/wheels
if [ ${{ matrix.os }} == 'windows-2022' ]; then
# configure-mlir-python-utils.exe -y torch_mlir
pushd /tmp && python -m mlir_utils._configuration -y mlir && popd
else
configure-mlir-python-utils -y mlir
fi
configure-mlir-python-utils -y mlir
- name: Test
shell: bash
Expand Down Expand Up @@ -124,12 +119,7 @@ jobs:
shell: bash
run: |
pip install .[test,torch-mlir] -f https://llvm.github.io/torch-mlir/package-index -f https://makslevental.github.io/wheels
if [ ${{ matrix.os }} == 'windows-2022' ]; then
# configure-mlir-python-utils.exe -y torch_mlir
pushd /tmp && python -m mlir_utils._configuration -y torch_mlir && popd
else
configure-mlir-python-utils -y torch_mlir
fi
configure-mlir-python-utils -y torch_mlir
- name: Test
shell: bash
Expand Down Expand Up @@ -164,12 +154,7 @@ jobs:
shell: bash
run: |
pip install .[test,jax] -f https://makslevental.github.io/wheels
if [ ${{ matrix.os }} == 'windows-2022' ]; then
# configure-mlir-python-utils.exe -y jaxlib.mlir
pushd /tmp && python -m mlir_utils._configuration -y jaxlib.mlir && popd
else
configure-mlir-python-utils -y jaxlib.mlir
fi
configure-mlir-python-utils -y jaxlib.mlir
- name: Test
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions mlir_utils/_configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ def alias_upstream_bindings():
)
return True
elif not (
sys.argv[0].endswith("configure-mlir-python-utils")
"configure-mlir-python-utils" in sys.argv[0]
or ("-m" in sys.orig_argv and __package__ in sys.orig_argv)
):
raise Exception(
"mlir-python-utils not configured and MLIR_PYTHON_PACKAGE_PREFIX env variable not set"
f"mlir-python-utils not configured and MLIR_PYTHON_PACKAGE_PREFIX env variable not set ({sys.argv=})"
)
return False

Expand Down
13 changes: 0 additions & 13 deletions mlir_utils/dialects/ext/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,6 @@ def sequence_(
StrOrAttrList = Sequence[Union[StringAttr, str]]


@register_attribute_builder("StrArrayAttr")
def _get_str_array_attr(
values: Optional[Union[ArrayAttr, StrOrAttrList]], context: Context
) -> ArrayAttr:
if values is None:
return ArrayAttr.get([], context=context)

values = _get_value_list(values)
return ArrayAttr.get(
[StringAttr.get(v, context=context) for v in values], context=context
)


def get_parent_for(target: Value, *, num_loops=None, loc=None, ip=None):
if loc is None:
loc = get_user_code_loc()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ torch-mlir = ["torch-mlir-core"]
jax = ["jax[cpu]", ]
mlir = ["mlir-python-bindings"]

[project.scripts]
[project.entry-points.console_scripts]
configure-mlir-python-utils = "mlir_utils:_configuration.configuration.configure_host_bindings"
generate-trampolines = "mlir_utils:_configuration.generate_trampolines.generate_trampolines"

Expand Down

0 comments on commit f9de8bd

Please sign in to comment.