Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pylint.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ disable=
too-many-nested-blocks,
protected-access,
wrong-import-order,
use-dict-literal,

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ endif
# Export PACKAGES so tox doesn't have to be reconfigured if these change
tox: export TESTS = $(PACKAGE) tests
tox: install
poetry run tox
poetry run tox -p 2

.PHONY: read-coverage
read-coverage:
Expand Down
82 changes: 39 additions & 43 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 10 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,36 +39,35 @@ requests = "^2.25.0"
ratelimit = "^2.2.1"
tabulate = "^0.9.0"
pydantic = "^1.8.2"
# TODO: Update to an actual release version when out.
gql = {git = "https://github.com/graphql-python/gql.git", rev = "930fca579220fd4810053491878366fa69862e58", extras = ["requests"]}
gql = {version = "3.5.0b1", extras = ["requests"]}

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]

# Formatters
black = "=22.12.0"
isort = "^5.11.4"

# Linters
mypy = "*"
pydocstyle = "6.2.3"
pylint = "2.15.10"
pydocstyle = "^6.3.0"
pylint = "^2.16.2"

# Testing
pytest = "^7.2.0"
pytest-cov = "*"
pytest = "^7.2.1"
pytest-cov = "^4.0.0"
pytest-describe = "^2.0"
pytest-random = "*"
pytest-random = "^0.2"
freezegun = "*"

# Reports
coveragespace = "*"

# Documentation
mkdocs = "1.4.2"
pygments = "^2.5.2"
mkdocs = "^1.4.2"
pygments = "^2.14.0"

# Tooling
pyinstaller = "^5.7.0"
pyinstaller = "^5.8.0"
sniffer = "*"
MacFSEvents = { version = "*", platform = "darwin" }
pync = { version = "*", platform = "darwin" }
Expand Down
2 changes: 1 addition & 1 deletion python_anvil/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def get_welds(self, **kwargs) -> Union[List, Tuple[List, Dict]]:
welds {
eid
slug
title
name
forges {
eid
name
Expand Down
2 changes: 0 additions & 2 deletions python_anvil/api_resources/mutations/forge_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
$timezone: String,
$groupArrayId: String,
$groupArrayIndex: Int,
$errorType: String,
$webhookURL: String,
) {{
forgeSubmit (
Expand All @@ -61,7 +60,6 @@
timezone: $timezone,
groupArrayId: $groupArrayId,
groupArrayIndex: $groupArrayIndex,
errorType: $errorType,
webhookURL: $webhookURL
) {query}
}}
Expand Down
1 change: 1 addition & 0 deletions python_anvil/api_resources/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def handle_error(self, response, status_code, headers):
else:
message = f"Error: {status_code}: {response} {extra}"

# pylint: disable=broad-exception-raised
raise Exception(message)

def process_response(self, response, status_code, headers, **kwargs):
Expand Down
3 changes: 2 additions & 1 deletion python_anvil/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,12 @@ def weld(ctx, eid, list_all):
if debug:
click.echo(headers)

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

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

res = anvil.get_weld(eid)
Expand Down
5 changes: 4 additions & 1 deletion python_anvil/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def get_client(
environment: str = "dev", # pylint: disable=unused-argument
endpoint_url: Optional[str] = None,
fetch_schema_from_transport: bool = False,
force_local_schema: bool = False,
) -> Client:
auth = HTTPBasicAuth(username=api_key, password="")
endpoint_url = endpoint_url or GRAPHQL_ENDPOINT
Expand All @@ -72,7 +73,9 @@ def get_client(
verify=True,
)

schema = get_local_schema(raise_on_error=False)
schema = None
if force_local_schema or not fetch_schema_from_transport:
schema = get_local_schema(raise_on_error=False)

return Client(
schema=schema,
Expand Down
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,13 @@ passenv = TESTS
commands =
poetry install -v
poetry run pytest {env:TESTS}

[testenv:package]
description = check sdist and wheel
skip_install = true
deps =
poetry>=0.12
twine
commands =
poetry build
twine check dist/*