From 2ddd94be898b6fd1b044e8d0517513fdd195a27f Mon Sep 17 00:00:00 2001 From: Ng Yu Yue Date: Sat, 14 Dec 2024 16:16:35 +0800 Subject: [PATCH] fix: workflow for testing package --- .github/workflows/test.yaml | 30 ++++++++++++---------- easygraph/classes/test_base_graph_class.py | 2 +- easygraph/classes/tests/test_graph.py | 1 - requirements.txt | 1 + 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5260e5c1..26332ea7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,28 +10,30 @@ jobs: fail-fast: false matrix: # ubuntu 22.04 has deprecated python 3.6 - python-version: [ "3.8", "3.9", "3.10","3.11", "3.12", "3.13"] + python-version: [ "3.8", "3.9", "3.10","3.11", "3.12"] steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: 'Build and install easygraph' - # still investigating issues, use the dummy workflow for now - # uses: tddschn/install-easygraph@master - uses: tddschn/install-easygraph/dummy@master + - name: Installing dependencies + uses: py-actions/py-dependency-install@v4 with: - # use current repo - repository: '${{ github.repository }}' - # use current branch - ref: '${{ github.ref }}' - install-pytorch: 'true' - install-lxml: 'true' - extra-modules-to-install: 'optuna torch_scatter torch_geometric' + path: "requirements.txt" + - name: Installing test dependencies + run: | + pip install pytest + + - name: Build and install package + run: | + pip install . - - uses: actions/checkout@v3 - name: Test with pytest run: | - pytest --disable-warnings + pytest --disable-warnings --ignore=cpp_easygraph diff --git a/easygraph/classes/test_base_graph_class.py b/easygraph/classes/test_base_graph_class.py index bd79cabe..1f9929e3 100644 --- a/easygraph/classes/test_base_graph_class.py +++ b/easygraph/classes/test_base_graph_class.py @@ -2,7 +2,7 @@ import sys import time -import tests +import easygraph as eg print( diff --git a/easygraph/classes/tests/test_graph.py b/easygraph/classes/tests/test_graph.py index 25546331..965d1c37 100644 --- a/easygraph/classes/tests/test_graph.py +++ b/easygraph/classes/tests/test_graph.py @@ -4,7 +4,6 @@ # sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),'..', '..'))) import easygraph as eg # Spend 4.9s on importing this damn big lib. -import tests """ diff --git a/requirements.txt b/requirements.txt index 0b5ecb00..056ca6da 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,4 @@ nose>=1.3.7 pybind11>=2.10.4 pydsge torch >= 1.12.1 +requests \ No newline at end of file