From a0e894d98259c22a8c7648ac2f25409e3eef0b8b Mon Sep 17 00:00:00 2001 From: unna97 <31486108+unna97@users.noreply.github.com> Date: Tue, 18 Jul 2023 09:57:39 +0530 Subject: [PATCH 1/8] Add github action workflow for tests and upgrade isort --- .github/workflows/test.yml | 27 +++++++++++++++++++++++++++ .pre-commit-config.yaml | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e7bc98e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,27 @@ +name: Tests + +on: + - push + - pull_request + - workflow_dispatch + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ["3.9", "3.10", "3.11"] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements_dev.txt + - name: Run tests + run: pytest diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ccd391..4fafbdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: black - repo: https://github.com/pycqa/isort - rev: 5.10.1 + rev: 5.12.0 hooks: - id: isort name: isort (python) From c9d9a9a0dfc7b8828eeed5344b0a4aa244396331 Mon Sep 17 00:00:00 2001 From: unna97 <31486108+unna97@users.noreply.github.com> Date: Tue, 18 Jul 2023 10:08:37 +0530 Subject: [PATCH 2/8] Add the requirements.txt install --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e7bc98e..96523ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,5 +23,6 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements_dev.txt + pip install -r requirements.txt - name: Run tests run: pytest From 3a1fa3ca50df696fca1434e456704adabce41ff1 Mon Sep 17 00:00:00 2001 From: unna97 <31486108+unna97@users.noreply.github.com> Date: Tue, 18 Jul 2023 10:16:48 +0530 Subject: [PATCH 3/8] Upgrade matplotlib for compatibitlity --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 2230298..d98a843 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ appdirs==1.4.4 wget==3.2 requests>=2.22.0 tqdm==4.62.3 -matplotlib==3.4.3 +matplotlib==3.7.2 numpy>=1.19.5 pathos==0.2.8 networkx==2.6.3 From e21a7da0621efccb47f9557477806011f8039eb4 Mon Sep 17 00:00:00 2001 From: unna97 <31486108+unna97@users.noreply.github.com> Date: Tue, 18 Jul 2023 10:30:31 +0530 Subject: [PATCH 4/8] Update pytest version --- requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index 35df800..0bc738d 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -7,5 +7,5 @@ tox==3.14.0 coverage==4.5.4 Sphinx==1.8.5 twine==1.14.0 -pytest==6.2.4 +pytest==7.4.0 black==21.7b0 From eb45dea3e52364347d38360deeb40240da9412ac Mon Sep 17 00:00:00 2001 From: unna97 <31486108+unna97@users.noreply.github.com> Date: Tue, 18 Jul 2023 10:43:11 +0530 Subject: [PATCH 5/8] Recognised command with Windows --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 96523ae..d345717 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,4 +25,4 @@ jobs: pip install -r requirements_dev.txt pip install -r requirements.txt - name: Run tests - run: pytest + run: python -m pytest From fec53f3423a46362573f1ffff94580f9b2748776 Mon Sep 17 00:00:00 2001 From: unna97 <31486108+unna97@users.noreply.github.com> Date: Tue, 18 Jul 2023 11:00:57 +0530 Subject: [PATCH 6/8] Upgrade pip to check if tests work on Windows --- requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index 0bc738d..31b3b69 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,4 +1,4 @@ -pip==21.1 +pip==23.2 bump2version==0.5.11 wheel==0.38.1 watchdog==0.9.0 From 4f99069677d256e38a140a2d14cfd0d0bfdad433 Mon Sep 17 00:00:00 2001 From: unna97 <31486108+unna97@users.noreply.github.com> Date: Tue, 18 Jul 2023 11:18:46 +0530 Subject: [PATCH 7/8] Add pytest upload file --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d345717..f9cd739 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,3 +26,9 @@ jobs: pip install -r requirements.txt - name: Run tests run: python -m pytest + + - name: Upload a Test Results file + uses: actions/upload-artifact@v3.1.2 + with: + name: test-results + path: pytest.xml From 368f81771287c7d0546c31255a657db616b161dd Mon Sep 17 00:00:00 2001 From: unna97 <31486108+unna97@users.noreply.github.com> Date: Tue, 18 Jul 2023 11:42:59 +0530 Subject: [PATCH 8/8] Add the file to upload --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f9cd739..893bfdc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,10 +25,10 @@ jobs: pip install -r requirements_dev.txt pip install -r requirements.txt - name: Run tests - run: python -m pytest + run: python -m pytest --junitxml=pytest.xml - name: Upload a Test Results file uses: actions/upload-artifact@v3.1.2 with: name: test-results - path: pytest.xml + path: ${{ github.workspace }}/pytest.xml