Skip to content

Commit

Permalink
Merge pull request #313 from sameeul/v022
Browse files Browse the repository at this point in the history
  • Loading branch information
sameeul authored Jan 10, 2025
2 parents 7c1708d + f288370 commit 8c9be32
Show file tree
Hide file tree
Showing 24 changed files with 221 additions and 341 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and Test Wheel

on:
pull_request:
workflow_dispatch:

jobs:
package:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11

- name: Install sophios 🔧
run: |
pip install .[test]
- name: Test with pytest
run: |
python -m pytest -k test_cwl_docker_extract
python -m pytest -m "not skip_pypi_ci" -vv
- name: Build sophios
run: |
python -m pip install twine build
python -m build --wheel
python -m build --sdist
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: sophios-wheels
path: dist/*
retention-days: 1
3 changes: 1 addition & 2 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ jobs:
fail-fast: false
matrix:
# NOTE: Use a matrix (instead of dockerBuild.sh) for parallelism
dockerfile: [amazon, debian, fedora, redhat,
amazon_pypy, debian_pypy, fedora_pypy, redhat_pypy]
dockerfile: [amazon, debian, fedora, redhat]
runs-on: [ubuntu-latest]

steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker_build_plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
schedule:
# Run it every Tuesday at midnight.
- cron: '0 0 * * 2'
workflow_dispatch:

permissions:
actions: read
Expand Down
46 changes: 23 additions & 23 deletions .github/workflows/fuzzy_compile_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ jobs:
runs-on: [self-hosted, linux]

steps:
- name: Checkout workflow-inference-compiler
- name: Checkout sophios
if: always()
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/workflow-inference-compiler
ref: master
path: workflow-inference-compiler
repository: ${{ github.repository_owner }}/sophios
ref: ${{ inputs.wic_ref }}
path: sophios

- name: Checkout biobb_adapters
if: always()
Expand All @@ -56,31 +56,31 @@ jobs:
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/mm-workflows
ref: main
ref: ${{ inputs.mm-workflows_ref }}
path: mm-workflows

- name: Checkout image-workflows
if: always()
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/image-workflows
ref: main
ref: ${{ inputs.image-workflows_ref }}
path: image-workflows

- name: Setup miniforge (linux, macos)
if: runner.os != 'Windows'
uses: conda-incubator/setup-miniconda@v3.0.1
with:
miniforge-variant: Miniforge-pypy3
miniforge-version: 24.7.1-0
environment-file: workflow-inference-compiler/install/system_deps.yml
miniforge-variant: Miniforge3
miniforge-version: 24.7.1-2
environment-file: sophios/install/system_deps.yml
activate-environment: wic
channels: conda-forge
python-version: "3.9.*" # pypy is not yet compatible with 3.10 and 3.11

- name: Install Workflow Inference Compiler
if: always()
run: cd workflow-inference-compiler/ && pip install ".[all_except_runner_src]"
run: cd sophios/ && pip install ".[all_except_runner_src]"

- name: Install Molecular Modeling Workflows
if: always()
Expand All @@ -93,47 +93,47 @@ jobs:

- name: Generate Sophios Python API Workflows (*.py -> *.wic)
if: always()
run: cd workflow-inference-compiler/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'
run: cd sophios/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'

- name: Generate Sophios Validation Jsonschema
if: always()
run: cd workflow-inference-compiler/ && sophios --generate_schemas
run: cd sophios/ && sophios --generate_schemas

# Please read docs/validation.md#Property-Based-Testing
# This is essentially an integration test for all of the
# WIC Python API workflows as well as the WIC Python API itself.
- name: Validate Sophios Python API Workflows (*.py -> *.wic)
if: always()
run: cd workflow-inference-compiler/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'
run: cd sophios/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'

# Since a randomly chosen subschema is used every time, repeat 10X for more coverage.

- name: PyTest Fuzzy Compile
run: cd workflow-inference-compiler/ && pytest -k test_fuzzy_compile
run: cd sophios/ && pytest -k test_fuzzy_compile

- name: PyTest Fuzzy Compile
run: cd workflow-inference-compiler/ && pytest -k test_fuzzy_compile
run: cd sophios/ && pytest -k test_fuzzy_compile

- name: PyTest Fuzzy Compile
run: cd workflow-inference-compiler/ && pytest -k test_fuzzy_compile
run: cd sophios/ && pytest -k test_fuzzy_compile

- name: PyTest Fuzzy Compile
run: cd workflow-inference-compiler/ && pytest -k test_fuzzy_compile
run: cd sophios/ && pytest -k test_fuzzy_compile

- name: PyTest Fuzzy Compile
run: cd workflow-inference-compiler/ && pytest -k test_fuzzy_compile
run: cd sophios/ && pytest -k test_fuzzy_compile

- name: PyTest Fuzzy Compile
run: cd workflow-inference-compiler/ && pytest -k test_fuzzy_compile
run: cd sophios/ && pytest -k test_fuzzy_compile

- name: PyTest Fuzzy Compile
run: cd workflow-inference-compiler/ && pytest -k test_fuzzy_compile
run: cd sophios/ && pytest -k test_fuzzy_compile

- name: PyTest Fuzzy Compile
run: cd workflow-inference-compiler/ && pytest -k test_fuzzy_compile
run: cd sophios/ && pytest -k test_fuzzy_compile

- name: PyTest Fuzzy Compile
run: cd workflow-inference-compiler/ && pytest -k test_fuzzy_compile
run: cd sophios/ && pytest -k test_fuzzy_compile

- name: PyTest Fuzzy Compile
run: cd workflow-inference-compiler/ && pytest -k test_fuzzy_compile
run: cd sophios/ && pytest -k test_fuzzy_compile
52 changes: 26 additions & 26 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Checkout workflow-inference-compiler
- name: Checkout sophios
if: always()
uses: actions/checkout@v3
with:
repository: ${{ inputs.wic_owner }}/workflow-inference-compiler
repository: ${{ inputs.wic_owner }}/sophios
ref: ${{ inputs.wic_ref }}
path: workflow-inference-compiler
path: sophios

- name: Checkout biobb_adapters
if: always()
Expand Down Expand Up @@ -127,19 +127,19 @@ jobs:
# NOTE: pypy actually decreases performance for lint_and_test.yml (by a factor of ~2)
# - name: Append pypy to conda environment files
# if: runner.os != 'Windows'
# run: cd workflow-inference-compiler/install/ && echo " - pypy" >> system_deps.yml
# run: cd sophios/install/ && echo " - pypy" >> system_deps.yml

# - name: Append pypy to conda environment files
# if: runner.os == 'Windows'
# run: cd workflow-inference-compiler/install/ && echo " - pypy" >> system_deps_windows.yml
# run: cd sophios/install/ && echo " - pypy" >> system_deps_windows.yml

- name: Setup miniforge (linux, macos)
if: runner.os != 'Windows'
uses: conda-incubator/setup-miniconda@v3.0.1
with:
miniforge-variant: Miniforge-pypy3
miniforge-version: 24.7.1-0
environment-file: workflow-inference-compiler/install/system_deps.yml
miniforge-variant: Miniforge3
miniforge-version: 24.7.1-2
environment-file: sophios/install/system_deps.yml
activate-environment: wic
channels: conda-forge
python-version: "3.9.*" # pypy is not yet compatible with 3.10 and 3.11
Expand All @@ -148,21 +148,21 @@ jobs:
if: runner.os == 'Windows'
uses: conda-incubator/setup-miniconda@v3.0.1
with:
miniforge-variant: Miniforge-pypy3
miniforge-version: 24.7.1-0
environment-file: workflow-inference-compiler/install/system_deps_windows.yml
miniforge-variant: Miniforge3
miniforge-version: 24.7.1-2
environment-file: sophios/install/system_deps_windows.yml
activate-environment: wic
channels: conda-forge
python-version: "3.9.*" # pypy is not yet compatible with 3.10 and 3.11

- name: ShellCheck Script Quality
if: always()
# "SC1017 (error): Literal carriage return. Run script through tr -d '\r' ."
run: shellcheck -e SC1017 $(find workflow-inference-compiler/ -name "*.sh" -and -not -path "./3/*")
run: shellcheck -e SC1017 $(find sophios/ -name "*.sh" -and -not -path "./3/*")

- name: Install Workflow Inference Compiler
if: always()
run: cd workflow-inference-compiler/ && pip install ".[all_except_runner_src]"
run: cd sophios/ && pip install ".[all_except_runner_src]"

- name: Install Molecular Modeling Workflows
if: always()
Expand All @@ -175,39 +175,39 @@ jobs:

- name: Generate Sophios Python API Workflows (*.py -> *.wic)
if: always()
run: cd workflow-inference-compiler/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'
run: cd sophios/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'

- name: Generate Sophios Validation Jsonschema
if: always()
run: cd workflow-inference-compiler/ && sophios --generate_schemas
run: cd sophios/ && sophios --generate_schemas

# Please read docs/validation.md#Property-Based-Testing
# This is essentially an integration test for all of the
# Sophios Python API workflows as well as the Sophios Python API itself.
- name: Validate sophios Python API Workflows (*.py -> *.wic)
if: always()
run: cd workflow-inference-compiler/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'
run: cd sophios/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'

- name: Build Documentation
if: always()
run: cd workflow-inference-compiler/docs && make html
run: cd sophios/docs && make html

- name: MyPy Check Type Annotations
if: always()
run: cd workflow-inference-compiler/ && mypy src/ examples/ tests/
run: cd sophios/ && mypy src/ examples/ tests/
# NOTE: Do not use `mypy .` because then mypy will check both src/ and build/ causing:
# src/workflow-inference-compiler/__init__.py: error: Duplicate module named "wic"
# (also at "./build/lib/workflow-inference-compiler/__init__.py")
# src/sophios/__init__.py: error: Duplicate module named "wic"
# (also at "./build/lib/sophios/__init__.py")

- name: PyLint Check Code Quality
if: always()
run: cd workflow-inference-compiler/ && pylint src/ examples/**/*.py tests/
run: cd sophios/ && pylint src/ examples/**/*.py tests/
# NOTE: See fail-under threshold in .pylintrc

