Skip to content

Commit e275344

Browse files
authored
Switch from Travis CI to GitHub Actions
1 parent 1408aa9 commit e275344

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+108
-95
lines changed

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
name: CI
3+
4+
on: [push, pull_request]
5+
6+
jobs:
7+
package:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout Repository
11+
uses: actions/checkout@v1
12+
- name: Set up Python 3.8
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: 3.8
16+
- name: Install dependencies
17+
run: |
18+
python3.8 -m pip install setuptools wheel twine
19+
- name: Build packages
20+
run: |
21+
python3.8 utils/build-dists.py
22+
- name: Check packages
23+
run: |
24+
set -exo pipefail;
25+
if [ $(python3.8 -m twine check dist/* | grep -c 'warning') != 0 ]; then exit 1; fi
26+
27+
lint:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout Repository
31+
uses: actions/checkout@v1
32+
- name: Set up Python 3.8
33+
uses: actions/setup-python@v1
34+
with:
35+
python-version: 3.8
36+
- name: Install dependencies
37+
run: |
38+
python3.8 -m pip install nox
39+
- name: Lint the code
40+
run: nox -s lint
41+
42+
docs:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Checkout Repository
46+
uses: actions/checkout@v1
47+
- name: Set up Python 3.8
48+
uses: actions/setup-python@v1
49+
with:
50+
python-version: 3.8
51+
- name: Install dependencies
52+
run: |
53+
python3.8 -m pip install nox
54+
- name: Build the docs
55+
run: nox -s docs
56+
57+
test-linux:
58+
runs-on: ubuntu-latest
59+
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
64+
es-version: [7.0.0, 7.10.0]
65+
66+
steps:
67+
- name: Checkout Repository
68+
uses: actions/checkout@v1
69+
- name: Setup Elasticsearch
70+
run: |
71+
mkdir /tmp/elasticsearch
72+
wget -O - https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${{ matrix.es-version }}-linux-x86_64.tar.gz | tar xz --directory=/tmp/elasticsearch --strip-components=1
73+
/tmp/elasticsearch/bin/elasticsearch -d
74+
- name: Setup Python - ${{ matrix.python-version }}
75+
uses: actions/setup-python@v1
76+
with:
77+
python-version: ${{ matrix.python-version }}
78+
- name: Set up Python 3.8 for Nox
79+
if: matrix.python-version != '3.8'
80+
uses: actions/setup-python@v1
81+
with:
82+
python-version: 3.8
83+
- name: Install dependencies
84+
run: |
85+
python3.8 -m pip install nox
86+
- name: Run Tests
87+
run: |
88+
nox -rs test-${{ matrix.python-version }}

.travis.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion

noxfile.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,25 @@
2323
"docs/",
2424
"elasticsearch_dsl/",
2525
"examples/",
26-
"test_elasticsearch_dsl/",
26+
"tests/",
2727
"utils/",
2828
)
2929

3030

31-
@nox.session(python=["2.7", "3.4", "3.5", "3.6", "3.7", "3.8"])
31+
@nox.session(python=["2.7", "3.4", "3.5", "3.6", "3.7", "3.8", "3.9"])
3232
def test(session):
3333
session.install(".[develop]")
3434

35-
session.run("python", "setup.py", "test")
35+
if session.posargs:
36+
argv = session.posargs
37+
else:
38+
argv = (
39+
"-vvv",
40+
"--cov=elasticsearch_dsl",
41+
"--cov=tests.test_integration.test_examples",
42+
"tests/",
43+
)
44+
session.run("pytest", *argv)
3645

3746

3847
@nox.session()

setup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@
3636
'ipaddress; python_version<"3.3"',
3737
]
3838

39-
tests_require = [
39+
develop_requires = [
4040
"mock",
4141
"pytest>=3.0.0",
4242
"pytest-cov",
4343
"pytest-mock<3.0.0",
4444
"pytz",
4545
"coverage<5.0.0",
46+
"sphinx",
47+
"sphinx_rtd_theme",
4648
]
4749

4850
setup(
@@ -51,12 +53,13 @@
5153
license="Apache-2.0",
5254
url="https://github.com/elasticsearch/elasticsearch-dsl-py",
5355
long_description=long_description,
56+
long_description_content_type="text/x-rst",
5457
version=__versionstr__,
5558
author="Honza Král",
5659
author_email="[email protected]",
5760
maintainer="Seth Michael Larson",
5861
maintainer_email="[email protected]",
59-
packages=find_packages(where=".", exclude=("test_elasticsearch_dsl*",)),
62+
packages=find_packages(where=".", exclude=("tests*",)),
6063
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
6164
classifiers=[
6265
"Development Status :: 4 - Beta",
@@ -77,7 +80,5 @@
7780
"Programming Language :: Python :: Implementation :: PyPy",
7881
],
7982
install_requires=install_requires,
80-
test_suite="test_elasticsearch_dsl.run_tests.run_all",
81-
tests_require=tests_require,
82-
extras_require={"develop": tests_require + ["sphinx", "sphinx_rtd_theme"]},
83+
extras_require={"develop": develop_requires},
8384
)

test_elasticsearch_dsl/run_tests.py

Lines changed: 0 additions & 45 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test_elasticsearch_dsl/test_integration/test_document.py renamed to tests/test_integration/test_document.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@
4242
)
4343
from elasticsearch_dsl.utils import AttrList
4444

45-
snowball = analyzer(
46-
"my_snow", tokenizer="standard", filter=["standard", "lowercase", "snowball"]
47-
)
45+
snowball = analyzer("my_snow", tokenizer="standard", filter=["lowercase", "snowball"])
4846

4947

5048
class User(InnerDoc):
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)