Skip to content

Commit 1bf7e26

Browse files
authored
Ci fixes (PolusAI#337)
1 parent 09b1f46 commit 1bf7e26

File tree

9 files changed

+53
-46
lines changed

9 files changed

+53
-46
lines changed

.github/workflows/lint_and_test.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -177,25 +177,7 @@ jobs:
177177
# (Many of the packages conflict with pypy.)
178178
run: cd mm-workflows/ && pip install ".[test]" && mm-workflows --generate_schemas
179179

180-
- name: Generate Sophios Python API Workflows (*.py -> *.wic)
181-
if: always()
182-
run: cd sophios/ && pytest -k test_compile_python_workflows
183-
184-
- name: Generate Sophios Validation Jsonschema
185-
if: always()
186-
run: cd sophios/ && sophios --generate_schemas
187-
188-
# Please read docs/validation.md#Property-Based-Testing
189-
# This is essentially an integration test for all of the
190-
# Sophios Python API workflows as well as the Sophios Python API itself.
191-
- name: Validate sophios Python API Workflows (*.py -> *.wic)
192-
if: always()
193-
run: cd sophios/ && pytest -k test_compile_python_workflows
194-
195-
- name: Build Documentation
196-
if: always()
197-
run: cd sophios/docs && make html
198-
180+
# Do the static analysis, type and style check first
199181
- name: MyPy Check Type Annotations
200182
if: always()
201183
run: cd sophios/ && mypy src/ examples/ tests/
@@ -216,6 +198,26 @@ jobs:
216198
if: steps.autopep8.outputs.exit-code == 2
217199
run: exit 1
218200

201+
202+
- name: Generate Sophios Python API Workflows (*.py -> *.wic)
203+
if: always()
204+
run: cd sophios/ && pytest -k test_compile_python_workflows
205+
206+
- name: Generate Sophios Validation Jsonschema
207+
if: always()
208+
run: cd sophios/ && sophios --generate_schemas
209+
210+
# Please read docs/validation.md#Property-Based-Testing
211+
# This is essentially an integration test for all of the
212+
# Sophios Python API workflows as well as the Sophios Python API itself.
213+
- name: Validate sophios Python API Workflows (*.py -> *.wic)
214+
if: always()
215+
run: cd sophios/ && pytest -k test_compile_python_workflows
216+
217+
- name: Build Documentation
218+
if: always()
219+
run: cd sophios/docs && make html
220+
219221
# NOTE: Do NOT add coverage to PYPY CI runs https://github.com/tox-dev/tox/issues/2252
220222

221223
- name: PyTest CWL Embedding Independence

docker/Dockerfile_amazon

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ FROM amazonlinux
55
# Install conda / mamba
66
RUN yum update -y && yum install -y wget
77

8-
RUN CONDA="Miniforge3-Linux-x86_64.sh" && \
9-
wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \
8+
ARG CONDA="Miniforge3-Linux-x86_64.sh"
9+
10+
RUN wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \
1011
chmod +x $CONDA && \
1112
./$CONDA -b -p /miniforge && \
1213
rm -f $CONDA

docker/Dockerfile_debian

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ FROM debian:stable-slim
55
# Install conda / mamba
66
RUN apt-get update -y && apt-get install -y wget
77

8-
RUN CONDA="Miniforge3-Linux-x86_64.sh" && \
9-
wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \
8+
ARG CONDA="Miniforge3-Linux-x86_64.sh"
9+
10+
RUN wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \
1011
chmod +x $CONDA && \
1112
./$CONDA -b -p /miniforge && \
1213
rm -f $CONDA
@@ -15,8 +16,8 @@ ENV PATH /miniforge/bin:$PATH
1516
# Install wic
1617
RUN apt-get install -y git
1718

18-
COPY . /workflow-inference-compiler
19-
WORKDIR /workflow-inference-compiler
19+
COPY . /sophios
20+
WORKDIR /sophios
2021

2122
#RUN conda create --name wic
2223
#RUN conda activate wic

docker/Dockerfile_fedora

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
FROM fedora
44

55
# Install conda / mamba
6-
RUN yum update -y && yum install -y wget
6+
RUN dnf update -y && dnf install -y wget awk
77

8-
RUN CONDA="Miniforge3-Linux-x86_64.sh" && \
9-
wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \
8+
ARG CONDA="Miniforge3-Linux-x86_64.sh"
9+
10+
RUN wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \
1011
chmod +x $CONDA && \
1112
./$CONDA -b -p /miniforge && \
1213
rm -f $CONDA
13-
ENV PATH /miniforge/bin:$PATH
14+
ENV PATH=/miniforge/bin:$PATH
1415

15-
# Install wic
16-
RUN yum install -y git
16+
# Install sophios
17+
RUN dnf install -y git
1718

18-
COPY . /workflow-inference-compiler
19-
WORKDIR /workflow-inference-compiler
19+
COPY . /sophios
20+
WORKDIR /sophios
2021

2122
#RUN conda create --name wic
2223
#RUN conda activate wic
@@ -30,6 +31,6 @@ RUN pip install -e ".[all_except_runner_src]"
3031

3132
RUN mamba clean --all --yes
3233
RUN pip cache purge
33-
RUN yum clean all
34+
RUN dnf clean all
3435

3536
ADD docker/Dockerfile_fedora .

docker/Dockerfile_redhat

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ FROM redhat/ubi9-minimal
66
# Install conda / mamba
77
RUN microdnf update -y && microdnf install -y wget
88

9-
RUN CONDA="Miniforge3-Linux-x86_64.sh" && \
10-
wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \
9+
ARG CONDA="Miniforge3-Linux-x86_64.sh"
10+
11+
RUN wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \
1112
chmod +x $CONDA && \
1213
./$CONDA -b -p /miniforge && \
1314
rm -f $CONDA
@@ -16,8 +17,8 @@ ENV PATH /miniforge/bin:$PATH
1617
# Install wic
1718
RUN microdnf install -y git
1819

19-
COPY . /workflow-inference-compiler
20-
WORKDIR /workflow-inference-compiler
20+
COPY . /sophios
21+
WORKDIR /sophios
2122

2223
#RUN conda create --name wic
2324
#RUN conda activate wic

docker/Dockerfile_ubuntu

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ FROM ubuntu
55
# Install conda / mamba
66
RUN apt-get update -y && apt-get install -y wget
77

8-
RUN CONDA="Miniforge3-Linux-x86_64.sh" && \
9-
wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \
8+
ARG CONDA="Miniforge3-Linux-x86_64.sh"
9+
10+
RUN wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/$CONDA && \
1011
chmod +x $CONDA && \
1112
./$CONDA -b -p /miniforge && \
1213
rm -f $CONDA
@@ -15,8 +16,8 @@ ENV PATH /miniforge/bin:$PATH
1516
# Install wic
1617
RUN apt-get install -y git
1718

18-
COPY . /workflow-inference-compiler
19-
WORKDIR /workflow-inference-compiler
19+
COPY . /sophios
20+
WORKDIR /sophios
2021

2122
#RUN conda create --name wic
2223
#RUN conda activate wic

src/sophios/api/utils/ict/ict_spec/metadata/objects.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __str__(self) -> str:
4242
return self.root
4343

4444
@singledispatchmethod
45-
def __eq__(self, other: Any) -> bool: # type: ignore
45+
def __eq__(self, other: Any) -> bool: # type: ignore[override, unused-ignore] # pylint: disable=incompatible-type
4646
"""Compare if two Author objects are equal."""
4747
msg = "invalid type for comparison."
4848
raise TypeError(msg)
@@ -82,7 +82,7 @@ def __str__(self) -> str:
8282
return self.root
8383

8484
@singledispatchmethod
85-
def __eq__(self, other: Any) -> bool: # type: ignore
85+
def __eq__(self, other: Any) -> bool: # type: ignore[override, unused-ignore] # pylint: disable=incompatible-type
8686
"""Compare if two DOI objects are equal."""
8787
msg = "invalid type for comparison."
8888
raise TypeError(msg)

src/sophios/inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ def get_inference_rules(wic: Yaml, step_key_parent: str) -> Dict[str, str]:
369369
"""
370370
# NOTE: Here, we simply return all inference rules. The call site then
371371
# determines whether to apply any of the rules by doing a lookup.
372+
rules: Dict[str, str] = {}
372373
if 'steps' in wic.get('wic', {}):
373374
wic_steps = wic['wic']['steps']
374-
rules = {}
375375
for keystr, wic_child in wic_steps.items():
376376
(step_num, step_key) = utils.parse_int_string_tuple(keystr)
377377
namespace = utils.step_name_str(Path(step_key_parent).stem, step_num - 1, step_key)

tests/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,6 @@ def test_inline_subworkflows(yml_path_str: str, yml_path: Path) -> None:
399399
sub_graph_nx = sub_node_data.graph.networkx
400400
sub_graph_fakeroot_nx = inline_sub_node_data.graph.networkx
401401
# assert isomorphism.faster_could_be_isomorphic(sub_graph_nx, sub_graph_fakeroot_nx)
402-
g_m = isomorphism.GraphMatcher(sub_graph_nx, sub_graph_fakeroot_nx)
402+
g_m = isomorphism.DiGraphMatcher(sub_graph_nx, sub_graph_fakeroot_nx)
403403
print('is_isomorphic()?', yml_path_str, namespaces)
404404
is_isomorphic_with_timeout(g_m, yml_path_str)

0 commit comments

Comments
 (0)