Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/test_djelme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ jobs:
python: ['3.10', '3.11', '3.12', '3.13', '3.14']
django: ['4.2', '5.1', '5.2']
services:
elasticsearch6:
image: elasticsearch:6.8.23
ports:
- 9206:9200
elasticsearch8:
image: elasticsearch:8.19.11
ports:
Expand All @@ -51,9 +47,8 @@ jobs:
run: alias python${{ steps.setup-py.outputs.python-version }}=${{ steps.setup-py.outputs.python-path }}

- name: install despondencies
run: pip install -U poetry && poetry install --with=dev --extras=elastic6 --extras=elastic8
run: pip install -U poetry && poetry install --with=dev --extras=elastic8

- run: TOXENV=`echo 'py${{ matrix.python }}-django${{matrix.django}}' | sed 's/\.//g'` poetry run tox
env:
ELASTICSEARCH6_URL: http://localhost:9206
ELASTICSEARCH8_URL: http://localhost:9208
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ install [poetry](https://python-poetry.org):
pip install poetry
```

install the current project (in editable mode) and dependencies (with the `dev` dependency group and the extras `elastic6`, `elastic8`, `anydjango`):
install the current project (in editable mode) and dependencies (with the `dev` dependency group and the extras `elastic8`, `anydjango`):
```
poetry install --with=dev --extras=elastic6 --extras=elastic8 --extras=anydjango
poetry install --with=dev --extras=elastic8 --extras=anydjango
```

### run tests and checks

these expect elasticsearches to be running and configured in `elasticsearch_metrics/tests/settings.py` (or set environment variables `ELASTICSEARCH6_URL` and `ELASTICSEARCH8_URL`) -- see `using docker-style container tools`, below, for one way to do that
these expect elasticsearch to be running and configured in `elasticsearch_metrics/tests/settings.py` (or set environment variable and `ELASTICSEARCH8_URL`) -- see `using docker-style container tools`, below, for one way to do that

running the python module `elasticsearch_metrics.tests` will run tests and linting checks
-- any code merged to `main` should pass for all supported python and django combinations
Expand Down Expand Up @@ -93,9 +93,9 @@ see `testbox.Containerfile` and `docker-compose.yml` for a local setup -- runnin

(note: examples use `pc` aliased to a `docker-compose` equivalent)

start elasticsearches in the background
start elasticsearch in the background
```
pc up -d elasticsearch6 elasticsearch8
pc up -d elasticsearch8
```

run tests and lint
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@ Django app for storing time-series metrics in Elasticsearch.
python importables:
- `elasticsearch_metrics`
- `elasticsearch_metrics.imps.elastic8` (an implementation with elasticsearch 8)
- `elasticsearch_metrics.imps.elastic6` (an implementation with elasticsearch 6; deprecated)
- ...

## Pre-requisites

* Python >=3.10
* Django 4.2, 5.1, or 5.2
* Elasticsearch 8 (or 6, for deprecated back-compat)
* Elasticsearch 8

## Install

Expand Down
12 changes: 1 addition & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
version: '3'
services:
elasticsearch6:
image: docker.elastic.co/elasticsearch/elasticsearch:6.3.1
healthcheck:
interval: 30s
retries: 10
test: curl -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"'
networks:
- djelme
elasticsearch8:
image: docker.elastic.co/elasticsearch/elasticsearch:8.19.11
environment:
- xpack.security.enabled=false
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms256m -Xmx256m # reduce memory usage
healthcheck:
interval: 30s
retries: 10
Expand All @@ -24,13 +17,10 @@ services:
context: .
dockerfile: testbox.Containerfile
depends_on:
elasticsearch6:
condition: service_healthy
elasticsearch8:
condition: service_healthy
environment:
# TOXENV: py310-django42
ELASTICSEARCH6_URL: elasticsearch6:9200
ELASTICSEARCH8_URL: http://elasticsearch8:9200
networks:
- djelme
Expand Down
5 changes: 1 addition & 4 deletions elasticsearch_metrics/imps/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
__all__ = (
"elastic6",
"elastic8",
)
__all__ = ("elastic8",)
Loading