Skip to content

Commit f9de8bd

Browse files
committed
console scripts correctly (windows)
1 parent f39e51b commit f9de8bd

File tree

4 files changed

+6
-34
lines changed

4 files changed

+6
-34
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,7 @@ jobs:
3636
shell: bash
3737
run: |
3838
pip install .[test,mlir] -f https://makslevental.github.io/wheels
39-
if [ ${{ matrix.os }} == 'windows-2022' ]; then
40-
# configure-mlir-python-utils.exe -y torch_mlir
41-
pushd /tmp && python -m mlir_utils._configuration -y mlir && popd
42-
else
43-
configure-mlir-python-utils -y mlir
44-
fi
39+
configure-mlir-python-utils -y mlir
4540
4641
- name: Test
4742
shell: bash
@@ -124,12 +119,7 @@ jobs:
124119
shell: bash
125120
run: |
126121
pip install .[test,torch-mlir] -f https://llvm.github.io/torch-mlir/package-index -f https://makslevental.github.io/wheels
127-
if [ ${{ matrix.os }} == 'windows-2022' ]; then
128-
# configure-mlir-python-utils.exe -y torch_mlir
129-
pushd /tmp && python -m mlir_utils._configuration -y torch_mlir && popd
130-
else
131-
configure-mlir-python-utils -y torch_mlir
132-
fi
122+
configure-mlir-python-utils -y torch_mlir
133123
134124
- name: Test
135125
shell: bash
@@ -164,12 +154,7 @@ jobs:
164154
shell: bash
165155
run: |
166156
pip install .[test,jax] -f https://makslevental.github.io/wheels
167-
if [ ${{ matrix.os }} == 'windows-2022' ]; then
168-
# configure-mlir-python-utils.exe -y jaxlib.mlir
169-
pushd /tmp && python -m mlir_utils._configuration -y jaxlib.mlir && popd
170-
else
171-
configure-mlir-python-utils -y jaxlib.mlir
172-
fi
157+
configure-mlir-python-utils -y jaxlib.mlir
173158
174159
- name: Test
175160
shell: bash

mlir_utils/_configuration/configuration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ def alias_upstream_bindings():
7272
)
7373
return True
7474
elif not (
75-
sys.argv[0].endswith("configure-mlir-python-utils")
75+
"configure-mlir-python-utils" in sys.argv[0]
7676
or ("-m" in sys.orig_argv and __package__ in sys.orig_argv)
7777
):
7878
raise Exception(
79-
"mlir-python-utils not configured and MLIR_PYTHON_PACKAGE_PREFIX env variable not set"
79+
f"mlir-python-utils not configured and MLIR_PYTHON_PACKAGE_PREFIX env variable not set ({sys.argv=})"
8080
)
8181
return False
8282

mlir_utils/dialects/ext/transform.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,6 @@ def sequence_(
7272
StrOrAttrList = Sequence[Union[StringAttr, str]]
7373

7474

75-
@register_attribute_builder("StrArrayAttr")
76-
def _get_str_array_attr(
77-
values: Optional[Union[ArrayAttr, StrOrAttrList]], context: Context
78-
) -> ArrayAttr:
79-
if values is None:
80-
return ArrayAttr.get([], context=context)
81-
82-
values = _get_value_list(values)
83-
return ArrayAttr.get(
84-
[StringAttr.get(v, context=context) for v in values], context=context
85-
)
86-
87-
8875
def get_parent_for(target: Value, *, num_loops=None, loc=None, ip=None):
8976
if loc is None:
9077
loc = get_user_code_loc()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ torch-mlir = ["torch-mlir-core"]
1919
jax = ["jax[cpu]", ]
2020
mlir = ["mlir-python-bindings"]
2121

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

0 commit comments

Comments
 (0)