Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
50 changes: 32 additions & 18 deletions .github/workflows/continuous_integration.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: Continuous Integration

on:
push:
tags-ignore: ['*']
branches:
- '**'
paths-ignore:
- '**/*.md'
pull_request:
branches:
- main
paths-ignore:
- '**/*.md'
- '**/*.yaml'
- '**/*.yml'
- '**/*.toml'

env:
POETRY_VERSION: 2.0.0
UV_VERSION: 0.7.7

jobs:
lint_and_type_check:
Expand All @@ -29,19 +26,19 @@ jobs:
with:
python-version: "3.9"

- name: Install Poetry
- name: Install UV
run: |
curl -sSL https://install.python-poetry.org | python3 - --version ${{ env.POETRY_VERSION }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
curl -LsSf "https://astral.sh/uv/${{ env.UV_VERSION }}/install.sh" | sh

- name: Install dependencies
run: poetry install --no-interaction
run: uv sync

- name: Run ruff
run: poetry run ruff check snappylapy --output-format=github
run: uv run ruff check snappylapy --output-format=github

- name: Run mypy
run: poetry run mypy snappylapy
if: always()
run: uv run mypy snappylapy

test:
runs-on: ubuntu-latest
Expand All @@ -59,13 +56,30 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
- name: Install UV
run: |
curl -sSL https://install.python-poetry.org | python3 - --version ${{ env.POETRY_VERSION }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
curl -LsSf "https://astral.sh/uv/${{ env.UV_VERSION }}/install.sh" | sh

- name: Install dependencies
run: poetry install --no-interaction
run: uv sync

- name: Run tests
run: poetry run pytest tests/
run: uv run pytest tests/ --junit-xml=test-results.xml

- name: Surface failing tests
if: always()
uses: pmeier/pytest-results-action@main
with:
# A list of JUnit XML files, directories containing the former, and wildcard
# patterns to process.
# See @actions/glob for supported patterns.
path: test-results.xml

# (Optional) Add a summary of the results at the top of the report
summary: true

# (Optional) Fail the workflow if no JUnit XML was found.
fail-on-empty: true

# (Optional) Title of the test results section in the workflow summary
title: Test results
18 changes: 9 additions & 9 deletions .github/workflows/mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
- "[0-9]+\\.[0-9]+\\.[0-9]+b[0-9]+"
- "[0-9]+\\.[0-9]+\\.[0-9]+rc[0-9]+"

env:
UV_VERSION: 0.7.7

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
Expand Down Expand Up @@ -43,19 +46,16 @@ jobs:
with:
python-version: '3.9'

# Install dependencies using Poetry
- uses: Gr1N/setup-poetry@v9
- uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
- run: poetry --version
- run: poetry install
# Install dependencies using UV
- name: Install UV
id: uv
run: |
curl -LsSf "https://astral.sh/uv/${{ env.UV_VERSION }}/install.sh" | sh

# Build documentation to ./site/ directory
- name: Build Documentation
id: build
run: poetry run mkdocs build
run: uv run mkdocs build

# Upload artifact from the ./site/ directory using the expected format for GitHub Pages
- name: Upload Artifact
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
PACKAGE_NAME: "snappylapy"
POETRY_VERSION: 2.0.0
UV_VERSION: 0.7.7

jobs:
details:
Expand Down Expand Up @@ -76,21 +76,20 @@ jobs:
with:
python-version: "3.12"

- name: Install Poetry
- name: Install UV
run: |
curl -sSL https://install.python-poetry.org | python3 - --version ${{ env.POETRY_VERSION }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
curl -LsSf "https://astral.sh/uv/${{ env.UV_VERSION }}/install.sh" | sh
- name: Set project version with Poetry
run: |
poetry version ${{ needs.details.outputs.new_version }}
# - name: Set project version with Poetry
# run: |
# poetry version ${{ needs.details.outputs.new_version }}

- name: Install dependencies
run: poetry install --sync --no-interaction
# - name: Install dependencies
# run: poetry install --sync --no-interaction

- name: Build source and wheel distribution
run: |
poetry build
uv build
- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Ignore test results from snappylapy
__test_results__/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9
8 changes: 7 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"[python]": {
"editor.rulers": [
88,
120
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "John Doe",
"age": 31
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name": "John Doe", "age": 31}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"John Doe",
31
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "John Doe",
"age": 31
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello Galaxy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello Universe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('Hello World')
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World
Loading