Skip to content

Commit

Permalink
Publish package (#237)
Browse files Browse the repository at this point in the history
* update docker builds

* Change package name to sophios

* rename directory

* Refactor tests

* adding config.json back

* update test

* update gitattributes

* Update workflows

* Disable test -  temporary

* Update manifest file

* try minimal setup.py

* roll back __init__.py

* update workflow

* add tests back

* update docs

* Fix some pep8 issues

* reset index.js
  • Loading branch information
sameeul authored May 30, 2024
1 parent 25fb6f7 commit ad81195
Show file tree
Hide file tree
Showing 41 changed files with 235 additions and 229 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
src/wic/_version.py export-subst
src/sophios/_version.py export-subst
12 changes: 6 additions & 6 deletions .github/workflows/fuzzy_compile_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ jobs:
# (Many of the packages conflict with pypy.)
run: cd mm-workflows/ && pip install ".[test]" && mm-workflows --generate_schemas

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

- name: Generate WIC Validation Jsonschema
- name: Generate Sophios Validation Jsonschema
if: always()
run: cd workflow-inference-compiler/ && wic --generate_schemas
run: cd workflow-inference-compiler/ && 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 WIC Python API Workflows (*.py -> *.wic)
- name: Validate Sophios Python API Workflows (*.py -> *.wic)
if: always()
run: cd workflow-inference-compiler/ && python -c 'import wic; import wic.plugins; wic.plugins.blindly_execute_python_workflows()'
run: cd workflow-inference-compiler/ && 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.

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,20 +173,20 @@ jobs:
# (Many of the packages conflict with pypy.)
run: cd mm-workflows/ && pip install ".[test]" && mm-workflows --generate_schemas

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

- name: Generate WIC Validation Jsonschema
- name: Generate Sophios Validation Jsonschema
if: always()
run: cd workflow-inference-compiler/ && wic --generate_schemas
run: cd workflow-inference-compiler/ && 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 WIC Python API Workflows (*.py -> *.wic)
# 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 wic; import wic.plugins; wic.plugins.blindly_execute_python_workflows()'
run: cd workflow-inference-compiler/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'

- name: Build Documentation
if: always()
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/lint_and_test_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,20 @@ jobs:
# (Many of the packages conflict with pypy.)
run: cd mm-workflows/ && pip install ".[test]" && mm-workflows --generate_schemas

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

- name: Generate WIC Validation Jsonschema
- name: Generate Sophios Validation Jsonschema
if: always()
run: cd workflow-inference-compiler/ && wic --generate_schemas
run: cd workflow-inference-compiler/ && 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 WIC Python API Workflows (*.py -> *.wic)
# 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 wic; import wic.plugins; wic.plugins.blindly_execute_python_workflows()'
run: cd workflow-inference-compiler/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'

- name: Build Documentation
if: always()
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/run_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,20 @@ jobs:
# (Many of the packages conflict with pypy.)
run: cd mm-workflows/ && pip install ".[test]" && mm-workflows --generate_schemas

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

- name: Generate WIC Validation Jsonschema
- name: Generate Sophios Validation Jsonschema
if: always()
run: cd workflow-inference-compiler/ && wic --generate_schemas
run: cd workflow-inference-compiler/ && 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 WIC Python API Workflows (*.py -> *.wic)
- name: Validate Sophios Python API Workflows (*.py -> *.wic)
if: always()
run: cd workflow-inference-compiler/ && python -c 'import wic; import wic.plugins; wic.plugins.blindly_execute_python_workflows()'
run: cd workflow-inference-compiler/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'

- name: cwl-docker-extract (i.e. recursively docker pull)
if: always()
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/run_workflows_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,20 +114,20 @@ jobs:
# (Many of the packages conflict with pypy.)
run: cd mm-workflows/ && pip install ".[test]" && mm-workflows --generate_schemas

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

- name: Generate WIC Validation Jsonschema
- name: Generate Sophios Validation Jsonschema
if: always()
run: cd workflow-inference-compiler/ && wic --generate_schemas
run: cd workflow-inference-compiler/ && 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 WIC Python API Workflows (*.py -> *.wic)
# Sophios 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 wic; import wic.plugins; wic.plugins.blindly_execute_python_workflows()'
run: cd workflow-inference-compiler/ && python -c 'import sophios; import sophios.plugins; sophios.plugins.blindly_execute_python_workflows()'

- name: cwl-docker-extract (i.e. recursively docker pull)
if: always()
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test_and_publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:
with:
python-version: 3.9

- name: Install wic 🔧
- 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 wic
- name: Build sophios
run: |
python -m pip install twine build
Expand All @@ -36,5 +36,6 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m build
python -m build --wheel
python -m build --sdist
twine upload dist/*
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include versioneer.py
include src/wic/_version.py
include src/sophios/_version.py
64 changes: 32 additions & 32 deletions docs/dev/api.rst
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
Developer API
====================================

wic.ast
sophios.ast
------------------------------------
.. automodule:: wic.ast
.. automodule:: sophios.ast

wic.cli
sophios.cli
------------------------------------
.. automodule:: wic.cli
.. automodule:: sophios.cli

wic.compiler
sophios.compiler
------------------------------------
.. automodule:: wic.compiler
.. automodule:: sophios.compiler

wic.cwl_subinterpreter
sophios.cwl_subinterpreter
------------------------------------
.. automodule:: wic.cwl_subinterpreter
.. automodule:: sophios.cwl_subinterpreter

wic.inference
sophios.inference
------------------------------------
.. automodule:: wic.inference
.. automodule:: sophios.inference

wic.inlineing
sophios.inlineing
------------------------------------
.. automodule:: wic.inlineing
.. automodule:: sophios.inlineing

wic.input_output
sophios.input_output
------------------------------------
.. automodule:: wic.input_output
.. automodule:: sophios.input_output

wic.main
sophios.main
------------------------------------
.. automodule:: wic.main
.. automodule:: sophios.main

wic.plugins
sophios.plugins
------------------------------------
.. automodule:: wic.plugins
.. automodule:: sophios.plugins

wic.python_cwl_adapter
sophios.python_cwl_adapter
------------------------------------
.. automodule:: wic.python_cwl_adapter
.. automodule:: sophios.python_cwl_adapter

wic.run_local
sophios.run_local
------------------------------------
.. automodule:: wic.run_local
.. automodule:: sophios.run_local

wic.schemas.wic_schema
sophios.schemas.wic_schema
------------------------------------
.. automodule:: wic.schemas.wic_schema
.. automodule:: sophios.schemas.wic_schema

wic.utils
sophios.utils
------------------------------------
.. automodule:: wic.utils
.. automodule:: sophios.utils

wic.utils_cwl
sophios.utils_cwl
------------------------------------
.. automodule:: wic.utils_cwl
.. automodule:: sophios.utils_cwl

wic.utils_graphs
sophios.utils_graphs
------------------------------------
.. automodule:: wic.utils_graphs
.. automodule:: sophios.utils_graphs

wic.wic_types
sophios.wic_types
------------------------------------
.. automodule:: wic.wic_types
.. automodule:: sophios.wic_types
2 changes: 1 addition & 1 deletion examples/scripts/scatter_pyapi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from wic.api.pythonapi import Step, Workflow
from sophios.api.pythonapi import Step, Workflow


def small_workflow() -> Workflow:
Expand Down
36 changes: 18 additions & 18 deletions ipycytoscape.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"from pathlib import Path\n",
"\n",
"import wic\n",
"import wic.cli\n",
"import wic.plugins\n",
"import sophios.cli\n",
"import sophios.plugins\n",
"\n",
"args = wic.cli.get_args()\n",
"args = sophios.cli.get_args()\n",
"\n",
"tools_cwl = wic.plugins.get_tools_cwl(args.homedir)\n",
"yml_paths = wic.plugins.get_yml_paths(args.homedir)"
"tools_cwl = sophios.plugins.get_tools_cwl(args.homedir)\n",
"yml_paths = sophios.plugins.get_yml_paths(args.homedir)"
]
},
{
Expand All @@ -37,17 +37,17 @@
"import networkx as nx\n",
"import yaml\n",
"\n",
"import wic.ast, wic.utils, wic.utils_graphs\n",
"from wic.schemas import wic_schema\n",
"from wic.utils_yaml import wic_loader\n",
"from wic.wic_types import Yaml, YamlTree, GraphReps, NodeData, GraphData, StepId\n",
"import sophios.ast, sophios.utils, sophios.utils_graphs\n",
"from sophios.schemas import wic_schema\n",
"from sophios.utils_yaml import wic_loader\n",
"from sophios.wic_types import Yaml, YamlTree, GraphReps, NodeData, GraphData, StepId\n",
"\n",
"yml_path_str = 'tutorial'\n",
"yml_namespace = 'global'\n",
"yml_path = yml_paths[yml_namespace][yml_path_str]\n",
"\n",
"# Generate schemas for validation and vscode IntelliSense code completion\n",
"yaml_stems = wic.utils.flatten([list(p) for p in yml_paths.values()])\n",
"yaml_stems = sophios.utils.flatten([list(p) for p in yml_paths.values()])\n",
"validator = wic_schema.get_validator(tools_cwl, yaml_stems, write_to_disk=True)\n",
"\n",
"# Load the high-level yaml workflow file.\n",
Expand All @@ -58,20 +58,20 @@
"plugin_ns = wic_tag['wic'].get('namespace', 'global')\n",
"step_id = StepId(yml_path_str, plugin_ns)\n",
"y_t = YamlTree(step_id, root_yaml_tree)\n",
"yaml_tree_raw = wic.ast.read_ast_from_disk(args.homedir, y_t, yml_paths, tools_cwl, validator)\n",
"yaml_tree_raw = sophios.ast.read_ast_from_disk(args.homedir, y_t, yml_paths, tools_cwl, validator)\n",
"with open(f'autogenerated/{Path(yml_path).stem}_tree_raw.wic', mode='w', encoding='utf-8') as f:\n",
" f.write(yaml.dump(yaml_tree_raw.yml))\n",
"yaml_tree = wic.ast.merge_yml_trees(yaml_tree_raw, {}, tools_cwl)\n",
"yaml_tree = sophios.ast.merge_yml_trees(yaml_tree_raw, {}, tools_cwl)\n",
"with open(f'autogenerated/{Path(yml_path).stem}_tree_merged.wic', mode='w', encoding='utf-8') as f:\n",
" f.write(yaml.dump(yaml_tree.yml))\n",
"root_yml_dir_abs = Path(yml_path).parent.absolute()\n",
"yaml_tree = wic.ast.python_script_generate_cwl(yaml_tree, root_yml_dir_abs, tools_cwl)\n",
"yaml_tree = sophios.ast.python_script_generate_cwl(yaml_tree, root_yml_dir_abs, tools_cwl)\n",
"with open(f'autogenerated/{Path(yml_path).stem}_tree_python_script.wic', mode='w', encoding='utf-8') as f:\n",
" f.write(yaml.dump(yaml_tree.yml))\n",
"\n",
"\n",
"yaml_forest = wic.ast.tree_to_forest(yaml_tree, tools_cwl)\n",
"yaml_forest_lst = wic.utils.flatten_forest(yaml_forest)\n",
"yaml_forest = sophios.ast.tree_to_forest(yaml_tree, tools_cwl)\n",
"yaml_forest_lst = sophios.utils.flatten_forest(yaml_forest)\n",
"yaml_subtrees_lst = [subforest.yaml_tree for subforest in yaml_forest_lst]\n",
"yaml_subtrees = {t.step_id.stem:t.yml for t in yaml_subtrees_lst}\n",
"#print(yaml_subtrees.keys())\n",
Expand All @@ -82,7 +82,7 @@
"graph_nx = nx.DiGraph()\n",
"graphdata = GraphData(yml_path)\n",
"graph = GraphReps(graph_gv, graph_nx, graphdata)\n",
"compiler_info = wic.compiler.compile_workflow(yaml_tree, args, [], [graph], {}, {}, tools_cwl, True, relative_run_path=True, testing=False)\n",
"compiler_info = sophios.compiler.compile_workflow(yaml_tree, args, [], [graph], {}, {}, tools_cwl, True, relative_run_path=True, testing=False)\n",
"rose_tree = compiler_info.rose\n",
"sub_node_data: NodeData = rose_tree.data\n",
"yaml_stem = sub_node_data.name"
Expand All @@ -95,10 +95,10 @@
"outputs": [],
"source": [
"gd = sub_node_data.graph.graphdata\n",
"gd_flat = wic.utils_graphs.flatten_graphdata(gd)\n",
"gd_flat = sophios.utils_graphs.flatten_graphdata(gd)\n",
"#print(len(gd_flat.nodes))\n",
"#print(len(gd_flat.edges))\n",
"json_cyto = wic.utils_graphs.graphdata_to_cytoscape(gd_flat)\n",
"json_cyto = sophios.utils_graphs.graphdata_to_cytoscape(gd_flat)\n",
"#import json\n",
"#json.dumps(json_cyto)"
]
Expand Down
Loading

0 comments on commit ad81195

Please sign in to comment.