Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update with latest changes from python project template #27

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9226512
Updated to ruff>=0.6.3 (from ruff==0.5.1)
ClaasRostock Oct 5, 2024
1e2427d
Updated to pyright>=1.1.378 (from pyright==1.1.371)
ClaasRostock Oct 5, 2024
bb887aa
Updated to sourcery>=1.22 (from sourcery==1.21)
ClaasRostock Oct 5, 2024
c0fb6c0
Updated to pytest>=8.3 (from pytest>=8.2)
ClaasRostock Oct 5, 2024
276bc68
Updated to Sphinx>=8.0 (from Sphinx>=7.3)
ClaasRostock Oct 5, 2024
c2a49ac
Updated to sphinx-argparse-cli>=1.17 (from sphinx-argparse-cli>=1.16)
ClaasRostock Oct 5, 2024
52f67da
Updated to myst-parser>=4.0 (from myst-parser>=3.0)
ClaasRostock Oct 5, 2024
34aa3fc
Updated to furo>=2024.8 (from furo>=2024.5)
ClaasRostock Oct 5, 2024
c57b8eb
GitHub workflows: Install dependencies: change from 'pip install' to …
ClaasRostock Oct 5, 2024
5399a39
updated CHANGELOG.md
ClaasRostock Oct 5, 2024
fdd683e
updated all project related files with latest changes from python_pro…
ClaasRostock Oct 6, 2024
6e4b651
.editorconfig : removed 'end_of_line = crlf' as this is handled via .…
ClaasRostock Oct 21, 2024
feaec39
resolved issues raised by ruff
ClaasRostock Oct 22, 2024
8425e42
src/ospx/utils/dict.py : changed back from `literal_eval()` to `eval()`
ClaasRostock Oct 22, 2024
2519e66
ruff.toml : reactivated several docstring rules
ClaasRostock Oct 22, 2024
ebb50c3
Corrected docstring formatting issues
ClaasRostock Oct 22, 2024
2cb73f2
.sourcery.yaml : added exclude for folder docs/build
ClaasRostock Oct 23, 2024
db5d5bf
replaced `UTC` with `timezone.utc` for compatibility with Python 3.10
ClaasRostock Oct 24, 2024
8b90c78
updated CHANGELOG.md
ClaasRostock Oct 24, 2024
93d2892
bumped version number to 0.2.15
ClaasRostock Oct 24, 2024
9809870
improved typing of numpy arrays
ClaasRostock Oct 24, 2024
62c7160
VS Code settings: Turned off automatic venv activation
ClaasRostock Oct 24, 2024
0087846
Sphinx documentation : Resolved issue that documentation of class mem…
ClaasRostock Nov 5, 2024
51d48d0
.github/workflows/publish_release.yml : Run publishing job from main …
ClaasRostock Nov 10, 2024
9f7a0a8
dependencies: updated to dictIO>=0.4.0b1 (from dictIO>=0.3.4)
ClaasRostock Nov 10, 2024
a69d1c0
ruff.toml : Allow __init__.py modules to re-export imported names
ClaasRostock Nov 10, 2024
0bbbc7a
code adapted to work with dictIO v0.4.0b6
ClaasRostock Nov 11, 2024
4ce34c2
bumped version number to 0.3.0b1
ClaasRostock Nov 11, 2024
eda78e6
bumped version number to 0.3.0b3
ClaasRostock Nov 11, 2024
8f1e20c
bumped version number to 0.3.0b4
ClaasRostock Nov 11, 2024
e408685
__init__.py's : re-exported imported names
ClaasRostock Nov 11, 2024
77896cf
bumped version number to 0.3.0b5
ClaasRostock Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[paths]
source =
src/ospx
*/site-packages/ospx

[run]
source = ospx
branch = True

[report]
fail_under = 10.0
show_missing = True
skip_covered = True
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ root = true
[*]
indent_style = space
indent_size = 4
end_of_line = crlf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Expand Down
32 changes: 32 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted
# to native line endings on checkout.
*.py text
*.cpp text
*.hpp text
*.c text
*.h text
*.json text
*.xml text
*.txt text
*.yml text
*.yaml text
*.toml text
*.rst text
*.ini text

# Declare files that will always have CRLF line endings on checkout.
*.vcproj text eol=crlf
*.sln text eol=crlf
*.md text eol=crlf

# Declare files that will always have LF line endings on checkout.
*.sh text eol=lf

