abysshub 1.0.1.dev14__tar.gz → 1.0.1.dev16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/PKG-INFO +4 -1
  2. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/pyproject.toml +14 -2
  3. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/_async_client.py +1 -7
  4. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/_client.py +1 -7
  5. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/tests/fake_server.py +1 -1
  6. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/tests/test_package.py +27 -0
  7. abysshub-1.0.1.dev16/vulture_whitelist.py +2 -0
  8. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/.gitignore +0 -0
  9. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/LICENSE +0 -0
  10. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/README.md +0 -0
  11. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/__init__.py +0 -0
  12. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/__main__.py +0 -0
  13. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/_command.py +0 -0
  14. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/_env.py +0 -0
  15. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/_error.py +0 -0
  16. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/_files.py +0 -0
  17. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/_http.py +0 -0
  18. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/_run.py +0 -0
  19. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/_types.py +0 -0
  20. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/src/abysshub/py.typed +0 -0
  21. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/tests/caller.py +0 -0
  22. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/tests/conftest.py +0 -0
  23. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/tests/test_client.py +0 -0
  24. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/tests/test_command.py +0 -0
  25. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/tests/test_files.py +0 -0
  26. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/tests/test_http.py +0 -0
  27. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/tests/test_replay.py +0 -0
  28. {abysshub-1.0.1.dev14 → abysshub-1.0.1.dev16}/tests/test_timeout.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: abysshub
3
- Version: 1.0.1.dev14
3
+ Version: 1.0.1.dev16
4
4
  Summary: Run a hosted tool, an Abyss Widget, from your own Python code and get its result and files. The official library for the Abyss API.
5
5
  Project-URL: Homepage, https://abysshub.com/docs#api
6
6
  Project-URL: Documentation, https://abysshub.com/docs
@@ -14,7 +14,10 @@ Classifier: Typing :: Typed
14
14
  Requires-Python: >=3.9
15
15
  Requires-Dist: httpx<1,>=0.27
16
16
  Provides-Extra: dev
17
+ Requires-Dist: deptry; extra == 'dev'
17
18
  Requires-Dist: pytest; extra == 'dev'
19
+ Requires-Dist: ruff; extra == 'dev'
20
+ Requires-Dist: vulture; extra == 'dev'
18
21
  Description-Content-Type: text/markdown
19
22
 
20
23
  # abysshub
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "abysshub"
7
- version = "1.0.1.dev14"
7
+ version = "1.0.1.dev16"
8
8
  description = "Run a hosted tool, an Abyss Widget, from your own Python code and get its result and files. The official library for the Abyss API."
