Skip to content

Commit 7235504

Browse files
authored
[DEV-7574] Generate license headers and fix dependencies (#60)
Signed-off-by: Max Chesterfield <max.chesterfield@zepben.com>
1 parent af13a51 commit 7235504

File tree

14 files changed

+121
-2
lines changed

14 files changed

+121
-2
lines changed

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ authors = [
2424
]
2525
dependencies = [
2626
"geojson==2.5.0",
27-
"httpx",
27+
"httpx==0.28.1",
2828
"graphql-core==3.2.8",
2929
"pydantic",
3030
"pydantic_core",
@@ -46,6 +46,7 @@ Homepage = "https://zepben.com"
4646
test = [
4747
"pytest",
4848
"pytest-cov",
49+
"pytest-asyncio",
4950
"pytest-httpserver==1.0.8",
5051
"trustme==0.9.0"
5152
]
@@ -67,5 +68,6 @@ introspection_input_value_deprecations=true
6768
plugins=[
6869
"zepben.eas.lib.ariadne_plugins.custom_query_type_hinter.CustomQueryTypeHinterPlugin",
6970
"zepben.eas.lib.ariadne_plugins.missed_import_checker.MissedImportCheckerPlugin",
70-
"zepben.eas.lib.ariadne_plugins.gql_all_fields.GqlAllFieldsPlugin"
71+
"zepben.eas.lib.ariadne_plugins.gql_all_fields.GqlAllFieldsPlugin",
72+
"zepben.eas.lib.ariadne_plugins.license_headers.LicenseHeadersPlugin",
7173
]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2026 Zeppelin Bend Pty Ltd
2+
#
3+
# This Source Code Form is subject to the terms of the Mozilla Public
4+
# License, v. 2.0. If a copy of the MPL was not distributed with this
5+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
from datetime import datetime
7+
from typing import Optional
8+
9+
from ariadne_codegen import Plugin
10+
11+
now = datetime.now()
12+
13+
#
14+
# NOTE: Being dodgy due to amount of time already spent. Ideally this would read and process the `.idea/copyright` files
15+
# so we only need to update the licence in one place. Given this is unlikely to change, this can be done if we ever
16+
# decide to change it in the future.
17+
#
18+
license = f"""# Copyright {now.year} Zeppelin Bend Pty Ltd
19+
#
20+
# This Source Code Form is subject to the terms of the Mozilla Public
21+
# License, v. 2.0. If a copy of the MPL was not distributed with this
22+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
23+
"""
24+
25+
class LicenseHeadersPlugin(Plugin):
26+
27+
def get_file_comment(
28+
self, comment: str, code: str, source: Optional[str] = None
29+
) -> str:
30+
return f"{license}{comment}"
31+
32+
def copy_code(self, copied_code: str) -> str:
33+
return f"{license}\n\n{copied_code}"

src/zepben/eas/lib/generated_graphql_client/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Copyright 2026 Zeppelin Bend Pty Ltd
2+
#
3+
# This Source Code Form is subject to the terms of the Mozilla Public
4+
# License, v. 2.0. If a copy of the MPL was not distributed with this
5+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
7+
18
from .async_base_client import AsyncBaseClient
29
from .base_model import BaseModel, Upload
310
from .client import Client

src/zepben/eas/lib/generated_graphql_client/async_base_client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Copyright 2026 Zeppelin Bend Pty Ltd
2+
#
3+
# This Source Code Form is subject to the terms of the Mozilla Public
4+
# License, v. 2.0. If a copy of the MPL was not distributed with this
5+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
7+
18
import asyncio
29
import enum
310
import json

src/zepben/eas/lib/generated_graphql_client/base_model.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Copyright 2026 Zeppelin Bend Pty Ltd
2+
#
3+
# This Source Code Form is subject to the terms of the Mozilla Public
4+
# License, v. 2.0. If a copy of the MPL was not distributed with this
5+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
7+
18
from io import IOBase
29
from pydantic import BaseModel as PydanticBaseModel
310
from pydantic import ConfigDict

src/zepben/eas/lib/generated_graphql_client/base_operation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Copyright 2026 Zeppelin Bend Pty Ltd
2+
#
3+
# This Source Code Form is subject to the terms of the Mozilla Public
4+
# License, v. 2.0. If a copy of the MPL was not distributed with this
5+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
7+
18
from typing import Any, Optional, Union
29
from graphql import ArgumentNode, FieldNode, InlineFragmentNode, NamedTypeNode, NameNode, SelectionSetNode, VariableNode
310

src/zepben/eas/lib/generated_graphql_client/client.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Copyright 2026 Zeppelin Bend Pty Ltd
2+
#
3+
# This Source Code Form is subject to the terms of the Mozilla Public
4+
# License, v. 2.0. If a copy of the MPL was not distributed with this
5+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
7+
18
from typing import Any
29

310
from graphql import (

src/zepben/eas/lib/generated_graphql_client/custom_fields.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Copyright 2026 Zeppelin Bend Pty Ltd
2+
#
3+
# This Source Code Form is subject to the terms of the Mozilla Public
4+
# License, v. 2.0. If a copy of the MPL was not distributed with this
5+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
7+
18
from typing import Any, Optional, Union
29

310
from .base_operation import GraphQLField

src/zepben/eas/lib/generated_graphql_client/custom_mutations.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Copyright 2026 Zeppelin Bend Pty Ltd
2+
#
3+
# This Source Code Form is subject to the terms of the Mozilla Public
4+
# License, v. 2.0. If a copy of the MPL was not distributed with this
5+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
7+
18
from typing import Any, Optional
29

310
from .custom_fields import (

src/zepben/eas/lib/generated_graphql_client/custom_queries.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Copyright 2026 Zeppelin Bend Pty Ltd
2+
#
3+
# This Source Code Form is subject to the terms of the Mozilla Public
4+
# License, v. 2.0. If a copy of the MPL was not distributed with this
5+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
6+
7+
18
from typing import Any, Optional
29

310
from .custom_fields import (

0 commit comments

Comments
 (0)