# Declare files that will not be normalized regardless of their content.
*.jpg -text
*.png -text
*.gif -text
*.ico -text
25 changes: 12 additions & 13 deletions .github/workflows/_build_and_publish_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ jobs:
- name: Checkout active branch
uses: actions/checkout@v4
with:
fetch-depth: 1
lfs: true
- name: Install Python
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install uv
run: |
python -m pip install uv
- name: Install dependencies
run: |
uv pip install --system -r requirements-dev.txt
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --upgrade
- name: Print debugging information
run: |
echo "github.ref:" ${{github.ref}}
Expand All @@ -38,16 +38,15 @@ jobs:
git branch
git branch -a
git remote -v
python -V
pip list --not-required
pip list
uv run python -V
uv pip list

# Build documentation
- uses: sphinx-doc/github-problem-matcher@master
- name: Build documentation
run: |
cd docs
make html
uv run make html

- name: Clone and cleanup gh-pages branch
run: |
Expand Down
56 changes: 28 additions & 28 deletions .github/workflows/_build_package.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: Build Package

on: workflow_call

jobs:
build:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
lfs: true
- uses: actions/setup-python@v5
with:
python-version: '3.11'
name: Build Package

on: workflow_call

jobs:
build:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Install uv
run: |
python -m pip install uv
- name: Install build and twine
run: |
uv pip install --system build twine
- name: Run build
run: python -m build
- name: Run twine check
run: twine check --strict dist/*
- uses: actions/upload-artifact@v4
with:
path: ./dist/*.tar.gz
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Build source distribution and wheel
run: uv build
- name: Run twine check
run: uvx twine check --strict dist/*
- uses: actions/upload-artifact@v4
with:
path: |
dist/*.tar.gz
dist/*.whl
139 changes: 77 additions & 62 deletions .github/workflows/_code_quality.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,80 @@
name: Code Quality

on: workflow_call

jobs:
ruff_format:
runs-on: ubuntu-latest
name: ruff format
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
name: Code Quality

on: workflow_call

jobs:
ruff_format:
runs-on: ubuntu-latest
name: ruff format
steps:
- uses: actions/checkout@v4
- name: Install uv
run: |
python -m pip install uv
- name: Install dependencies
run: |
uv pip install --system -r requirements.txt
- name: Install ruff
run: |
uv pip install --system ruff==0.5.1
- name: Run ruff format
run: ruff format --diff .

ruff_check:
runs-on: ubuntu-latest
name: ruff check
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --upgrade
- name: Run ruff format
run: uv run ruff format --diff

ruff_check:
runs-on: ubuntu-latest
name: ruff check
steps:
- uses: actions/checkout@v4
- name: Install uv
run: |
python -m pip install uv
- name: Install dependencies
run: |
uv pip install --system -r requirements.txt
- name: Install ruff
run: |
uv pip install --system ruff==0.5.1
- name: Run ruff check
run: ruff check --diff .

pyright:
runs-on: ubuntu-latest
name: pyright
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --upgrade
- name: Run ruff check
run: uv run ruff check --diff

pyright:
runs-on: ubuntu-latest
name: pyright
steps:
- uses: actions/checkout@v4
- name: Install uv
run: |
python -m pip install uv
- name: Install dependencies
run: |
uv pip install --system -r requirements.txt
uv pip install --system pytest
- name: Install pyright
run: |
uv pip install --system pyright==1.1.371
- name: Run pyright
run: pyright .
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --upgrade
- name: Run pyright
run: uv run pyright

mypy:
runs-on: ubuntu-latest
name: mypy
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: "pyproject.toml"
- name: Install the project
run: uv sync --upgrade
- name: Run mypy
run: uv run mypy
17 changes: 0 additions & 17 deletions .github/workflows/_publish_package.yml

This file was deleted.

25 changes: 14 additions & 11 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,34 @@ on: workflow_call

jobs:
test:
name: Test on ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}}
name: Test on ${{matrix.python.version}}-${{matrix.platform.runner}}
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
toxenv: linux
- runner: windows-latest
toxenv: windows
- runner: macos-latest
python:
- version: '3.9'
toxenv: 'py39'
- version: '3.10'
toxenv: 'py310'
- version: '3.11'
toxenv: 'py311'
- version: '3.12'
toxenv: 'py312'
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v2
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install Python ${{ matrix.python.version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python.version }}
- name: Install tox
run: python -m pip install tox-uv
- name: Install the project
run: uv sync --upgrade -p ${{ matrix.python.version }} --no-dev
- name: Install pytest
run: |
uv pip install pytest
uv pip install pytest-cov
- name: Run pytest
run: tox -e ${{matrix.python.toxenv}}-${{matrix.platform.toxenv}}
run: uv run pytest --cov
Loading
Loading