Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ runs:

steps:
- name: Install uv
uses: astral-sh/setup-uv@v6
uses: astral-sh/setup-uv@v8.3.2
with:
python-version: ${{ inputs.python-version }}
activate-environment: true
Comment on lines 23 to 27

- name: Cache uv virtual environment
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: .venv
key: uv-venv-${{ runner.os }}-py-${{ inputs.python-version }}-cuda-${{ inputs.cuda-version }}
Expand All @@ -46,7 +46,7 @@ runs:

- name: Set up TeX Live
if: ${{ inputs.full_install == 'true' }}
uses: TeX-Live/setup-texlive-action@v3
uses: TeX-Live/setup-texlive-action@v4
with:
cache: true
packages: |
Comment on lines 47 to 52
Expand Down Expand Up @@ -79,11 +79,8 @@ runs:
python3-dev
libcairo2-dev
libpango1.0-dev
ffmpeg

- name: Install ffmpeg
if: ${{ inputs.full_install == 'true' }}
uses: FedericoCarboni/setup-ffmpeg@v3

- name: Install optional Python dependencies
if: ${{ inputs.full_install == 'true' }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docstring_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
# Only run workflow if certain files have been changed.
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v47
with:
Comment on lines 18 to 22
files: |
.github/workflows/notebook_testing.yml
.github/workflows/docstring_testing.yml
src/**
tests/**
pyproject.toml
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/full_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,13 @@ jobs:

- name: Run tests
run: |
pytest
pytest -m "not network and not benchmark and not gpu"
shell: bash

# Tests that depend on reaching external network services (e.g. networks.skewed.de)
# are flaky in CI, so they run separately and don't fail the build.
- name: Run network-dependent tests
continue-on-error: true
run: |
pytest -m network --no-cov
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/notebook_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# Only run workflow if certain files have been changed.
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v47
with:
Comment on lines 18 to 22
files: |
.github/workflows/notebook_testing.yml
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# Only run workflow if certain files have been changed.
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v47
with:
Comment on lines 20 to 23
files: |
.github/workflows/testing.yml
Expand All @@ -34,4 +34,12 @@ jobs:
- name: Run tests
if: steps.changed-files.outputs.any_changed == 'true'
run: |
pytest
pytest -m "not network and not benchmark and not gpu"

# Tests that depend on reaching external network services (e.g. networks.skewed.de)
# are flaky in CI, so they run separately and don't fail the build.
- name: Run network-dependent tests
if: steps.changed-files.outputs.any_changed == 'true'
continue-on-error: true
run: |
pytest -m network --no-cov
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ pythonpath = ["src"]
testpaths = "tests"
markers = [
"benchmark: marks tests as benchmarking tests (deselect with '-m \"not benchmark\"')",
"gpu: marks tests that require GPU support (deselect with '-m \"not gpu\"')"
"gpu: marks tests that require GPU support (deselect with '-m \"not gpu\"')",
"network: marks tests that depend on reaching an external network service (deselect with '-m \"not network\"')"
]
addopts = "--cov=src -m \"not benchmark and not gpu\" --doctest-modules"
doctest_optionflags = "ELLIPSIS NORMALIZE_WHITESPACE"
Expand Down
7 changes: 7 additions & 0 deletions tests/io/test_netzschleuder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from pathpyG.io import list_netzschleuder_records, read_netzschleuder_graph, read_netzschleuder_record


@pytest.mark.network
def test_list_netzschleuder_records():
"""Test the list_netzschleuder_records() function."""
# Test the function with a valid URL.
Expand All @@ -20,6 +21,7 @@ def test_list_netzschleuder_records():
records = list_netzschleuder_records(url)


@pytest.mark.network
def test_node_attrs():
"""Test the extraction of node attributes."""
g = read_netzschleuder_graph("karate", "77")
Expand All @@ -28,6 +30,7 @@ def test_node_attrs():
assert "node_groups" in g.node_attrs()


@pytest.mark.network
def test_edge_attrs():
"""Test the extraction of edge attributes."""
# Original edge list:
Expand Down Expand Up @@ -65,13 +68,15 @@ def test_edge_attrs():
assert (g.data.edge_weight[mask] == weight).all()


@pytest.mark.network
def test_graph_attrs():
"""Test the extraction of graph attributes."""
g = read_netzschleuder_graph("karate", "77")
assert "analyses_diameter" in g.data
assert g.data.analyses_diameter == 5


@pytest.mark.network
def test_read_netzschleuder_record():
"""Test the read_netzschleuder_record() function."""
# Test the function with a valid URL.
Expand All @@ -86,6 +91,7 @@ def test_read_netzschleuder_record():
record = read_netzschleuder_record(record_name, url)


@pytest.mark.network
def test_read_netzschleuder_graph():
"""Test the read_netzschleuder_graph() function for timestamped data."""
g = read_netzschleuder_graph(name="email_company")
Expand All @@ -94,6 +100,7 @@ def test_read_netzschleuder_graph():
assert g.m == 5784


@pytest.mark.network
def test_read_netzschleuder_graph_temporal():
"""Test the read_netzschleuder_graph() function for timestamped data."""
g = read_netzschleuder_graph(name="email_company", time_attr="time", multiedges=True)
Expand Down
Loading