datalegion-cli 1.2.0__tar.gz → 1.2.1__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.
- datalegion_cli-1.2.1/.github/actionlint.yaml +5 -0
- datalegion_cli-1.2.1/.github/workflows/ci.yml +77 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/.github/workflows/release.yml +11 -4
- datalegion_cli-1.2.1/.python-version +1 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/PKG-INFO +4 -3
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/README.md +1 -1
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/pyproject.toml +2 -1
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/client.py +4 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/tests/test_client.py +9 -0
- datalegion_cli-1.2.1/uv.lock +658 -0
- datalegion_cli-1.2.0/.github/workflows/ci.yml +0 -33
- datalegion_cli-1.2.0/uv.lock +0 -645
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/.github/dependabot.yml +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/.gitignore +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/__init__.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/async_typer.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/commands/__init__.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/commands/company.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/commands/credits.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/commands/person.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/commands/utility.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/config.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/logging.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/main.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/output.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/src/datalegion_cli/update.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/tests/__init__.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/tests/conftest.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/tests/test_commands.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/tests/test_config.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/tests/test_logging.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/tests/test_output.py +0 -0
- {datalegion_cli-1.2.0 → datalegion_cli-1.2.1}/tests/test_update.py +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
lint:
|
|
9
|
+
runs-on: blacksmith-2vcpu-ubuntu-2404
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v7
|
|
12
|
+
- uses: astral-sh/setup-uv@v10.2.0
|
|
13
|
+
with:
|
|
14
|
+
enable-cache: true
|
|
15
|
+
# .python-version: the 3.11 floor
|
|
16
|
+
- run: uv sync --frozen --group dev
|
|
17
|
+
- run: uv run ruff check src/ tests/
|
|
18
|
+
- run: uv run ruff format --check src/ tests/
|
|
19
|
+
|
|
20
|
+
test-python:
|
|
21
|
+
name: test (Python ${{ matrix.python-version }})
|
|
22
|
+
runs-on: blacksmith-2vcpu-ubuntu-2404
|
|
23
|
+
strategy:
|
|
24
|
+
fail-fast: false
|
|
25
|
+
matrix:
|
|
26
|
+
# Every version pyproject.toml's classifiers claim.
|
|
27
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
28
|
+
# Without this uv takes the interpreter from .python-version (the 3.11 floor)
|
|
29
|
+
# for every leg.
|
|
30
|
+
env:
|
|
31
|
+
UV_PYTHON: ${{ matrix.python-version }}
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v7
|
|
34
|
+
- uses: astral-sh/setup-uv@v10.2.0
|
|
35
|
+
with:
|
|
36
|
+
enable-cache: true
|
|
37
|
+
- run: uv python install ${{ matrix.python-version }}
|
|
38
|
+
- run: uv sync --frozen --group dev
|
|
39
|
+
- name: Check the interpreter is the matrix version
|
|
40
|
+
run: uv run python -c "import sys; v = '%d.%d' % sys.version_info[:2]; assert v == '${{ matrix.python-version }}', f'ran {sys.version}, matrix says ${{ matrix.python-version }}'; print(sys.version)"
|
|
41
|
+
- run: uv run pytest
|
|
42
|
+
|
|
43
|
+
# The main ruleset requires a check named `test`; it passes only when every
|
|
44
|
+
# Python leg did.
|
|
45
|
+
test:
|
|
46
|
+
needs: test-python
|
|
47
|
+
if: always()
|
|
48
|
+
runs-on: blacksmith-2vcpu-ubuntu-2404
|
|
49
|
+
steps:
|
|
50
|
+
- run: '[ "${{ needs.test-python.result }}" = "success" ]'
|
|
51
|
+
|
|
52
|
+
actionlint:
|
|
53
|
+
name: actionlint
|
|
54
|
+
runs-on: blacksmith-2vcpu-ubuntu-2404
|
|
55
|
+
timeout-minutes: 5
|
|
56
|
+
permissions:
|
|
57
|
+
contents: read
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v7
|
|
60
|
+
# Pinned and checksum-verified (the upgrade sweep moves the version and both digests).
|
|
61
|
+
# actionlint runs shellcheck on every `run:` script when shellcheck is on PATH, so
|
|
62
|
+
# install it rather than let those checks skip silently.
|
|
63
|
+
- name: Lint workflows (actionlint + shellcheck)
|
|
64
|
+
env:
|
|
65
|
+
ACTIONLINT_VERSION: 1.7.12
|
|
66
|
+
run: |
|
|
67
|
+
case "$(uname -m)" in
|
|
68
|
+
x86_64) arch=amd64; sha=8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8 ;;
|
|
69
|
+
aarch64) arch=arm64; sha=325e971b6ba9bfa504672e29be93c24981eeb1c07576d730e9f7c8805afff0c6 ;;
|
|
70
|
+
*) echo "unsupported arch $(uname -m)"; exit 1 ;;
|
|
71
|
+
esac
|
|
72
|
+
f="actionlint_${ACTIONLINT_VERSION}_linux_${arch}.tar.gz"
|
|
73
|
+
curl -fsSL -o "/tmp/$f" "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/$f"
|
|
74
|
+
echo "$sha /tmp/$f" | sha256sum -c -
|
|
75
|
+
tar -xzf "/tmp/$f" -C /tmp actionlint
|
|
76
|
+
command -v shellcheck >/dev/null || { sudo apt-get update -qq && sudo apt-get install -y -qq shellcheck; }
|
|
77
|
+
/tmp/actionlint -color
|
|
@@ -21,7 +21,7 @@ jobs:
|
|
|
21
21
|
uses: actions/checkout@v7
|
|
22
22
|
|
|
23
23
|
- name: Install uv
|
|
24
|
-
uses: astral-sh/setup-uv@
|
|
24
|
+
uses: astral-sh/setup-uv@v10.2.0
|
|
25
25
|
with:
|
|
26
26
|
enable-cache: true
|
|
27
27
|
cache-dependency-glob: "uv.lock"
|
|
@@ -51,16 +51,20 @@ jobs:
|
|
|
51
51
|
timeout-minutes: 10
|
|
52
52
|
permissions:
|
|
53
53
|
contents: read
|
|
54
|
+
# Without this uv takes the interpreter from .python-version (the 3.11 floor)
|
|
55
|
+
# for every leg.
|
|
56
|
+
env:
|
|
57
|
+
UV_PYTHON: ${{ matrix.python-version }}
|
|
54
58
|
strategy:
|
|
55
59
|
fail-fast: false
|
|
56
60
|
matrix:
|
|
57
|
-
python-version: ["3.11", "3.12", "3.13"]
|
|
61
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
58
62
|
steps:
|
|
59
63
|
- name: Checkout
|
|
60
64
|
uses: actions/checkout@v7
|
|
61
65
|
|
|
62
66
|
- name: Install uv
|
|
63
|
-
uses: astral-sh/setup-uv@
|
|
67
|
+
uses: astral-sh/setup-uv@v10.2.0
|
|
64
68
|
with:
|
|
65
69
|
enable-cache: true
|
|
66
70
|
cache-dependency-glob: "uv.lock"
|
|
@@ -71,6 +75,9 @@ jobs:
|
|
|
71
75
|
- name: Install dependencies
|
|
72
76
|
run: uv sync --frozen --group dev
|
|
73
77
|
|
|
78
|
+
- name: Check the interpreter is the matrix version
|
|
79
|
+
run: uv run python -c "import sys; v = '%d.%d' % sys.version_info[:2]; assert v == '${{ matrix.python-version }}', f'ran {sys.version}, matrix says ${{ matrix.python-version }}'; print(sys.version)"
|
|
80
|
+
|
|
74
81
|
- name: Run tests
|
|
75
82
|
run: uv run pytest tests/ -v --tb=short
|
|
76
83
|
|
|
@@ -91,7 +98,7 @@ jobs:
|
|
|
91
98
|
uses: actions/checkout@v7
|
|
92
99
|
|
|
93
100
|
- name: Install uv
|
|
94
|
-
uses: astral-sh/setup-uv@
|
|
101
|
+
uses: astral-sh/setup-uv@v10.2.0
|
|
95
102
|
|
|
96
103
|
- name: Set up Python
|
|
97
104
|
run: uv python install 3.11
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: datalegion-cli
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: CLI for the Data Legion API — agent-friendly, fully async
|
|
5
5
|
Project-URL: Homepage, https://www.datalegion.ai
|
|
6
6
|
Project-URL: Documentation, https://www.datalegion.ai/docs
|
|
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
21
|
Classifier: Typing :: Typed
|
|
21
22
|
Requires-Python: >=3.11
|
|
22
23
|
Requires-Dist: cryptography>=44.0.0
|
|
@@ -246,7 +247,7 @@ The CLI is designed to be called by AI agents and scripts. Key patterns:
|
|
|
246
247
|
|
|
247
248
|
```bash
|
|
248
249
|
# All output is JSON to stdout — parse it directly
|
|
249
|
-
datalegion-cli person enrich --email john@example.com | jq '.matches[0].full_name'
|
|
250
|
+
datalegion-cli person enrich --email john@example.com | jq '.matches[0].person.full_name'
|
|
250
251
|
|
|
251
252
|
# Pipe JSON payloads via stdin
|
|
252
253
|
echo '{"email":"john@example.com","company":"Acme"}' | datalegion-cli person enrich --stdin
|
|
@@ -213,7 +213,7 @@ The CLI is designed to be called by AI agents and scripts. Key patterns:
|
|
|
213
213
|
|
|
214
214
|
```bash
|
|
215
215
|
# All output is JSON to stdout — parse it directly
|
|
216
|
-
datalegion-cli person enrich --email john@example.com | jq '.matches[0].full_name'
|
|
216
|
+
datalegion-cli person enrich --email john@example.com | jq '.matches[0].person.full_name'
|
|
217
217
|
|
|
218
218
|
# Pipe JSON payloads via stdin
|
|
219
219
|
echo '{"email":"john@example.com","company":"Acme"}' | datalegion-cli person enrich --stdin
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "datalegion-cli"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.1"
|
|
4
4
|
description = "CLI for the Data Legion API — agent-friendly, fully async"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.11"
|
|
@@ -24,6 +24,7 @@ classifiers = [
|
|
|
24
24
|
"Programming Language :: Python :: 3.11",
|
|
25
25
|
"Programming Language :: Python :: 3.12",
|
|
26
26
|
"Programming Language :: Python :: 3.13",
|
|
27
|
+
"Programming Language :: Python :: 3.14",
|
|
27
28
|
"Environment :: Console",
|
|
28
29
|
"Typing :: Typed",
|
|
29
30
|
]
|
|
@@ -7,6 +7,7 @@ from typing import Any
|
|
|
7
7
|
import httpx
|
|
8
8
|
from loguru import logger
|
|
9
9
|
|
|
10
|
+
from datalegion_cli import __version__
|
|
10
11
|
from datalegion_cli.config import get_api_key, get_base_url
|
|
11
12
|
|
|
12
13
|
|
|
@@ -56,6 +57,9 @@ class LegionClient:
|
|
|
56
57
|
headers={
|
|
57
58
|
"API-Key": self._api_key,
|
|
58
59
|
"Content-Type": "application/json",
|
|
60
|
+
# Lets the API tell CLI traffic apart (its request log
|
|
61
|
+
# classifies datalegion-cli/* as 'cli').
|
|
62
|
+
"User-Agent": f"datalegion-cli/{__version__}",
|
|
59
63
|
},
|
|
60
64
|
)
|
|
61
65
|
return self._client
|
|
@@ -47,6 +47,15 @@ class TestLegionClientInit:
|
|
|
47
47
|
assert client._api_key == "legion_k"
|
|
48
48
|
assert client._timeout == 10.0
|
|
49
49
|
|
|
50
|
+
async def test_sends_identifying_user_agent(self):
|
|
51
|
+
"""The API's request log classifies datalegion-cli/* as CLI traffic."""
|
|
52
|
+
from datalegion_cli import __version__
|
|
53
|
+
|
|
54
|
+
client = LegionClient(base_url="https://x.local", api_key="legion_k")
|
|
55
|
+
http = await client._get_client()
|
|
56
|
+
assert http.headers["User-Agent"] == f"datalegion-cli/{__version__}"
|
|
57
|
+
await client.close()
|
|
58
|
+
|
|
50
59
|
def test_credit_headers_init_none(self, mock_api_key):
|
|
51
60
|
client = LegionClient(base_url="https://x.local", api_key=mock_api_key)
|
|
52
61
|
assert client.last_credits_used is None
|