awsquery 0.3.0__tar.gz → 0.3.2__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.
- {awsquery-0.3.0 → awsquery-0.3.2}/.github/workflows/release.yml +20 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/PKG-INFO +3 -12
- {awsquery-0.3.0 → awsquery-0.3.2}/README.md +2 -11
- {awsquery-0.3.0 → awsquery-0.3.2}/pyproject.toml +1 -1
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery/cli.py +41 -3
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery/default_filters.yaml +651 -228
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery.egg-info/PKG-INFO +3 -12
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/integration/test_feature_combinations.py +10 -7
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_cli_arg_processing.py +170 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_config_loading_simple.py +6 -4
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_default_column_filters.py +27 -18
- {awsquery-0.3.0 → awsquery-0.3.2}/.claude/agents/code-reviewer.md +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/.claude/agents/makefile-optimizer.md +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/.claude/agents/python-infra-automator.md +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/.claude/agents/test-writer.md +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/.claude/settings.local.json +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/.coveragerc +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/.devcontainer/devcontainer.json +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/.dockerignore +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/.flake8 +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/.github/workflows/quality.yml +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/.github/workflows/test.yml +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/.gitignore +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/CLAUDE.md +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/Dockerfile +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/Dockerfile.prod +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/LICENSE +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/Makefile +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/Todo.md +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/docker-compose.yml +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/docs/DOCKER.md +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/docs/mutation-testing.md +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/policy.json +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/pytest.ini +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/requirements.txt +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/setup.cfg +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery/__init__.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery/config.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery/core.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery/filters.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery/formatters.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery/policy.json +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery/security.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery/utils.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery.egg-info/SOURCES.txt +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery.egg-info/dependency_links.txt +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery.egg-info/entry_points.txt +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery.egg-info/requires.txt +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/src/awsquery.egg-info/top_level.txt +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/__init__.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/conftest.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/fixtures/__init__.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/fixtures/aws_responses.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/fixtures/policy_samples.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/integration/__init__.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/integration/test_autocomplete_resilience.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/integration/test_end_to_end.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/integration/test_keys_behavior.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/integration/test_multi_level.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/integration/test_multi_level_calls.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/integration/test_session_management.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/__init__.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_cli_flags.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_cli_parser.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_cli_session_args.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_column_ordering.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_core.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_core_inference.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_core_string_handling.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_critical_mutations.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_filter_edge_cases.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_filter_implementation.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_filter_matching.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_filter_parameter_extraction.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_filters.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_filters_pattern_matching.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_formatter_edge_cases.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_formatters.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_formatters_data_processing.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_keys_display_fix.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_messaging_enhancements.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_security.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_security_edge_cases.py +0 -0
- {awsquery-0.3.0 → awsquery-0.3.2}/tests/unit/test_tags_transformation.py +0 -0
|
@@ -39,6 +39,26 @@ jobs:
|
|
|
39
39
|
python -m pip install --upgrade pip
|
|
40
40
|
pip install build twine
|
|
41
41
|
|
|
42
|
+
- name: Update version in pyproject.toml
|
|
43
|
+
run: |
|
|
44
|
+
# Extract version from tag (remove 'v' prefix if present)
|
|
45
|
+
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
|
|
46
|
+
VERSION=${GITHUB_REF#refs/tags/v}
|
|
47
|
+
elif [[ "${{ github.event.inputs.version }}" != "" ]]; then
|
|
48
|
+
VERSION="${{ github.event.inputs.version }}"
|
|
49
|
+
else
|
|
50
|
+
echo "No version found"
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
echo "Updating version to $VERSION for build"
|
|
54
|
+
|
|
55
|
+
# Update version using sed
|
|
56
|
+
sed -i "s/^version = \".*\"/version = \"$VERSION\"/" pyproject.toml
|
|
57
|
+
|
|
58
|
+
# Verify the change
|
|
59
|
+
echo "Updated pyproject.toml:"
|
|
60
|
+
grep "^version =" pyproject.toml
|
|
61
|
+
|
|
42
62
|
- name: Build distribution
|
|
43
63
|
run: |
|
|
44
64
|
python -m build
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: awsquery
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Advanced CLI tool for querying AWS APIs with flexible filtering and automatic parameter resolution
|
|
5
5
|
Author-email: Florian Motlik <flo@flomotlik.me>
|
|
6
6
|
License: MIT
|
|
@@ -112,16 +112,7 @@ pip install -e ".[dev]"
|
|
|
112
112
|
|
|
113
113
|
awsquery supports tab completion for AWS services and actions through argcomplete.
|
|
114
114
|
|
|
115
|
-
####
|
|
116
|
-
```bash
|
|
117
|
-
# Run the setup script
|
|
118
|
-
./setup-autocomplete.sh
|
|
119
|
-
|
|
120
|
-
# Then reload your shell configuration
|
|
121
|
-
source ~/.bashrc # or ~/.zshrc, etc.
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
#### Manual Setup
|
|
115
|
+
#### Setup
|
|
125
116
|
|
|
126
117
|
##### Bash
|
|
127
118
|
```bash
|
|
@@ -510,4 +501,4 @@ MIT License - see LICENSE file for details.
|
|
|
510
501
|
|
|
511
502
|
## Contributing
|
|
512
503
|
|
|
513
|
-
|
|
504
|
+
Contributions are welcome! Please ensure tests pass and follow the existing code style.
|
|
@@ -49,16 +49,7 @@ pip install -e ".[dev]"
|
|
|
49
49
|
|
|
50
50
|
awsquery supports tab completion for AWS services and actions through argcomplete.
|
|
51
51
|
|
|
52
|
-
####
|
|
53
|
-
```bash
|
|
54
|
-
# Run the setup script
|
|
55
|
-
./setup-autocomplete.sh
|
|
56
|
-
|
|
57
|
-
# Then reload your shell configuration
|
|
58
|
-
source ~/.bashrc # or ~/.zshrc, etc.
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
#### Manual Setup
|
|
52
|
+
#### Setup
|
|
62
53
|
|
|
63
54
|
##### Bash
|
|
64
55
|
```bash
|
|
@@ -447,4 +438,4 @@ MIT License - see LICENSE file for details.
|
|
|
447
438
|
|
|
448
439
|
## Contributing
|
|
449
440
|
|
|
450
|
-
|
|
441
|
+
Contributions are welcome! Please ensure tests pass and follow the existing code style.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "awsquery"
|
|
7
|
-
version = "0.3.
|
|
7
|
+
version = "0.3.2"
|
|
8
8
|
description = "Advanced CLI tool for querying AWS APIs with flexible filtering and automatic parameter resolution"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Florian Motlik", email = "flo@flomotlik.me" }]
|
|
@@ -7,6 +7,7 @@ import sys
|
|
|
7
7
|
|
|
8
8
|
import argcomplete
|
|
9
9
|
import boto3
|
|
10
|
+
from argcomplete import warn
|
|
10
11
|
|
|
11
12
|
from .config import apply_default_filters
|
|
12
13
|
from .core import (
|
|
@@ -201,6 +202,30 @@ def determine_column_filters(column_filters, service, action):
|
|
|
201
202
|
return None
|
|
202
203
|
|
|
203
204
|
|
|
205
|
+
def _enhanced_completion_validator(completion_candidate, current_input):
|
|
206
|
+
"""Custom argcomplete validator for enhanced action matching."""
|
|
207
|
+
if not current_input:
|
|
208
|
+
return True
|
|
209
|
+
|
|
210
|
+
current_input_lower = current_input.lower()
|
|
211
|
+
candidate_lower = completion_candidate.lower()
|
|
212
|
+
|
|
213
|
+
# 1. Exact prefix match (highest priority)
|
|
214
|
+
if candidate_lower.startswith(current_input_lower):
|
|
215
|
+
return True
|
|
216
|
+
|
|
217
|
+
# 2. Partial substring match
|
|
218
|
+
if current_input_lower in candidate_lower:
|
|
219
|
+
return True
|
|
220
|
+
|
|
221
|
+
# 3. Split match - all parts must be found as substrings
|
|
222
|
+
parts = [part for part in current_input_lower.split("-") if part] # Filter empty parts
|
|
223
|
+
if len(parts) > 1 and all(part in candidate_lower for part in parts):
|
|
224
|
+
return True
|
|
225
|
+
|
|
226
|
+
return False
|
|
227
|
+
|
|
228
|
+
|
|
204
229
|
def action_completer(prefix, parsed_args, **kwargs):
|
|
205
230
|
"""Autocomplete action names based on selected service"""
|
|
206
231
|
if not parsed_args.service:
|
|
@@ -240,8 +265,21 @@ def action_completer(prefix, parsed_args, **kwargs):
|
|
|
240
265
|
kebab_case = re.sub("([a-z0-9])([A-Z])", r"\1-\2", op).lower()
|
|
241
266
|
cli_operations.append(kebab_case)
|
|
242
267
|
|
|
243
|
-
|
|
244
|
-
|
|
268
|
+
# Return all valid operations - let argcomplete validator handle filtering
|
|
269
|
+
all_operations = sorted(cli_operations)
|
|
270
|
+
|
|
271
|
+
if prefix:
|
|
272
|
+
# Check what will actually match with our validator
|
|
273
|
+
matched = [op for op in all_operations if _enhanced_completion_validator(op, prefix)]
|
|
274
|
+
|
|
275
|
+
# If multiple matches share a common prefix shorter than input, warn user
|
|
276
|
+
if len(matched) > 1:
|
|
277
|
+
common = os.path.commonprefix(matched)
|
|
278
|
+
if common and len(common) <= len(prefix):
|
|
279
|
+
# Show user what matches were found
|
|
280
|
+
warn(f"Matches for '{prefix}': {', '.join(matched)}")
|
|
281
|
+
|
|
282
|
+
return all_operations
|
|
245
283
|
except Exception:
|
|
246
284
|
# If we can't get operations, return empty
|
|
247
285
|
return []
|
|
@@ -299,7 +337,7 @@ Examples:
|
|
|
299
337
|
) # pragma: no mutate
|
|
300
338
|
action_arg.completer = action_completer # type: ignore[attr-defined]
|
|
301
339
|
|
|
302
|
-
argcomplete.autocomplete(parser)
|
|
340
|
+
argcomplete.autocomplete(parser, validator=_enhanced_completion_validator)
|
|
303
341
|
|
|
304
342
|
# First pass: parse known args to get service and action
|
|
305
343
|
args, remaining = parser.parse_known_args()
|