Skip to content

Commit

Permalink
Switch to Nox for task management
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed Mar 25, 2020
1 parent 9fbb21d commit d603036
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .ci/run-repository.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ docker run \
--name eland-test-runner \
--rm \
elastic/eland \
./run_build.sh
nox -s test
30 changes: 30 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import nox


SOURCE_FILES = (
"setup.py",
"noxfile.py",
"eland/",
"docs/",
)


@nox.session(reuse_venv=True)
def blacken(session):
session.install("black")
session.run("black", "--target-version=py36", *SOURCE_FILES)
lint(session)


@nox.session(reuse_venv=True)
def lint(session):
session.install("black", "flake8")
session.run("black", "--check", "--target-version=py36", *SOURCE_FILES)
session.run("flake8", "--ignore=E501,W503,E402,E712", *SOURCE_FILES)


@nox.session(python=["3.6", "3.7", "3.8"])
def test(session):
session.install("-r", "requirements-dev.txt")
session.run("python", "-m", "eland.tests.setup_tests")
session.run("pytest", "eland/tests/")
4 changes: 2 additions & 2 deletions run_build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

python -m eland.tests.setup_tests
pytest
python -m pip install nox
nox -s lint test
40 changes: 19 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# flake8: noqa

from codecs import open
from os import path

from setuptools import setup, find_packages

here = path.abspath(path.dirname(__file__))
about = {}
with open(path.join(here, 'eland', '_version.py'), 'r', 'utf-8') as f:
with open(path.join(here, "eland", "_version.py"), "r", "utf-8") as f:
exec(f.read(), about)

CLASSIFIERS = [
Expand All @@ -36,16 +38,16 @@
"Topic :: Scientific/Engineering",
]

LONG_DESCRIPTION="""
LONG_DESCRIPTION = """
# What is it?
eland is a Elasticsearch client Python package to analyse, explore and manipulate data that resides in Elasticsearch.
Where possible the package uses existing Python APIs and data structures to make it easy to switch between numpy,
pandas, scikit-learn to their Elasticsearch powered equivalents. In general, the data resides in Elasticsearch and
eland is a Elasticsearch client Python package to analyse, explore and manipulate data that resides in Elasticsearch.
Where possible the package uses existing Python APIs and data structures to make it easy to switch between numpy,
pandas, scikit-learn to their Elasticsearch powered equivalents. In general, the data resides in Elasticsearch and
not in memory, which allows eland to access large datasets stored in Elasticsearch.
For example, to explore data in a large Elasticsearch index, simply create an eland DataFrame from an Elasticsearch
index pattern, and explore using an API that mirrors a subset of the pandas.DataFrame API:
For example, to explore data in a large Elasticsearch index, simply create an eland DataFrame from an Elasticsearch
index pattern, and explore using an API that mirrors a subset of the pandas.DataFrame API:
```
>>> import eland as ed
Expand Down Expand Up @@ -171,22 +173,18 @@
"""

setup(
name=about['__title__'],
version=about['__version__'],
description=about['__description__'],
name=about["__title__"],
version=about["__version__"],
description=about["__description__"],
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
url=about['__url__'],
maintainer=about['__maintainer__'],
maintainer_email=about['__maintainer_email__'],
license='Apache-2.0',
long_description_content_type="text/markdown",
url=about["__url__"],
maintainer=about["__maintainer__"],
maintainer_email=about["__maintainer_email__"],
license="Apache-2.0",
classifiers=CLASSIFIERS,
keywords='elastic eland pandas python',
keywords="elastic eland pandas python",
packages=find_packages(include=["eland", "eland.*"]),
install_requires=[
'elasticsearch>=7.0.5, <8',
'pandas==0.25.3',
'matplotlib'
],
install_requires=["elasticsearch>=7.0.5, <8", "pandas==0.25.3", "matplotlib"],
python_requires=">=3.6",
)

0 comments on commit d603036

Please sign in to comment.