Skip to content

Commit

Permalink
Allow symlinks in project dir
Browse files Browse the repository at this point in the history
  • Loading branch information
fantix committed Oct 26, 2022
1 parent 2e311d6 commit c39688c
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 4 deletions.
5 changes: 1 addition & 4 deletions edgedb/codegen/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ def __init__(self, args: argparse.Namespace):
self._skip_pydantic_validation = args.skip_pydantic_validation
self._async = False
try:
self._project_dir = pathlib.Path(
find_edgedb_project_dir()
).resolve()
self._project_dir = pathlib.Path(find_edgedb_project_dir())
except edgedb.ClientConnectionError:
print(
"Cannot find edgedb.toml: "
Expand Down Expand Up @@ -175,7 +173,6 @@ def run(self):

def _process_dir(self, dir_: pathlib.Path):
for file_or_dir in dir_.iterdir():
file_or_dir = file_or_dir.resolve()
if not file_or_dir.exists():
continue
if file_or_dir.is_dir():
Expand Down
1 change: 1 addition & 0 deletions tests/codegen/linked/test_linked.edgeql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select 42
16 changes: 16 additions & 0 deletions tests/codegen/linked/test_linked_async_edgeql.py.assert
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# AUTOGENERATED FROM 'linked/test_linked.edgeql' WITH:
# $ edgedb-py


from __future__ import annotations
import edgedb


async def test_linked(
client: edgedb.AsyncIOClient,
) -> int:
return await client.query_single(
"""\
select 42\
""",
)
16 changes: 16 additions & 0 deletions tests/codegen/linked/test_linked_edgeql.py.assert
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# AUTOGENERATED FROM 'linked/test_linked.edgeql' WITH:
# $ edgedb-py --target blocking --no-skip-pydantic-validation


from __future__ import annotations
import edgedb


def test_linked(
client: edgedb.Client,
) -> int:
return client.query_single(
"""\
select 42\
""",
)
11 changes: 11 additions & 0 deletions tests/codegen/test-project1/generated_async_edgeql.py.assert
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# AUTOGENERATED FROM:
# 'select_optional_json.edgeql'
# 'select_scalar.edgeql'
# 'linked/test_linked.edgeql'
# WITH:
# $ edgedb-py --target async --file --no-skip-pydantic-validation

Expand Down Expand Up @@ -46,3 +47,13 @@ async def select_scalar(
select 1;\
""",
)


async def test_linked(
client: edgedb.AsyncIOClient,
) -> int:
return await client.query_single(
"""\
select 42\
""",
)
1 change: 1 addition & 0 deletions tests/codegen/test-project1/linked

0 comments on commit c39688c

Please sign in to comment.