Skip to content

Commit 48edd75

Browse files
committed
minor fix in build config
1 parent 6b3260b commit 48edd75

File tree

3 files changed

+38
-12
lines changed

3 files changed

+38
-12
lines changed

aws-proxy/Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ usage: ## Show this help
1010

1111
install: ## Install dependencies
1212
test -d .venv || $(VENV_BIN) .venv
13+
$(VENV_RUN); pip install -e .
1314
$(VENV_RUN); pip install -e .[test]
1415
touch $(VENV_DIR)/bin/activate
1516

@@ -25,18 +26,18 @@ format: ## Run ruff to format the whole codebase
2526
lint: ## Run code linter to check code style
2627
($(VENV_RUN); python -m ruff check --output-format=full . && python -m ruff format --check .)
2728

28-
test: venv ## Run tests
29+
test: ## Run tests
2930
$(VENV_RUN); python -m pytest $(PYTEST_ARGS) $(TEST_PATH)
3031

31-
dist: venv ## Create distribution package
32-
$(VENV_RUN); python setup.py sdist bdist_wheel
32+
entrypoints: ## Generate plugin entrypoints for Python package
33+
$(VENV_RUN); python -m plux entrypoints
3334

34-
build: ## Build the extension
35-
mkdir -p build
36-
cp -r setup.py setup.cfg README.md aws_proxy build/
37-
(cd build && python setup.py sdist)
35+
build: entrypoints ## Build the extension
36+
$(VENV_RUN); python -m build --no-isolation . --outdir build
37+
@# make sure that the entrypoints are contained in the dist folder and are non-empty
38+
@test -s localstack_extension_aws_proxy.egg-info/entry_points.txt || (echo "Entrypoints were not correctly created! Aborting!" && exit 1)
3839

39-
enable: $(wildcard ./build/dist/localstack_extension_aws_proxy-*.tar.gz) ## Enable the extension in LocalStack
40+
enable: $(wildcard ./build/localstack_extension_aws_proxy-*.tar.gz) ## Enable the extension in LocalStack
4041
$(VENV_RUN); \
4142
pip uninstall --yes localstack-extension-aws-proxy; \
4243
localstack extensions -v install file://$?

aws-proxy/pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,19 @@ authors = [
1313
]
1414

1515
dependencies = [
16-
"localstack-ext"
16+
"localstack"
1717
]
1818

1919
[project.optional-dependencies]
2020
test=[
21+
"boto3",
2122
"pytest",
2223
"pytest-httpserver",
23-
"ruff"
24+
"rolo",
25+
"ruff",
26+
"setuptools",
27+
"setuptools_scm",
28+
"wheel"
2429
]
2530

2631

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
import re
2+
from urllib.parse import urlparse
3+
4+
import boto3
5+
from botocore.client import Config
6+
from localstack.aws.connect import connect_to
7+
8+
from aws_proxy.shared.models import ProxyConfig
9+
10+
111
def test_secretsmanager_requests(start_aws_proxy):
2-
# TODO implement
3-
pass
12+
# start proxy
13+
config = ProxyConfig(services={"secretsmanager": {"resources": ".*"}})
14+
start_aws_proxy(config)
15+
16+
# create clients
17+
sm_client = connect_to().secretsmanager
18+
sm_client_aws = boto3.client("s3")
19+
20+
# list buckets to assert that proxy is up and running
21+
buckets_proxied = sm_client.list_buckets()["Buckets"]
22+
buckets_aws = sm_client_aws.list_buckets()["Buckets"]
23+
assert buckets_proxied == buckets_aws

0 commit comments

Comments
 (0)