Skip to content

Commit e395f3a

Browse files
committed
Update github workflow
1 parent daa295a commit e395f3a

File tree

6 files changed

+111
-128
lines changed

6 files changed

+111
-128
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v3
14-
- uses: chartboost/ruff-action@v1
14+
- uses: chartboost/ruff-action@v1
15+
with:
16+
src: './modules'

.github/workflows/test_codebase.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,31 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
os: [ubuntu-latest]
30-
python-version: ["3.10", "3.11"]
31-
torch-version: [2.0.1]
32-
include:
33-
- torch-version: 2.0.1
30+
python-version: [3.11.3]
3431

3532
steps:
36-
- uses: actions/checkout@v3
37-
- name: Set up Python ${{ matrix.python-version }}
38-
uses: actions/setup-python@v4
33+
- uses: actions/checkout@v4
34+
- name: Set up Python ${{matrix.python-version}}
35+
uses: actions/setup-python@v5
3936
with:
40-
python-version: ${{ matrix.python-version }}
41-
cache: "pip"
42-
cache-dependency-path: '**/pyproject.toml'
37+
python-version: ${{matrix.python-version}}
4338

44-
- name: Install PyTorch ${{ matrix.torch-version }}+cpu
45-
run: |
46-
pip install --upgrade pip setuptools wheel
47-
pip install torch==${{ matrix.torch-version}} --extra-index-url https://download.pytorch.org/whl/cpu
48-
pip install torch-scatter -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
49-
pip install torch-sparse -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
50-
pip install torch-cluster -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
51-
pip show pip
52-
- name: Install main package
39+
- uses: actions/cache@v4
40+
with:
41+
path: ~/.cache/pip
42+
key: ${{matrix.os}}-${{matrix.python-version}}-${{ hashFiles('pyproject.toml') }}
43+
44+
- name: Install dependencies
5345
run: |
54-
pip install -e .[all]
55-
- name: Run tests for codebase [pytest]
46+
python -m pip install --upgrade pip
47+
pip install pytest
48+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
49+
source env_setup.shs
50+
51+
- name: Test with pytest
5652
run: |
5753
pytest -n 2 --cov --cov-report=xml:coverage.xml test/transforms/feature_liftings test/transforms/liftings
54+
pytest test/tutorials/test_tutorials.py
5855
- name: Upload coverage
5956
uses: codecov/codecov-action@v3
6057
with:

.github/workflows/test_tutorials.yml

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
name: "Testing Tutorials"
1+
# name: "Testing Tutorials"
22

3-
on:
4-
workflow_dispatch:
5-
push:
6-
branches: [main,github-actions-test]
7-
paths-ignore:
8-
- 'docs/**'
9-
- 'README.md'
10-
- 'LICENSE.txt'
11-
- '.gitignore'
3+
# on:
4+
# workflow_dispatch:
5+
# push:
6+
# branches: [main,github-actions-test]
7+
# paths-ignore:
8+
# - 'docs/**'
9+
# - 'README.md'
10+
# - 'LICENSE.txt'
11+
# - '.gitignore'
1212

13-
pull_request:
14-
branches: [main]
15-
paths-ignore:
16-
- 'docs/**'
17-
- 'README.md'
18-
- 'LICENSE.txt'
19-
- '.gitignore'
13+
# pull_request:
14+
# branches: [main]
15+
# paths-ignore:
16+
# - 'docs/**'
17+
# - 'README.md'
18+
# - 'LICENSE.txt'
19+
# - '.gitignore'
2020

21-
# Disable debugger's warnings from nbconvert in test_tutorials.py
22-
env:
23-
PYDEVD_DISABLE_FILE_VALIDATION: 1
21+
# # Disable debugger's warnings from nbconvert in test_tutorials.py
22+
# env:
23+
# PYDEVD_DISABLE_FILE_VALIDATION: 1
2424

25-
jobs:
26-
test-all-tutorials-pytest:
27-
runs-on: ${{ matrix.os }}
25+
# jobs:
26+
# test-all-tutorials-pytest:
27+
# runs-on: ${{ matrix.os }}
2828

29-
strategy:
30-
fail-fast: false
31-
matrix:
32-
os: [ubuntu-latest]
33-
python-version: ["3.10", "3.11"]
34-
torch-version: [2.0.1]
35-
include:
36-
- torch-version: 2.0.1
29+
# strategy:
30+
# fail-fast: false
31+
# matrix:
32+
# os: [ubuntu-latest]
33+
# python-version: ["3.10", "3.11"]
34+
# torch-version: [2.0.1]
35+
# include:
36+
# - torch-version: 2.0.1
3737

38-
steps:
39-
- uses: actions/checkout@v3
40-
- name: Set up Python ${{ matrix.python-version }}
41-
uses: actions/setup-python@v4
42-
with:
43-
python-version: ${{ matrix.python-version }}
44-
cache: "pip"
45-
cache-dependency-path: "pyproject.toml"
38+
# steps:
39+
# - uses: actions/checkout@v3
40+
# - name: Set up Python ${{ matrix.python-version }}
41+
# uses: actions/setup-python@v4
42+
# with:
43+
# python-version: ${{ matrix.python-version }}
44+
# cache: "pip"
45+
# cache-dependency-path: "pyproject.toml"
4646

