Skip to content

Commit

Permalink
Merge pull request #692 from deepmodeling/zjgemi
Browse files Browse the repository at this point in the history
fix: vendor typeguard==2.13.3 fix: add unittest to github actions
  • Loading branch information
zjgemi authored Oct 24, 2023
2 parents ea3abf5 + cacb2cf commit 927c15e
Show file tree
Hide file tree
Showing 10 changed files with 1,475 additions and 10 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Python unit-tests

on:
- pull_request

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@master
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install .
pip install pytest
- name: Test
run: DFLOW_MODE=debug pytest -vs tests
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ six
python-dateutil
urllib3
certifi
typeguard==2.13.3
argo-workflows==5.0.0
jsonpickle
minio
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
packages=[
"dflow",
"dflow/python",
"dflow/python/vendor",
"dflow/python/vendor/typeguard",
"dflow/client",
"dflow/plugins",
],
Expand All @@ -31,7 +33,6 @@
"python-dateutil",
"urllib3",
"certifi",
"typeguard==2.13.3",
"argo-workflows==5.0.0",
"jsonpickle",
"minio",
Expand Down
3 changes: 1 addition & 2 deletions src/dflow/python/op.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@
from pathlib import Path
from typing import Dict, List, Set, Union

from typeguard import check_type

from ..argo_objects import ArgoObjectDict
from ..config import config
from ..context_syntax import GLOBAL_CONTEXT
from ..io import (InputArtifact, InputParameter, OutputArtifact,
OutputParameter, type_to_str)
from ..utils import dict2list, get_key, randstr, s3_config
from .vendor.typeguard import check_type
from .opio import OPIO, Artifact, BigParameter, OPIOSign, Parameter

iwd = os.getcwd()
Expand Down
5 changes: 1 addition & 4 deletions src/dflow/python/python_op_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from typing import Any, Dict, List, Optional, Type, Union

import jsonpickle
import typeguard

from .. import __path__
from ..common import S3Artifact
Expand Down Expand Up @@ -338,7 +337,6 @@ def __init__(self,
if upload_dflow:
python_packages += __path__
python_packages += jsonpickle.__path__
python_packages += typeguard.__path__

self.python_packages = None
if python_packages:
Expand Down Expand Up @@ -743,8 +741,7 @@ def convert_to_graph(self):
del g["resource"]
python_packages = []
for p in self.python_packages:
if self.upload_dflow and Path(p).name in [
"dflow", "jsonpickle", "typeguard"]:
if self.upload_dflow and Path(p).name in ["dflow", "jsonpickle"]:
continue
python_packages.append(str(p))
g["type"] = "PythonOPTemplate"
Expand Down
Loading

0 comments on commit 927c15e

Please sign in to comment.