Skip to content

Commit e88b6aa

Browse files
authored
Update gql version to official prerelease (anvilco#51)
* Update deps, use new dev-dependencies poetry format, maybe tox update * Fix weld --list getting wrong gql field * Force local schema switch * Fix lint warnings * Remove field
1 parent f22e3fc commit e88b6aa

10 files changed

Lines changed: 69 additions & 60 deletions

File tree

.pylint.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ disable=
7474
too-many-nested-blocks,
7575
protected-access,
7676
wrong-import-order,
77+
use-dict-literal,
7778

7879
# Enable the message, report, category or checker with the given id(s). You can
7980
# either give multiple identifier separated by comma (,) or put this option

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ endif
115115
# Export PACKAGES so tox doesn't have to be reconfigured if these change
116116
tox: export TESTS = $(PACKAGE) tests
117117
tox: install
118-
poetry run tox
118+
poetry run tox -p 2
119119

120120
.PHONY: read-coverage
121121
read-coverage:

poetry.lock

Lines changed: 39 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,36 +39,35 @@ requests = "^2.25.0"
3939
ratelimit = "^2.2.1"
4040
tabulate = "^0.9.0"
4141
pydantic = "^1.8.2"
42-
# TODO: Update to an actual release version when out.
43-
gql = {git = "https://github.com/graphql-python/gql.git", rev = "930fca579220fd4810053491878366fa69862e58", extras = ["requests"]}
42+
gql = {version = "3.5.0b1", extras = ["requests"]}
4443

45-
[tool.poetry.dev-dependencies]
44+
[tool.poetry.group.dev.dependencies]
4645

4746
# Formatters
4847
black = "=22.12.0"
4948
isort = "^5.11.4"
5049

5150
# Linters
5251
mypy = "*"
53-
pydocstyle = "6.2.3"
54-
pylint = "2.15.10"
52+
pydocstyle = "^6.3.0"
53+
pylint = "^2.16.2"
5554

5655
# Testing
57-
pytest = "^7.2.0"
58-
pytest-cov = "*"
56+
pytest = "^7.2.1"
57+
pytest-cov = "^4.0.0"
5958
pytest-describe = "^2.0"
60-
pytest-random = "*"
59+
pytest-random = "^0.2"
6160
freezegun = "*"
6261

6362
# Reports
6463
coveragespace = "*"
6564

6665
# Documentation
67-
mkdocs = "1.4.2"
68-
pygments = "^2.5.2"
66+
mkdocs = "^1.4.2"
67+
pygments = "^2.14.0"
6968

7069
# Tooling
71-
pyinstaller = "^5.7.0"
70+
pyinstaller = "^5.8.0"
7271
sniffer = "*"
7372
MacFSEvents = { version = "*", platform = "darwin" }
7473
pync = { version = "*", platform = "darwin" }

python_anvil/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def get_welds(self, **kwargs) -> Union[List, Tuple[List, Dict]]:
307307
welds {
308308
eid
309309
slug
310-
title
310+
name
311311
forges {
312312
eid
313313
name

python_anvil/api_resources/mutations/forge_submit.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
$timezone: String,
4848
$groupArrayId: String,
4949
$groupArrayIndex: Int,
50-
$errorType: String,
5150
$webhookURL: String,
5251
) {{
5352
forgeSubmit (
@@ -61,7 +60,6 @@
6160
timezone: $timezone,
6261
groupArrayId: $groupArrayId,
6362
groupArrayIndex: $groupArrayIndex,
64-
errorType: $errorType,
6563
webhookURL: $webhookURL
6664
) {query}
6765
}}

python_anvil/api_resources/requests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def handle_error(self, response, status_code, headers):
3434
else:
3535
message = f"Error: {status_code}: {response} {extra}"
3636

37+
# pylint: disable=broad-exception-raised
3738
raise Exception(message)
3839

3940
def process_response(self, response, status_code, headers, **kwargs):

python_anvil/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,12 @@ def weld(ctx, eid, list_all):
102102
if debug:
103103
click.echo(headers)
104104

105-
data = [(w["eid"], w.get("slug"), w.get("title"), w.get("forges")) for w in res]
105+
data = [(w["eid"], w.get("slug"), w.get("name"), w.get("forges")) for w in res]
106106
click.echo(tabulate(data, tablefmt="pretty", headers=["eid", "slug", "title"]))
107107
return
108108

109109
if not eid:
110+
# pylint: disable=broad-exception-raised
110111
raise Exception("You need to pass in a weld eid")
111112

112113
res = anvil.get_weld(eid)

python_anvil/http.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def get_client(
6262
environment: str = "dev", # pylint: disable=unused-argument
6363
endpoint_url: Optional[str] = None,
6464
fetch_schema_from_transport: bool = False,
65+
force_local_schema: bool = False,
6566
) -> Client:
6667
auth = HTTPBasicAuth(username=api_key, password="")
6768
endpoint_url = endpoint_url or GRAPHQL_ENDPOINT
@@ -72,7 +73,9 @@ def get_client(
7273
verify=True,
7374
)
7475

75-
schema = get_local_schema(raise_on_error=False)
76+
schema = None
77+
if force_local_schema or not fetch_schema_from_transport:
78+
schema = get_local_schema(raise_on_error=False)
7679

7780
return Client(
7881
schema=schema,

tox.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,13 @@ passenv = TESTS
88
commands =
99
poetry install -v
1010
poetry run pytest {env:TESTS}
11+
12+
[testenv:package]
13+
description = check sdist and wheel
14+
skip_install = true
15+
deps =
16+
poetry>=0.12
17+
twine
18+
commands =
19+
poetry build
20+
twine check dist/*

0 commit comments

Comments
 (0)