- name: PEP8 Code Formatting
if: always()
id: autopep8
run: cd workflow-inference-compiler/ && autopep8 --exit-code --recursive --diff --max-line-length 120 examples/ src/ tests/
run: cd sophios/ && autopep8 --exit-code --recursive --diff --max-line-length 120 examples/ src/ tests/
- name: Fail if autopep8 made changes
if: steps.autopep8.outputs.exit-code == 2
run: exit 1
Expand All @@ -216,13 +216,13 @@ jobs:

- name: PyTest CWL Embedding Independence
if: always()
run: cd workflow-inference-compiler/ && pytest -k test_cwl_embedding_independence # --cov --cov-config=.coveragerc_serial
run: cd sophios/ && pytest -k test_cwl_embedding_independence # --cov --cov-config=.coveragerc_serial
# NOTE: This test MUST be run in serial! See is_isomorphic_with_timeout()
timeout-minutes: 20 # backup timeout for windows

- name: PyTest Inline Subworkflows
if: always()
run: cd workflow-inference-compiler/ && pytest -k test_inline_subworkflows # --cov --cov-config=.coveragerc_serial
run: cd sophios/ && pytest -k test_inline_subworkflows # --cov --cov-config=.coveragerc_serial
# NOTE: This test MUST be run in serial! See is_isomorphic_with_timeout()
timeout-minutes: 20 # backup timeout for windows

Expand All @@ -231,7 +231,7 @@ jobs:
# Avoid Windows and macOS due to 2X and 10X minute multipliers.
# https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#minute-multipliers
# Also, cannot run on Windows (natively) yet
run: cd workflow-inference-compiler/ && pytest -k test_scattering_scaling
run: cd sophios/ && pytest -k test_scattering_scaling

# NOTE: The steps below are for repository_dispatch only. For all other steps, please insert above
# this comment.
Expand Down Expand Up @@ -269,7 +269,7 @@ jobs:
# https://github.com/actions/runner/issues/834#issuecomment-907096707
# Use inputs.sender_repo to reply the original sender.
if: always()
uses: ./workflow-inference-compiler/.github/my_actions/reply_sender/ # Must start with ./
uses: ./sophios/.github/my_actions/reply_sender/ # Must start with ./
with:
github_repository: ${{ github.repository }}
event_type: ${{ inputs.event_type }}
Expand Down
Loading

0 comments on commit 8c9be32

Please sign in to comment.