9
9
  keywords = [
10
10
  "abyss",
@@ -32,7 +32,7 @@ classifiers = [
32
32
  abysshub = "abysshub._command:main"
33
33
 
34
34
  [project.optional-dependencies]
35
- dev = ["pytest"]
35
+ dev = ["deptry", "pytest", "ruff", "vulture"]
36
36
 
37
37
  [project.urls]
38
38
  Homepage = "https://abysshub.com/docs#api"
@@ -42,3 +42,15 @@ Issues = "https://github.com/Abysshub/abysshub-sdk/issues"
42
42
 
43
43
  [tool.pytest.ini_options]
44
44
  testpaths = ["tests"]
45
+
46
+ # The dead-code checks, run by tests/test_package.py. vulture's whitelist is today's
47
+ # findings, recorded so only a new one fails; it only shrinks.
48
+ [tool.vulture]
49
+ paths = ["src", "tests", "vulture_whitelist.py"]
50
+ min_confidence = 80
51
+
52
+ [tool.deptry]
53
+ pep621_dev_dependency_groups = ["dev"]
54
+
55
+ [tool.ruff.lint]
56
+ select = ["ERA001"]
@@ -3,7 +3,6 @@ from __future__ import annotations
3
3
  import asyncio
4
4
  import math
5
5
  from collections.abc import Awaitable, Callable, Mapping
6
- from types import TracebackType
7
6
  from typing import Any
8
7
 
9
8
  import httpx
@@ -142,12 +141,7 @@ class AsyncAbyss(_Base[AsyncRun]):
142
141
  async def __aenter__(self) -> AsyncAbyss:
143
142
  return self
144
143
 
145
- async def __aexit__(
146
- self,
147
- exc_type: type[BaseException] | None,
148
- exc: BaseException | None,
149
- tb: TracebackType | None,
150
- ) -> None:
144
+ async def __aexit__(self, *_: object) -> None:
151
145
  await self.close()
152
146
 
153
147
  async def run(
@@ -10,7 +10,6 @@ import uuid
10
10
  from collections.abc import Callable, Mapping
11
11
  from dataclasses import dataclass
12
12
  from importlib import metadata
13
- from types import TracebackType
14
13
  from typing import Any, Generic, TypeVar
15
14
  from urllib.parse import quote, urlencode
16
15
 
@@ -379,12 +378,7 @@ class Abyss(_Base[Run]):
379
378
  def __enter__(self) -> Abyss:
380
379
  return self
381
380
 
382
- def __exit__(
383
- self,
384
- exc_type: type[BaseException] | None,
385
- exc: BaseException | None,
386
- tb: TracebackType | None,
387
- ) -> None:
381
+ def __exit__(self, *_: object) -> None:
388
382
  self.close()
389
383
 
390
384
  def run(
@@ -50,7 +50,7 @@ class Replay:
50
50
  class Handler(BaseHTTPRequestHandler):
51
51
  protocol_version = "HTTP/1.1"
52
52
 
53
- def log_message(self, format: str, *args: Any) -> None:
53
+ def log_message(self, *_: Any) -> None:
54
54
  pass
55
55
 
56
56
  def do_GET(self) -> None:
@@ -1,3 +1,5 @@
1
+ import ast
2
+ import re
1
3
  import subprocess
2
4
  import sys
3
5
  from importlib.metadata import metadata, requires
@@ -5,6 +7,8 @@ from pathlib import Path
5
7
 
6
8
  from packaging.requirements import Requirement
7
9
 
10
+ PROJECT = Path(__file__).resolve().parent.parent
11
+
8
12
 
9
13
  def test_httpx_is_the_only_runtime_dependency():
10
14
  reqs = [Requirement(r) for r in requires("abysshub") or []]
@@ -25,3 +29,26 @@ def test_the_command_runs_as_abysshub_and_as_python_m_abysshub():
25
29
  done = subprocess.run([*command, "publish", "--help"], capture_output=True, text=True)
26
30
  assert done.returncode == 0, done.stderr
27
31
  assert "folder" in done.stdout
32
+
33
+
34
+ def check(tool, *args):
35
+ return subprocess.run([sys.executable, "-m", tool, *args], cwd=PROJECT, capture_output=True, text=True)
36
+
37
+
38
+ def test_vulture_finds_no_dead_code_beyond_its_whitelist_and_the_whitelist_only_shrinks():
39
+ done = check("vulture")
40
+ assert done.returncode == 0, done.stdout
41
+ whitelist = ast.parse((PROJECT / "vulture_whitelist.py").read_text())
42
+ recorded = {node.value.id for node in whitelist.body}
43
+ found = set(re.findall(r"'([^']+)'", check("vulture", "src", "tests").stdout))
44
+ assert recorded <= found, f"no longer found, so remove from vulture_whitelist.py: {recorded - found}"
45
+
46
+
47
+ def test_deptry_finds_every_import_declared_and_every_dependency_imported():
48
+ done = check("deptry", "src")
49
+ assert done.returncode == 0, done.stdout + done.stderr
50
+
51
+
52
+ def test_ruff_finds_no_commented_out_code():
53
+ done = check("ruff", "check", "src", "tests")
54
+ assert done.returncode == 0, done.stdout
@@ -0,0 +1,2 @@
1
+ # vulture's findings when the dead-code check began, which it no longer reports. A name
2
+ # leaves when its last finding is gone (tests/test_package.py checks that each still is).
File without changes
File without changes