This repository has been archived by the owner on Oct 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies + docs fixes (#38)
* Update with features * Add support for positional arguments; * Move to nox; * Update driver; * Fix tests for new EdgeDB's alpha release; * Fix docs;
- Loading branch information
Showing
38 changed files
with
964 additions
and
669 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,7 @@ jobs: | |
poetry install | ||
- name: Build MkDocs for Netlify | ||
run: | | ||
source .venv/bin/activate | ||
./scripts/docs.py build | ||
poetry run nox -s docs-build | ||
- name: Deploy to Netlify | ||
uses: nwtgck/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,4 @@ jobs: | |
poetry install | ||
- name: Run linters | ||
run: | | ||
source .venv/bin/activate | ||
./scripts/lint | ||
poetry run nox -s lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ jobs: | |
python-version: [3.7, 3.8] | ||
services: | ||
edgedb: | ||
image: edgedb/edgedb:latest | ||
image: edgedb/edgedb:1-alpha4 | ||
ports: | ||
- 5656:5656 | ||
steps: | ||
|
@@ -25,13 +25,15 @@ jobs: | |
pip install poetry==1.0 | ||
poetry config virtualenvs.in-project true | ||
poetry install | ||
- name: Install EdgeDB CLI | ||
run: | | ||
mkdir -p ~/.local/bin/ | ||
curl https://packages.edgedb.com/dist/linux-x86_64/edgedb-cli_latest > ~/.local/bin/edgedb | ||
chmod +x ~/.local/bin/edgedb | ||
- name: Run tests | ||
env: | ||
EDGEDB_DSN: edgedb://edgedb@localhost/edgedb | ||
run: | | ||
# sleep for 1 minute for EdgeDB bootstraping. | ||
# TODO: remove after release cli with --wait-until-available | ||
sleep 60 | ||
source .venv/bin/activate | ||
./scripts/test --cov-report=xml | ||
export PATH="$HOME/.local/bin:$PATH" | ||
poetry run nox -s test | ||
- uses: codecov/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: '3' | ||
|
||
services: | ||
edgedb: | ||
image: edgedb/edgedb:1-alpha4 | ||
ports: | ||
- 5656:5656 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,29 @@ | ||
from dataclasses import dataclass | ||
from typing import Set, cast | ||
from typing import Protocol, Set, Union, cast | ||
from uuid import UUID | ||
|
||
import edgedb | ||
from edgeql_queries import from_path | ||
import edgeql_queries | ||
|
||
|
||
@dataclass | ||
class EdgeDBObject: | ||
id: UUID | ||
EdgeDBFetcher = Union[edgedb.AsyncIOPool, edgedb.AsyncIOConnection] | ||
|
||
|
||
@dataclass | ||
class Person(EdgeDBObject): | ||
class Person(Protocol): | ||
id: UUID | ||
first_name: str | ||
last_name: str | ||
|
||
|
||
class Queries: | ||
async def select_users_by_last_name( | ||
self, conn: edgedb.AsyncIOConnection, last_name: str | ||
self, fetcher: EdgeDBFetcher, last_name: str, | ||
) -> Set[Person]: | ||
... | ||
|
||
async def select_user_by_id( | ||
self, conn: edgedb.AsyncIOConnection, user_id: UUID | ||
) -> Person: | ||
async def select_user_by_id(self, fetcher: EdgeDBFetcher, user_id: UUID,) -> Person: | ||
... | ||
|
||
async def create_keanu_reeves(self, conn: edgedb.AsyncIOConnection) -> None: | ||
async def create_keanu_reeves(self, fetcher: EdgeDBFetcher) -> None: | ||
... | ||
|
||
|
||
queries = cast(Queries, from_path("./queries.edgeql")) | ||
queries = cast(Queries, edgeql_queries.from_path("./queries.edgeql")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,4 @@ FILTER .id = <uuid>$user_id | |
INSERT Person { | ||
first_name := "Keanu", | ||
last_name := "Reeves", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
ee1d8a7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://edgeql-queries.netlify.app as production
🚀 Deployed on https://5f324b89a30291db7e638085--edgeql-queries.netlify.app