From 0e5786e854a4c85857f0ce51016f280b3ebdbdee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20Binet?= Date: Fri, 2 Jul 2021 22:46:02 +0200 Subject: [PATCH 1/3] update make files to include tests command, improve setup.py --- Makefile | 3 +++ setup.py | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d7525c3b..5c4e5176 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,9 @@ develop: doc-references: -make -C docs api-doc +tests: + pytest + coverage: coverage run --source=./pandagg -m pytest coverage report diff --git a/setup.py b/setup.py index ff340581..93e505c9 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,15 @@ install_requires = ["six", "future", "lighttree==1.1.1", "elasticsearch>=7.0.0,<8.0.0"] +develop_requires = [ + "pre-commit", + "black", + "flake8", + "pytest", + "pytest-cov", + "mock", + "pandas", +] setup( name="pandagg", @@ -30,6 +39,7 @@ test_suite="pandagg.tests", zip_safe=False, install_requires=install_requires, - setup_requires=["pytest-runner"], + extras_require={"develop": develop_requires}, + tests_require=develop_requires, license="Apache-2.0", ) From f47166e4a6bcbddbe80d0bf559639dd51d4e287f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20Binet?= Date: Fri, 2 Jul 2021 22:46:18 +0200 Subject: [PATCH 2/3] make composite aggregation available --- pandagg/node/aggs/composite.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pandagg/node/aggs/composite.py b/pandagg/node/aggs/composite.py index a86ed0aa..dcc35ddb 100644 --- a/pandagg/node/aggs/composite.py +++ b/pandagg/node/aggs/composite.py @@ -2,6 +2,10 @@ class Composite(BucketAggClause): + + KEY = "composite" + VALUE_ATTRS = ["doc_count"] + def __init__(self, sources, size=None, after_key=None, meta=None, **body): """https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-composite-aggregation.html :param sources: From 542350f84ca4497ab4a5f01b054aff2385f6827e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20Binet?= Date: Fri, 2 Jul 2021 23:00:13 +0200 Subject: [PATCH 3/3] proper installation during CI --- .github/workflows/python-3-tests.yml | 3 +-- requirements-test.txt | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 requirements-test.txt diff --git a/.github/workflows/python-3-tests.yml b/.github/workflows/python-3-tests.yml index 024d5a6f..2b74c4b0 100644 --- a/.github/workflows/python-3-tests.yml +++ b/.github/workflows/python-3-tests.yml @@ -52,8 +52,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements-test.txt - python setup.py develop + pip install -e ".[develop]" - name: Test with pytest and generate coverage report run: pytest --cov=./pandagg --cov-report=xml diff --git a/requirements-test.txt b/requirements-test.txt deleted file mode 100644 index 1ce53a8e..00000000 --- a/requirements-test.txt +++ /dev/null @@ -1,7 +0,0 @@ -pre-commit -black -flake8 -pytest -pytest-cov -mock -pandas