Skip to content

Commit 1bfe216

Browse files
authored
allow legacy port handling for OpenSearch (to support OPENSEARCH_ENDPOINT_STRATEGY=off), cleanup pipeline (#37)
1 parent 7a7e2af commit 1bfe216

File tree

6 files changed

+16
-26
lines changed

6 files changed

+16
-26
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,13 @@ jobs:
2727
python-version: ${{ matrix.python-version }}
2828

2929
- name: Upgrade pip version
30-
run: |
31-
python3 -m pip install --upgrade pip
30+
run: python3 -m pip install --upgrade pip
3231

3332
- name: Install Dependencies
34-
run: |
35-
make install
36-
37-
- name: Test
38-
run: |
39-
pip install pep8 nose boto3 localstack
40-
docker pull localstack/localstack
41-
localstack start -d
42-
make test
33+
run: make install
4334

4435
- name: Lint
45-
run: |
46-
pip install pycodestyle
47-
make lint
36+
run: make lint
37+
38+
- name: Test
39+
run: make test

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# LocalStack Python Client Change Log
22

3+
* v1.30: Allow legacy port handling for OpenSearch (to support `OPENSEARCH_ENDPOINT_STRATEGY=off`)
34
* v1.29: Add endpoint for OpenSearch
45
* v1.28: Add endpoint for Route53Resolver
56
* v1.27: Add endpoint for SESv2

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ install: ## Install dependencies in local virtualenv folder
99
(test `which virtualenv` || $(PIP_CMD) install --user virtualenv) && \
1010
(test -e $(VENV_DIR) || virtualenv $(VENV_OPTS) $(VENV_DIR)) && \
1111
($(VENV_RUN) && $(PIP_CMD) install --upgrade pip) && \
12-
(test ! -e setup.cfg || ($(VENV_RUN); $(PIP_CMD) install .))
12+
(test ! -e setup.cfg || ($(VENV_RUN); $(PIP_CMD) install .[test]))
1313

1414
publish: ## Publish the library to the central PyPi repository
1515
# build and upload archive
1616
($(VENV_RUN) && ./setup.py sdist upload)
1717

1818
test: ## Run automated tests
19-
make lint && \
20-
($(VENV_RUN); test `which localstack` || pip install localstack) && \
21-
$(VENV_RUN); DEBUG=$(DEBUG) PYTHONPATH=`pwd` nosetests --with-coverage --logging-level=WARNING --nocapture --no-skip --exe --cover-erase --cover-tests --cover-inclusive --cover-package=localstack_client --with-xunit --exclude='$(VENV_DIR).*' .
19+
($(VENV_RUN); test `which localstack` || pip install .[test]) && \
20+
$(VENV_RUN); DEBUG=$(DEBUG) PYTHONPATH=`pwd` nosetests --with-coverage --logging-level=WARNING --nocapture --no-skip --exe --cover-erase --cover-tests --cover-inclusive --cover-package=localstack_client --with-xunit --exclude='$(VENV_DIR).*' .
2221

2322
lint: ## Run code linter to check code style
2423
($(VENV_RUN); pycodestyle --max-line-length=100 --ignore=E128 --exclude=node_modules,legacy,$(VENV_DIR),dist .)

localstack_client/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
# TODO remove service port mapping above entirely
111111
if os.environ.get('USE_LEGACY_PORTS') not in ['1', 'true']:
112112
for key, value in _service_endpoints_template.items():
113-
if key not in ['dashboard', 'elasticsearch']:
113+
if key not in ['dashboard', 'elasticsearch', 'opensearch']:
114114
_service_endpoints_template[key] = '%s:%s' % (value.rpartition(':')[0], EDGE_PORT)
115115

116116

setup.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = localstack-client
3-
version = 1.29
3+
version = 1.30
44
url = https://github.com/localstack/localstack-python-client
55
author = LocalStack Team
66
author_email = info@localstack.cloud
@@ -34,3 +34,4 @@ test =
3434
coverage
3535
pycodestyle
3636
nose
37+
localstack

tests/client/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@
77
def setup_package():
88
if STATE.get('process'):
99
return
10-
STATE['process'] = subprocess.Popen(['localstack', 'start'])
11-
time.sleep(10)
10+
STATE['process'] = subprocess.Popen(['localstack', 'start', '-d'])
11+
subprocess.Popen(['localstack', 'wait']).wait()
1212

1313

1414
def teardown_package():
15-
# TODO implement "stop" command in LocalStack!
16-
# subprocess.check_call('localstack stop', shell=True)
17-
STATE['process'].terminate()
18-
time.sleep(2)
15+
subprocess.Popen(['localstack', 'stop']).wait()

0 commit comments

Comments
 (0)