Skip to content

Commit 5955677

Browse files
authored
Merge pull request #580 from ISA-tools/develop
Develop
2 parents 1c2e893 + 6351ad0 commit 5955677

275 files changed

Lines changed: 43856 additions & 39064 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.

.github/workflows/buildandtestpython.yml

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,45 @@ name: Python package
33
on:
44
pull_request:
55
push:
6-
76
jobs:
87
build:
9-
108
runs-on: ubuntu-latest
119
strategy:
1210
matrix:
13-
python-version: ['3.9', '3.10', '3.11', '3.12']
14-
11+
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
1512
steps:
16-
- uses: actions/checkout@v4
17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: ${{ matrix.python-version }}
21-
- name: Download Test Data
22-
run: |
23-
bash -x get_test_data.sh
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install flake8 pytest
28-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29-
- name: Lint with flake8
30-
run: |
31-
# stop the build if there are Python syntax errors or undefined names
32-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
33-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
34-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
35-
- name: Test with python unittest
36-
run: |
37-
behave --no-capture --no-capture-stderr --format=progress features/isa-file-handler.feature
38-
coverage run -m unittest discover -s tests/
39-
coverage report -m
40-
- name: Coveralls
41-
uses: AndreMiras/coveralls-python-action@develop
42-
with:
43-
parallel: true
44-
flag-name: Unit Test
13+
- uses: actions/checkout@v4.2.2
14+
- name: Download Test Data
15+
run: |
16+
bash -x get_test_data.sh
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v6.3.0
19+
with:
20+
enable-cache: true
21+
cache-dependency-glob: uv.lock
22+
- name: Sync dependencies
23+
run: |
24+
uv python pin ${{ matrix.python-version }}
25+
uv sync --group dev
26+
- uses: astral-sh/ruff-action@v3
27+
- run: ruff check
28+
- run: ruff format
29+
- name: Test with python unittest
30+
run: |
31+
uv run --python ${{ matrix.python-version }} pytest
32+
uv run --python ${{ matrix.python-version }} coverage run -m unittest discover -s tests/
33+
uv run --python ${{ matrix.python-version }} coverage report -m
34+
- name: Coveralls
35+
uses: AndreMiras/coveralls-python-action@develop
36+
with:
37+
parallel: true
38+
flag-name: Unit Test
4539

4640
coveralls_finish:
4741
needs: build
4842
runs-on: ubuntu-latest
4943
steps:
50-
- name: Coveralls Finished
51-
uses: AndreMiras/coveralls-python-action@develop
52-
with:
53-
parallel-finished: true
44+
- name: Coveralls Finished
45+
uses: AndreMiras/coveralls-python-action@develop
46+
with:
47+
parallel-finished: true

