Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: uv sync --dev

- name: Lint
run: uv run black . --check
run: uv run ruff check .

- name: Run tests
run: uv run pytest
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ uv run pytest
## Lint

```bash
uv run black . --check
uv run ruff check .
```

## Build
Expand Down
4 changes: 2 additions & 2 deletions cratedb_django/compiler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.db.models.sql.compiler import (
SQLCompiler,
) # noqa -- Import needed for re-imports.
SQLCompiler, # noqa: F401 Import needed for re-imports.
)

from django.db.models.sql.compiler import (
SQLInsertCompiler,
Expand Down
2 changes: 1 addition & 1 deletion cratedb_django/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def table_sql(self, model) -> tuple:
for field in partition_by:
check_field(model, field)

sql[0] += f" PARTITIONED BY ({", ".join(partition_by)})"
sql[0] += f" PARTITIONED BY ({', '.join(partition_by)})"

clustered_by = getattr(model._meta, "clustered_by", OMITTED)
if clustered_by is not OMITTED:
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ dependencies = [

[dependency-groups]
dev = [
"black>=25.1.0",
"django-stubs>=5.1.3",
"pytest-cratedb>=0.4.0",
"requests>=2.32.3",
"ruff>=0.14.10",
Copy link
Member

@amotl amotl Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this patch. Writing down the dependency for ruff is better like this, to not cause any behaviour drift, due to new formatting rules, and deprecations of older ones, coming from future releases.

Suggested change
"ruff>=0.14.10",
"ruff<0.15",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the clarification. I was checking other repositories and didn't understand this at first when I saw it. Now I understand why it's done this way.

Copy link
Member

@amotl amotl Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dependabot also understands this paradigm, and will submit corresponding patches, so maintainers can either merge without ado (if nothing changes), or accompany the PR with required adjustments about code formatting rules coming from a newer minor version of ruff.

]

[project.urls]
Expand All @@ -38,3 +38,7 @@ Documentation = "https://github.com/surister/cratedb-django"
Repository = "https://github.com/surister/cratedb-django.git"
GitHub = "https://github.com/surister/cratedb-django"
Changelog = "https://github.com/surister/cratedb-django/releases"


[tool.ruff]
line-length = 80
3 changes: 2 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import logging

import pytest
import os, django
import os
import django
from django.db import connection
from django.apps import apps

Expand Down
3 changes: 2 additions & 1 deletion tests/test_app/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime, uuid
import datetime
import uuid

from django.db.models import F

Expand Down
2 changes: 1 addition & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from cratedb_django import fields

from django.forms.models import model_to_dict
from django.db import connection, models
from django.db import connection
from django.test.utils import CaptureQueriesContext

from tests.utils import captured_queries
Expand Down
1,401 changes: 677 additions & 724 deletions uv.lock
Copy link
Member

@amotl amotl Dec 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Django adapter should also be treated as a library, because it is usually not installed standalone, but pulled in as a dependency. In this spirit, the lock file can be removed. Package consumers can't use it anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the information. So, from what I understand, in cases where the project is a library, it's good practice to include the lock file in the .gitignore file or simply remove it, right?

Large diffs are not rendered by default.

Loading