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
5 changes: 5 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"enabled": true
},
"packageRules": [
{
"matchFileNames": [".python-version"],
"matchDatasources": ["python-version"],
"enabled": false
},
{
"groupName": "all non-major dependencies",
"groupSlug": "all-nonmajor",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/primer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.3"
version: "0.9.18"
enable-cache: true

- name: Install python dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.3"
version: "0.9.18"

- name: Get project Version
id: project_version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.3"
version: "0.9.18"

- name: Create release branch
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.3"
version: "0.9.18"

- name: Set up Python
uses: actions/setup-python@v6
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
steps:
- name: Check out Repo
uses: actions/checkout@v6
Expand All @@ -48,7 +47,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.9.3"
version: "0.9.18"
python-version: ${{ matrix.py }}
enable-cache: true

Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.8.18
3.10
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## Breaking changes

- sqlfmt now requires Python 3.10+

### Formatting Changes and Bug Fixes

- sqlfmt no longer includes an extra trailing newline when writing formatted code to stdout.
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: check
check:
uv sync --group test --group static
uv sync --all-groups
uv run ruff format .
uv run ruff check . --fix
uv run pytest
Expand All @@ -13,10 +13,10 @@ unit:

.PHONY: lint
lint:
uv sync --group static
ruff format .
ruff check . --fix
mypy
uv sync --all-groups
uv run ruff format .
uv run ruff check . --fix
uv run mypy

.PHONY: profiling
profiling: .profiling/all.rstats
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

name = "shandy-sqlfmt"
version = "0.28.2"
requires-python = ">=3.8,<3.15"
requires-python = ">=3.10"
description = "sqlfmt formats your dbt SQL files so you don't have to."
authors = [
{ name = "Ted Conbeer", email = "[email protected]" }
Expand All @@ -18,7 +18,7 @@ classifiers = [
"Typing :: Typed",
]
dependencies = [
"click>=8.1,<8.2",
"click>=8.3,<8.4",
"tqdm>=4.67,<5",
"platformdirs>=2.4,<5.0",
"importlib_metadata>=8.0,<9; python_version < '3.10'",
Expand All @@ -40,17 +40,17 @@ dev = [
static = [
"ruff>=0.14.1",
"mypy>=1.14.1,<2",
"gitpython==3.1.44",
"black==24.8.0",
"gitpython==3.1.45",
"black==24.10.0",
]
test = [
"black==24.8.0",
"black==24.10.0",
"pytest>=8,<9",
"pytest-cov>=5,<6",
]
primer = [
"gitpython==3.1.44",
"black==24.8.0",
"gitpython==3.1.45",
"black==24.10.0",
]


Expand Down Expand Up @@ -94,7 +94,7 @@ only-include = [

[tool.ruff]

target-version = "py38"
target-version = "py310"


[tool.ruff.lint]
Expand All @@ -104,7 +104,7 @@ select = ["A", "B", "E", "F", "I"]

[tool.mypy]

python_version = "3.8"
python_version = "3.10"
files = [
"src/**/*.py",
"tests/**/*.py",
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def pytest_sessionstart(session: pytest.Session) -> None:

@pytest.fixture
def sqlfmt_runner() -> CliRunner:
return CliRunner(mix_stderr=False)
return CliRunner()


@pytest.fixture
Expand Down
18 changes: 14 additions & 4 deletions tests/unit_tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ def test_format_many_preformatted(
)
assert not any([res.has_changed for res in results]), "Changed preformatted file"
assert all(
[raw == res.source_path for raw, res in zip(preformatted_files, results)]
[
raw == res.source_path
for raw, res in zip(preformatted_files, results, strict=True)
]
), "Result stored a source path that doesn't match the raw path passed to api"


Expand All @@ -180,7 +183,10 @@ def test_format_many_unformatted(
)
assert all([res.has_changed for res in results]), "Did not change unformatted file"
assert all(
[raw == res.source_path for raw, res in zip(unformatted_files, results)]
[
raw == res.source_path
for raw, res in zip(unformatted_files, results, strict=True)
]
), "Result stored a source path that doesn't match the raw path passed to api"


Expand All @@ -207,7 +213,9 @@ def test_update_source_files_preformatted(
[
expected == actual
for expected, actual in zip(
expected_last_update_timestamps, actual_last_update_timestamps
expected_last_update_timestamps,
actual_last_update_timestamps,
strict=True,
)
]
), "Should not have written a new file for an unchanged result"
Expand Down Expand Up @@ -235,7 +243,9 @@ def test_update_source_files_unformatted(
assert all(
[
new > original
for original, new in zip(original_update_timestamps, new_update_timestamps)
for original, new in zip(
original_update_timestamps, new_update_timestamps, strict=True
)
]
), "Should have written a new file for an unchanged result"

Expand Down
Loading