Skip to content

Commit

Permalink
Use shell.py and fix staticman file
Browse files Browse the repository at this point in the history
  • Loading branch information
lexicalunit committed Jul 12, 2024
1 parent a7dceff commit 4da7b0d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ poetry run python shell
From this shell you will be able to interact with the database using SpellBot models and code. For example:

```shell
$ poetry run python shell
$ poetry run python shell.py

In [1]: DatabaseSession.query(User).all()
Out[1]: []
Expand Down
4 changes: 0 additions & 4 deletions docs/assets/js/staticman.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
---
layout: null
---

(function ($) {
$('#new_comment').submit(function () {
const form = this;
Expand Down
9 changes: 5 additions & 4 deletions shell → shell.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/usr/bin/env python
from __future__ import annotations

Check warning on line 2 in shell.py

View check run for this annotation

Codecov / codecov/patch

shell.py#L2

Added line #L2 was not covered by tests

from os import environ

environ["DISABLE_UVLOOP"] = "1"

import nest_asyncio # noqa: E402
from asgiref.sync import async_to_sync # noqa: E402
from IPython import embed # noqa: E402
from spellbot.database import db_session_manager, initialize_connection # noqa: E402
import nest_asyncio
from asgiref.sync import async_to_sync
from IPython import embed
from spellbot.database import db_session_manager, initialize_connection

Check warning on line 11 in shell.py

View check run for this annotation

Codecov / codecov/patch

shell.py#L8-L11

Added lines #L8 - L11 were not covered by tests


@async_to_sync()
Expand Down
3 changes: 2 additions & 1 deletion tests/test_codebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ def test_annotations(self) -> None:
r" -path ./env -o "
r" -path ./venv -o "
r" -path ./.venv -o "
r" -path ./.git -o "
r" -path ./src/spellbot/migrations/versions -o "
r" -path ./src/spellbot/cogs "
r"\) -prune -o -name '*.py' "
r" -exec grep -HEoc 'from __future__ import annotations' {} \; "
r" | grep 0"
r" | grep ':0'"
),
)
assert output == "", "ensure that these files import annotations from __future__"
Expand Down

0 comments on commit 4da7b0d

Please sign in to comment.