Skip to content

Commit e9825d6

Browse files
committed
Merge branch 'qmlcode-main'
2 parents 68a6c1a + 289b83d commit e9825d6

Some content is hidden

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

58 files changed

+2250
-1719
lines changed

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[report]
2+
exclude_also =
3+
def __repr__
4+
raise ValueError
5+
raise NotImplementedError

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish PyPI
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
10+
publish:
11+
name: Publish Release
12+
runs-on: "ubuntu-latest"
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Install the latest version of uv
18+
uses: astral-sh/setup-uv@v5
19+
20+
- run: sudo apt-get install -y gcc libomp-dev libopenblas-dev
21+
22+
- run: make env_uv
23+
24+
- name: Build package
25+
run: make build
26+
27+
- name: Publish package
28+
env:
29+
TWINE_USERNAME: __token__
30+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
31+
run: make upload

.github/workflows/test.macos.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test MacOS
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
12+
test:
13+
name: Testing ${{matrix.os}} py-${{matrix.python-version}}
14+
runs-on: ${{matrix.os}}
15+
16+
strategy:
17+
matrix:
18+
os: ['macos-latest']
19+
python-version: ['3.11', '3.12']
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Install the latest version of uv
25+
uses: astral-sh/setup-uv@v5
26+
27+
- run: which brew
28+
- run: brew install gcc openblas lapack libomp
29+
- run: ls /opt/homebrew/bin/
30+
- run: which gfortran-14
31+
32+
- run: FC=gfortran-14 make env_uv python_version=${{ matrix.python-version }}
33+
34+
- run: make test
35+
- run: make format
36+
- run: FC=gfortran-14 make build
37+
- run: make test-dist

.github/workflows/test.ubuntu.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Test Ubuntu
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
12+
test:
13+
name: Testing ${{matrix.os}} py-${{matrix.python-version}}
14+
runs-on: ${{matrix.os}}
15+
16+
strategy:
17+
matrix:
18+
os: ['ubuntu-latest']
19+
python-version: ['3.11', '3.12']
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Install the latest version of uv
25+
uses: astral-sh/setup-uv@v5
26+
27+
- run: sudo apt-get install -y gcc libomp-dev libopenblas-dev
28+
29+
- run: make env_uv python_version=${{ matrix.python-version }}
30+
31+
- run: make test
32+
- run: make format
33+
- run: make build
34+
- run: make test-dist

.github/workflows/test.yml

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

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
repos:
44

55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v3.4.0
6+
rev: v5.0.0
77
hooks:
88
- id: trailing-whitespace
99
exclude: ^tests/resources/
@@ -23,7 +23,7 @@ repos:
2323
args: ['--maxkb=3000']
2424

2525
- repo: https://github.com/myint/autoflake
26-
rev: v2.2.0
26+
rev: v2.3.1
2727
hooks:
2828
- id: autoflake
2929
name: Removes unused variables
@@ -48,15 +48,15 @@ repos:
4848
]
4949

5050
- repo: https://github.com/psf/black
51-
rev: 22.3.0
51+
rev: 24.10.0
5252
hooks:
5353
- id: black
5454
name: Fixes formatting
5555
language_version: python3
5656
args: ["--line-length=99"]
5757

5858
- repo: https://github.com/pycqa/flake8
59-
rev: 7.0.0
59+
rev: 7.1.1
6060
hooks:
6161
- id: flake8
6262
name: Checks pep8 style
@@ -71,7 +71,7 @@ repos:
7171
"--ignore=E501,E203,W503,E741",
7272
]
7373

74-
- repo: https://github.com/pseewald/fprettify
74+
- repo: https://github.com/fortran-lang/fprettify
7575
rev: v0.3.7
7676
hooks:
7777
- id: fprettify

Makefile

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
python=./env/bin/python
2-
mamba=mamba
1+
env=env
2+
python=./${env}/bin/python
3+
python_version=3.12
4+
conda=mamba
35
pkg=qmllib
46
pip=./env/bin/pip
57
pytest=pytest
@@ -9,14 +11,25 @@ version_file=src/qmllib/version.py
911