47-
- name: Install PyTorch ${{ matrix.torch-version }}+cpu
48-
run: |
49-
pip install --upgrade pip setuptools wheel
50-
pip install torch==${{ matrix.torch-version}} --extra-index-url https://download.pytorch.org/whl/cpu
51-
pip install torch-scatter -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
52-
pip install torch-sparse -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
53-
pip install torch-cluster -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
54-
- name: Install main package
55-
run: |
56-
pip install -e .[all]
57-
- name: Run tests for tutorials on all domains [pytest]
58-
run: |
59-
pytest test/tutorials/test_tutorials.py
47+
# - name: Install PyTorch ${{ matrix.torch-version }}+cpu
48+
# run: |
49+
# pip install --upgrade pip setuptools wheel
50+
# pip install torch==${{ matrix.torch-version}} --extra-index-url https://download.pytorch.org/whl/cpu
51+
# pip install torch-scatter -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
52+
# pip install torch-sparse -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
53+
# pip install torch-cluster -f https://data.pyg.org/whl/torch-${{ matrix.torch-version }}+cpu.html
54+
# - name: Install main package
55+
# run: |
56+
# pip install -e .[all]
57+
# - name: Run tests for tutorials on all domains [pytest]
58+
# run: |
59+
# pytest test/tutorials/test_tutorials.py

.pre-commit-config.yaml

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,12 @@ repos:
1717
- id: trailing-whitespace
1818
- id: requirements-txt-fixer
1919

20-
- repo: https://github.com/psf/black
21-
rev: 23.3.0
20+
- repo: https://github.com/astral-sh/ruff-pre-commit
21+
rev: v0.4.4
2222
hooks:
23-
- id: black-jupyter
23+
- id: ruff-format
2424

25-
- repo: https://github.com/pycqa/isort
26-
rev: 5.12.0
25+
- repo: https://github.com/numpy/numpydoc
26+
rev: v1.6.0
2727
hooks:
28-
- id : isort
29-
args : ["--profile=black", "--filter-files"]
30-
31-
#- repo: https://github.com/asottile/blacken-docs
32-
# rev: 1.13.0
33-
# hooks:
34-
# - id: blacken-docs
35-
# additional_dependencies: [black==23.3.0]
36-
37-
# - repo: https://github.com/pycqa/flake8
38-
# rev: 6.0.0
39-
# hooks:
40-
# - id: flake8
41-
# additional_dependencies: [flake8-docstrings, Flake8-pyproject]
28+
- id: numpydoc-validation

env_setup.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -l
2+
pip install --upgrade pip
3+
pip install -e '.[all]'
4+
5+
# Note that not all combinations of torch and CUDA are available
6+
# See https://github.com/pyg-team/pyg-lib to check the configuration that works for you
7+
TORCH="2.3.0" # available options: 1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.2.0, or 2.3.0
8+
CUDA="cpu" # if available, select the CUDA version suitable for your system
9+
# available options: cpu, cu102, cu113, cu116, cu117, cu118, or cu121
10+
pip install torch==${TORCH} --extra-index-url https://download.pytorch.org/whl/${CUDA}
11+
pip install pyg-lib torch-scatter torch-sparse torch-cluster -f https://data.pyg.org/whl/torch-${TORCH}+${CUDA}.html
12+
13+
#pytest
14+
15+
pre-commit install

pyproject.toml

Lines changed: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,20 @@ dependencies=[
3333
"matplotlib",
3434
"networkx",
3535
"pandas",
36-
"pyg-nightly",
3736
"decorator",
3837
"hypernetx < 2.0.0",
39-
"omegaconf",
4038
"trimesh",
4139
"spharapy",
40+
"wandb",
41+
"einops==0.7.0",
42+
"tabulate",
43+
"ipykernel",
44+
"notebook",
45+
"jupyterlab",
4246
"rich",
4347
"rootutils",
44-
"pytest",
4548
"toponetx @ git+https://github.com/pyt-team/TopoNetX.git",
4649
"topomodelx @ git+https://github.com/pyt-team/TopoModelX.git",
47-
"topoembedx @ git+https://github.com/pyt-team/TopoEmbedX.git",
4850

4951
]
5052

@@ -78,42 +80,22 @@ all = ["challenge-icml-2024[dev, doc]"]
7880
homepage="https://github.com/pyt-team/challenge-icml-2024.git"
7981
repository="https://github.com/pyt-team/challenge-icml-2024.git"
8082

81-
[tool.ruff]
83+
[tool.black]
84+
line-length = 79 # PEP 8 standard for maximum line length
85+
target-version = ['py310']
8286

83-
# Same as Black.
84-
line-length = 88
85-
indent-width = 4
87+
[tool.docformatter]
88+
wrap-summaries = 79
89+
wrap-descriptions = 79
8690

91+
[tool.ruff]
8792
target-version = "py310"
88-
extend-include = ["*.ipynb"]
89-
90-
[lint]
91-
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
92-
select = ["E4", "E7", "E9", "F"]
93-
ignore = []
94-
95-
# Allow fix for all enabled rules (when `--fix`) is provided.
96-
fixable = ["ALL"]
97-
unfixable = []
98-
99-
# Allow unused variables when underscore-prefixed.
100-
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
101-
102-
[format]
103-
# Like Black, use double quotes for strings.
104-
quote-style = "double"
105-
106-
# Like Black, indent with spaces, rather than tabs.
107-
indent-style = "space"
108-
109-
# Like Black, respect magic trailing commas.
110-
skip-magic-trailing-comma = false
111-
112-
# Like Black, automatically detect the appropriate line ending.
113-
line-ending = "auto"
93+
#extend-include = ["*.ipynb"]
94+
extend-exclude = ["test", "tutorials"]
95+
line-length = 79 # PEP 8 standard for maximum line length
11496

11597
[tool.ruff.format]
116-
docstring-code-format = true
98+
docstring-code-format = false
11799

118100
[tool.ruff.lint]
119101
select = [

0 commit comments

Comments
 (0)