Skip to content

Commit 7142d03

Browse files
authored
Merge pull request #2 from VisLab/repo_setup
Initial refactoring and setup
2 parents 53af3b7 + 29192e7 commit 7142d03

83 files changed

Lines changed: 1947 additions & 348 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[run]
2+
branch = True
3+
omit =
4+
*/__init__.py
5+
*/venv/*
6+
*/tests/*
7+
**/tests/
8+
**/test/
9+
*/test*
10+
**/__init__.py
11+
**/_version.py
12+
13+
14+
[report]
15+
skip_empty = true

.gitattributes

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
hed/_version.py export-subst
2+
3+
# Set default behavior to automatically normalize line endings to LF
4+
* text=auto eol=lf
5+
6+
# Explicitly declare text files you want to always be normalized and converted to LF on checkout
7+
*.xml text eol=lf
8+
*.mediawiki text eol=lf
9+
*.tsv text eol=lf
10+
*.md text eol=lf
11+
*.rst text eol=lf
12+
*.txt text eol=lf
13+
*.py text eol=lf
14+
*.sh text eol=lf
15+
*.yml text eol=lf
16+
*.yaml text eol=lf
17+
*.json text eol=lf
18+
*.toml text eol=lf
19+
*.svg text eol=lf
20+
*.css text eol=lf
21+
*.js text eol=lf
22+
*.html text eol=lf
23+
24+
# Denote all files that are truly binary and should not be modified
25+
*.png binary
26+
*.jpg binary
27+
*.jpeg binary
28+
*.gif binary
29+
*.ico binary
30+
*.pdf binary
31+
*.zip binary
32+
*.gz binary
33+
*.tar binary
34+
*.mp3 binary
35+
*.mp4 binary
36+
*.mov binary
37+
*.avi binary
38+
*.exe binary
39+
*.dll binary
40+
*.so binary
41+
*.dylib binary
42+
*.class binary
43+
*.jar binary
44+
*.war binary

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
target-branch: "main"
6+
schedule:
7+
interval: "weekly"
8+
- package-ecosystem: "pip"
9+
directory: "/"
10+
target-branch: "main"
11+
schedule:
12+
interval: "weekly"

.github/workflows/black.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Black Code Formatter Check
2+
3+
on:
4+
push:
5+
branches: ["*"]
6+
pull_request:
7+
branches: ["*"]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
black:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v5
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v6
20+
with:
21+
python-version: "3.12"
22+
23+
- name: Install Black
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install black>=24.0.0
27+
28+
- name: Check code formatting with Black
29+
run: |
30+
black --check --diff --workers 1 .

.github/workflows/ci.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["*"]
6+
pull_request:
7+
branches: ["*"]
8+
9+
permissions:
10+
contents: read
11+
id-token: write
12+
13+
jobs:
14+
determine_version:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
matrix: ${{ steps.set-matrix.outputs.matrix }}
18+
steps:
19+
- id: set-matrix
20+
run: |
21+
if [[ "${{ github.event_name }}" == 'push' && "${{ github.ref }}" == 'refs/heads/main' ]]; then
22+
# Push to main branch
23+
echo 'matrix=["3.10", "3.11", "3.12", "3.13", "3.14"]' >> $GITHUB_OUTPUT
24+
elif [[ "${{ github.event_name }}" == 'pull_request' && "${{ github.event.pull_request.base.ref }}" == 'main' ]]; then
25+
# PR to main branch
26+
echo 'matrix=[ "3.10", "3.11", "3.12", "3.13", "3.14"]' >> $GITHUB_OUTPUT
27+
else
28+
echo 'matrix=["3.10", "3.13"]' >> $GITHUB_OUTPUT
29+
fi
30+
31+
build:
32+
needs: determine_version
33+
strategy:
34+
matrix:
35+
platform: [ubuntu-latest]
36+
python-version: ${{fromJson(needs.determine_version.outputs.matrix)}}
37+
38+
runs-on: ${{ matrix.platform }}
39+
40+
steps:
41+
- uses: actions/checkout@v5
42+
with:
43+
submodules: true
44+
45+
- name: Set up Python ${{ matrix.python-version }}
46+
uses: actions/setup-python@v6
47+
with:
48+
python-version: ${{ matrix.python-version }}
49+
50+
- uses: actions/cache@v4
51+
with:
52+
path: ${{ env.pythonLocation }}
53+
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('docs/requirements.txt') }}
54+
55+
# Install dependencies
56+
- name: Install dependencies
57+
run: |
58+
python -m pip install --upgrade pip
59+
pip install -r requirements.txt
60+
pip install -r docs/requirements.txt
61+
pip install -e .[test]
62+
63+
# Run spec tests without coverage for non Python 3.10
64+
- name: Run spec_test
65+
env:
66+
GITHUB_TOKEN: ${{ github.token }}
67+
continue-on-error: true
68+
run: |
69+
python -m unittest discover spec_tests
70+
71+
# Run unittest without coverage
72+
- name: Test with unittest
73+
env:
74+
GITHUB_TOKEN: ${{ github.token }}
75+
run: |
76+
python -m unittest discover tests

.github/workflows/ci_cov.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI_COV
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
11+
jobs:
12+
13+
build:
14+
strategy:
15+
matrix:
16+
platform: [ubuntu-latest]
17+
python-version: [ "3.10" ]
18+
19+
runs-on: ${{ matrix.platform }}
20+
21+
steps:
22+
- uses: actions/checkout@v5
23+
with:
24+
submodules: true
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v6
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
# Install dependencies
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install ruff -r requirements.txt -r docs/requirements.txt
36+
pip install -e .[test]
37+
38+
# Run ruff
39+
- name: Lint with ruff
40+
run: |
41+
ruff check . --output-format=github
42+
43+
# Run unittest with coverage
44+
- name: Test with unittest and coverage
45+
env:
46+
GITHUB_TOKEN: ${{ github.token }}
47+
run: |
48+
coverage run -m unittest discover tests
49+
50+
# Run spec tests with coverage
51+
- name: Run spec_test coverage
52+
env:
53+
GITHUB_TOKEN: ${{ github.token }}
54+
run: |
55+
coverage run --append -m unittest discover spec_tests
56+
coverage xml
57+
58+
# Upload coverage to qlty
59+
- name: Upload coverage to qlty
60+
uses: qltysh/qlty-action/coverage@v2
61+
with:
62+
oidc: true
63+
files: coverage.xml

.github/workflows/ci_windows.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI Windows
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
jobs:
10+
build:
11+
strategy:
12+
matrix:
13+
platform: [windows-latest]
14+
python-version: ["3.10", "3.11", "3.12"]
15+
16+
runs-on: ${{ matrix.platform }}
17+
18+
steps:
19+
- uses: actions/checkout@v5
20+
with:
21+
submodules: false
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v6
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- uses: actions/cache@v4
29+
with:
30+
path: ${{ env.pythonLocation }}
31+
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('docs/requirements.txt') }}
32+
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install -r requirements.txt
37+
pip install -e .[test]
38+
39+
- name: Test with unittest
40+
env:
41+
HED_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
run: |
43+
python -m unittest discover tests

.github/workflows/codespell.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Codespell
3+
4+
on:
5+
push:
6+
branches: [develop]
7+
pull_request:
8+
branches: [develop]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
codespell:
15+
name: Check for spelling errors
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v5
21+
- name: Codespell
22+
uses: codespell-project/actions-codespell@v2

0 commit comments

Comments
 (0)