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 piccolo/columns/combination.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@


class CombinableMixin(object):

__slots__ = ()

def __and__(self, value: Combinable) -> "And":
return And(self, value) # type: ignore

Expand Down Expand Up @@ -86,6 +89,8 @@ class Undefined:


class WhereRaw(CombinableMixin):
__slots__ = ("querystring",)

def __init__(self, sql: str, *args: t.Any) -> None:
"""
Execute raw SQL queries in your where clause. Use with caution!
Expand Down
4 changes: 2 additions & 2 deletions piccolo/query/methods/alter.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def ddl(self) -> str:

@dataclass
class AddColumn(AlterColumnStatement):
__slots__ = ("column", "name")
__slots__ = ("name",)

column: Column
name: str
Expand Down Expand Up @@ -120,7 +120,7 @@ def ddl(self) -> str:

@dataclass
class SetDefault(AlterColumnStatement):
__slots__ = ("column", "value")
__slots__ = ("value",)

column: Column
value: t.Any
Expand Down
1 change: 1 addition & 0 deletions requirements/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ipdb==0.13.9
ipython>=7.31.1
flake8==4.0.1
isort==5.10.1
slotscheck==0.12.0
twine==3.7.1
mypy==0.931
pip-upgrader==1.4.15
Expand Down
7 changes: 6 additions & 1 deletion scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
set -e

SOURCES="piccolo tests"
MODULES="piccolo"
SOURCES="$MODULES tests"

echo "Running isort..."
isort --check $SOURCES
Expand All @@ -19,4 +20,8 @@ echo "Running mypy..."
mypy $SOURCES
echo "-----"

echo "Running slotscheck..."
python -m slotscheck $MODULES
echo "-----"

echo "All passed!"