1012
.PHONY: build
1113

12-
all: env
14+
all: ${env}
1315

1416
## Setup
1517

1618
env:
17-
${mamba} env create -f ./environment_dev.yaml -p ./env --quiet
18-
${python} -m pre_commit install
19+
echo "TODO"
20+
21+
env_uv:
22+
which uv
23+
uv venv ${env} --python ${python_version}
24+
uv pip install -r requirements.txt --python ${python}
25+
uv pip install -e . --python ${python}
26+
make .git/hooks/pre-commit python=${python}
27+
28+
env_conda:
29+
which ${conda}
30+
${conda} env create -f ./environment.yaml -p ./${env} --quiet
1931
${python} -m pip install -e .
32+
make .git/hooks/pre-commit python=${python}
2033

2134
./.git/hooks/pre-commit:
2235
${python} -m pre_commit install
@@ -29,12 +42,15 @@ format:
2942
test:
3043
${python} -m pytest -rs ./tests
3144

45+
test-dist:
46+
${python} -m twine check dist/*
47+
3248
types:
3349
${python} -m monkeytype run $$(which ${pytest}) ./tests
34-
${python} -m monkeytype list-modules | grep ${pkg} | parallel -j${j} "${python} -m monkeytype apply {}"
50+
${python} -m monkeytype list-modules | grep ${pkg} | parallel -j${j} "${python} -m monkeytype apply {} > /dev/null && echo {}"
3551

3652
cov:
37-
${python} -m pytest -vrs --cov=${pkg} --cov-report html tests
53+
${python} -m pytest --cov=${pkg} --cov-config .coveragerc --cov-report html tests
3854

3955
compile:
4056
${python} _compile.py
@@ -53,11 +69,16 @@ VERSION_MINOR=$(shell echo ${VERSION} | cut -d'.' -f2)
5369
VERSION_MAJOR=$(shell echo ${VERSION} | cut -d'.' -f1)
5470
GIT_COMMIT=$(shell git rev-parse --short HEAD)
5571

72+
version:
73+
echo ${VERSION}
74+
75+
bump-version-auto:
76+
test $(git diff HEAD^ HEAD tests | grep -q "+def") && make bump-version-minor || make bump-version-patch
77+
5678
bump-version-dev:
5779
test ! -z "${VERSION}"
5880
test ! -z "${GIT_COMMIT}"
59-
exit 1
60-
# Not Implemented
81+
exit 1 # Not Implemented
6182

6283
bump-version-patch:
6384
test ! -z "${VERSION_PATCH}"
@@ -72,17 +93,31 @@ bump-version-major:
7293
echo "__version__ = \"$(shell awk 'BEGIN{print ${VERSION_MAJOR}+1}').0.0\"" > ${version_file}
7394

7495
commit-version-tag:
75-
git tag --list | grep -qix "${VERSION}"
96+
# git tag --list | grep -qix "${VERSION}"
7697
git commit -m "Release ${VERSION}" --no-verify ${version_file}
7798
git tag 'v${VERSION}'
7899

100+
gh-release:
101+
gh release create "v${VERSION}" \
102+
--repo="$${GITHUB_REPOSITORY}" \
103+
--title="$${GITHUB_REPOSITORY#*/} ${VERSION}" \
104+
--generate-notes
105+
106+
gh-has-src-changed:
107+
git diff HEAD^ HEAD src | grep -q "+"
108+
109+
gh-cancel:
110+
gh run cancel $${GH_RUN_ID}
111+
gh run watch $${GH_RUN_ID}
112+
79113
## Clean
80114

81115
clean:
82116
find ./src/ -type f \
83117
-name "*.so" \
84118
-name "*.pyc" \
85119
-name ".pyo" \
120+
-name ".mod" \
86121
-delete
87122
rm -rf ./src/*.egg-info/
88123
rm -rf *.whl

0 commit comments

Comments
 (0)