Skip to content

Commit

Permalink
Add some workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
jg-rp committed Dec 20, 2024
1 parent 45ee2a1 commit 6a0f509
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: jg-rp
17 changes: 17 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: lint
on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade hatch
- run: hatch run lint
26 changes: 26 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: tests
on: [push, pull_request]

jobs:
tests:
name: ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade hatch
- name: Test
run: hatch run test
17 changes: 17 additions & 0 deletions .github/workflows/typing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: typing
on: [push, pull_request]

jobs:
typing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade hatch
- run: hatch run typing
1 change: 1 addition & 0 deletions liquid2/builtin/filters/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# noqa: D104
1 change: 1 addition & 0 deletions liquid2/builtin/loaders/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# noqa: D104
2 changes: 2 additions & 0 deletions liquid2/builtin/loaders/file_system_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def get_source(
context: RenderContext | None = None, # noqa: ARG002
**kwargs: object, # noqa: ARG002
) -> TemplateSource:
"""Get source information for a template."""
source_path = self.resolve_path(template_name)
source, mtime = self._read(source_path)
return TemplateSource(
Expand All @@ -105,6 +106,7 @@ async def get_source_async(
context: RenderContext | None = None, # noqa: ARG002
**kwargs: object, # noqa: ARG002
) -> TemplateSource:
"""Get source information for a template."""
loop = asyncio.get_running_loop()
source_path = await loop.run_in_executor(None, self.resolve_path, template_name)
source, mtime = await loop.run_in_executor(None, self._read, source_path)
Expand Down
1 change: 1 addition & 0 deletions liquid2/builtin/tags/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# noqa: D104
1 change: 1 addition & 0 deletions liquid2/shopify/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# noqa: D104
1 change: 1 addition & 0 deletions liquid2/shopify/tags/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# noqa: D104
1 change: 0 additions & 1 deletion performance/benchmark_001.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
import timeit
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,4 @@ convention = "google"
"liquid2/query/parse.py" = ["D102", "PLR2004"]
"liquid2/unescape.py" = ["PLR2004"]
"tests/*" = ["D100", "D101", "D104", "D103", "PLR2004", "FBT003"]
"performance/*" = ["D103", "PLR2004", "T201", "D100"]

0 comments on commit 6a0f509

Please sign in to comment.