.github/workflows/pythonpublish.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ jobs:
1313
uses: actions/setup-python@v4
1414
with:
1515
python-version: '3.x'
16-
- name: Install dependencies
16+
- name: Install uv
17+
uses: astral-sh/setup-uv@v6.3.0
18+
with:
19+
enable-cache: true
20+
cache-dependency-glob: uv.lock
21+
- name: Sync dependencies
1722
run: |
18-
python -m pip install --upgrade pip
19-
pip install setuptools wheel twine
23+
uv sync --no-dev
2024
- name: Build and publish
21-
env:
22-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2425
run: |
25-
python setup.py sdist bdist_wheel
26-
twine upload --verbose dist/*
26+
echo "Publishing to PyPI..."
27+
uv publish -t ${{ secrets.PYPI_TOKEN }}

.pre-commit-config.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
default_language_version:
2+
python: python3.13
3+
repos:
4+
- repo: https://github.com/abravalheri/validate-pyproject
5+
rev: v0.24.1
6+
hooks:
7+
- id: validate-pyproject
8+
name: 🔍 Validate pyproject.toml
9+
- repo: https://github.com/gitleaks/gitleaks
10+
rev: v8.28.0
11+
hooks:
12+
- id: gitleaks
13+
name: "🔒 Security · Detect hardcoded secrets"
14+
- repo: https://github.com/hukkin/mdformat
15+
rev: 0.7.22
16+
hooks:
17+
- id: mdformat
18+
name: "🟢 Markdown · Format markdown"
19+
- repo: https://github.com/pre-commit/pre-commit-hooks
20+
rev: v6.0.0
21+
hooks:
22+
- id: check-added-large-files
23+
name: 🟢 Check large files
24+
args: [ "--maxkb=2000" ]
25+
- id: check-toml
26+
name: 🟢 Check toml files
27+
- id: check-json
28+
name: 🟢 Check json files
29+
- id: pretty-format-json
30+
name: 🟢 Format json files
31+
args:
32+
- "--autofix"
33+
- "--indent=4"
34+
- "--no-sort-keys"
35+
- id: check-yaml
36+
name: 🟢 Check yaml files
37+
args:
38+
- --unsafe
39+
- id: end-of-file-fixer
40+
name: 🟢 Check end of file character
41+
exclude: resources/.+\.(js|css)$
42+
- id: trailing-whitespace
43+
name: 🟢 Check trailing whitespaces
44+
exclude: (tests/data/.+|resources/.+\.(js|css))$
45+
- repo: https://github.com/astral-sh/uv-pre-commit
46+
rev: 0.9.1
47+
hooks:
48+
- id: uv-lock
49+
name: ✅ Check uv.lock file
50+
- repo: https://github.com/lk16/detect-missing-init
51+
rev: v0.1.6
52+
hooks:
53+
- id: detect-missing-init
54+
name: 🔍 Detect missing __init__.py files
55+
args: [ "--create", "--track", "--python-folders", "isatools" ]
56+
- repo: https://github.com/astral-sh/ruff-pre-commit
57+
rev: v0.14.0
58+
hooks:
59+
- id: ruff-check
60+
name: 🔍 Check Format with Ruff
61+
args:
62+
- --exit-non-zero-on-fix
63+
- --no-cache
64+
- id: ruff-format
65+
name: 🐍 python · Format with Ruff
66+
- repo: https://github.com/seddonym/import-linter.git
67+
rev: "v2.5.2"
68+
hooks:
69+
- id: import-linter
70+
name: 🪵 architecture and package structure check (lint-imports)
71+
language: python
72+
args: [ "--no-cache" ]

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.9.0
1+
3.13

README.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,76 @@ The documentation to install and use the ISA-API (v0.14.3 and above) can be foun
6262

6363
For the previous versions (up to v0.11) check the documentation [here](https://isatools.readthedocs.io/en/latest/).
6464

65+
6566
Contributing
6667
------------
6768
The ISA-API is still in development. We would be very happy to receive any help and contributions (testing, feature requests, pull requests). Please feel free to contact our development team at [isatools@googlegroups.com](mailto:isatools@googlegroups.com), or ask a question, report a bug or file a feature request in the GitHub issue tracker at [https://github.com/ISA-tools/isa-api/issues](https://github.com/ISA-tools/isa-api/issues).
69+
70+
71+
Setup Development Environment
72+
-----------------------------
73+
74+
```bash
75+
# install python package manager uv
76+
curl -LsSf https://astral.sh/uv/install.sh | sh
77+
78+
# add $HOME/.local/bin to your PATH, either restart your shell or run
79+
export PATH=$HOME/.local/bin:$PATH
80+
81+
# install git from https://git-scm.com/downloads
82+
# Linux command
83+
apt update; apt install git -y
84+
85+
# Mac command
86+
# brew install git
87+
88+
# clone project from github
89+
git clone https://github.com/ISA-tools/isa-api.git
90+
91+
cd isa-api
92+
93+
# install python if it is not installed
94+
uv python install 3.13
95+
96+
# uv python install 3.12
97+
# uv python install 3.11
98+
# uv python install 3.10
99+
100+
# pin a python version
101+
uv python pin 3.13
102+
103+
# install python dependencies
104+
uv sync
105+
106+
# install pre-commit to check repository integrity and format checking
107+
uv run pre-commit
108+
109+
# run package and module dependencies
110+
uv run lint-imports
111+
112+
# list all possible linters. selected linters are defined in pyproject.toml
113+
uv run ruff linter
114+
115+
# run lint tool
116+
uv run ruff check
117+
118+
# check specific linter
119+
uv run ruff check --select I
120+
121+
# check specific lint rule
122+
uv run ruff check --select F841
123+
124+
# check imports and update imports order
125+
uv run ruff check --select I --fix
126+
127+
# run format check
128+
uv run ruff format --check
129+
130+
# run unit tests with specific version
131+
uv run --python 3.11 pytest
132+
133+
uv run --python 3.13 pytest
134+
135+
# open your IDE (vscode, pycharm, etc.) and set python interpreter as .venv/bin/python
136+
137+
```

0 commit comments

Comments
 (0)