Skip to content

Commit 5196d00

Browse files
authored
Update supported Python, move to pyproject.toml, and fix CI (#62)
1 parent 8b11361 commit 5196d00

15 files changed

Lines changed: 187 additions & 3464 deletions

File tree

.github/workflows/CI.yaml

Lines changed: 55 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,60 @@
11
name: CI
22

33
on:
4-
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
5-
# Existing codes likely still have "master" as the primary branch
6-
# Both are tracked here to keep legacy and new codes working
7-
push:
8-
branches:
9-
- "master"
10-
- "main"
11-
pull_request:
12-
branches:
13-
- "master"
14-
- "main"
15-
schedule:
16-
# Nightly tests run on master by default:
17-
# Scheduled workflows run on the latest commit on the default or base branch.
18-
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
19-
- cron: "0 0 * * *"
4+
# GitHub has started calling new repo's first branch "main" https://github.com/github/renaming
5+
# Existing codes likely still have "master" as the primary branch
6+
# Both are tracked here to keep legacy and new codes working
7+
push:
8+
branches:
9+
- "master"
10+
- "main"
11+
pull_request:
12+
branches:
13+
- "master"
14+
- "main"
15+
schedule:
16+
# Nightly tests run on master by default:
17+
# Scheduled workflows run on the latest commit on the default or base branch.
18+
# (from https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule)
19+
- cron: "0 0 * * *"
2020

2121
jobs:
22-
test:
23-
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
24-
runs-on: ${{ matrix.os }}
25-
strategy:
26-
matrix:
27-
os: [ubuntu-latest]
28-
python-version: ["3.10", "3.11", "3.12"]
29-
30-
steps:
31-
- uses: actions/checkout@v4
32-
33-
- name: Infos
34-
shell: bash
35-
run: |
36-
uname -a
37-
df -h
38-
ulimit -a
39-
40-
41-
# More info on options: https://github.com/conda-incubator/setup-miniconda
42-
- uses: conda-incubator/setup-miniconda@v3
43-
with:
44-
python-version: ${{ matrix.python-version }}
45-
environment-file: devtools/conda-envs/gninatorch-CI.yaml
46-
mamba-version: "*"
47-
channels: pytorch,conda-forge
48-
channel-priority: true
49-
activate-environment: gninatorch
50-
auto-update-conda: false
51-
auto-activate-base: false
52-
show-channel-urls: true
53-
54-
- name: Install package
55-
56-
# conda setup requires this special shell
57-
shell: bash -l {0}
58-
run: |
59-
python -m pip install . --no-deps
60-
conda list
61-
62-
63-
- name: Run tests
64-
65-
# conda setup requires this special shell
66-
shell: bash -l {0}
67-
68-
run: |
69-
pytest -v --cov=gninatorch --cov-report=xml --color=yes tests/ --nogpu
70-
71-
- name: CodeCov
72-
uses: codecov/codecov-action@v5
73-
with:
74-
files: ./coverage.xml
75-
flags: unittests
76-
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
22+
test:
23+
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}
24+
runs-on: ${{ matrix.os }}
25+
strategy:
26+
matrix:
27+
os: [ubuntu-latest]
28+
python-version: ["3.12", "3.13"]
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Infos
36+
shell: bash
37+
run: |
38+
uname -a
39+
df -h
40+
ulimit -a
41+
42+
- name: Install uv
43+
uses: astral-sh/setup-uv@v7
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
enable-cache: true
47+
cache-dependency-glob: "pyproject.toml"
48+
49+
- name: Install package
50+
run: uv sync --extra all --extra test
51+
52+
- name: Run tests
53+
run: uv run pytest -v --cov=gninatorch --cov-report=xml --color=yes tests/ --nogpu
54+
55+
- name: CodeCov
56+
uses: codecov/codecov-action@v5
57+
with:
58+
files: ./coverage.xml
59+
flags: unittests
60+
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ nohup.out
128128

129129
# ML Tracking
130130
mlruns/
131+
*.db
131132

132133
# macOS
133-
.DS_Store
134+
.DS_Store

devtools/conda-envs/gninatorch-CI.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

devtools/conda-envs/gninatorch.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

devtools/scripts/create_conda_env.py

Lines changed: 0 additions & 118 deletions
This file was deleted.

gninatorch/__init__.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
# Add imports here
44
# from .gninatorch import *
55

6-
# Handle versioneer
7-
from ._version import get_versions
6+
from ._version import __version__, __commit_id__
87

9-
versions = get_versions()
10-
__version__ = versions["version"]
11-
__git_revision__ = versions["full-revisionid"]
12-
del get_versions, versions
13-
14-
from . import _version
15-
16-
__version__ = _version.get_versions()["version"]
8+
__git_revision__ = __commit_id__ or ""

0 commit comments

Comments
 (0)