You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2019/08/06 19:41:57 UTC
[incubator-iceberg] branch master updated: Add Travis CI config for
Python (#354)
This is an automated email from the ASF dual-hosted git repository.
blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iceberg.git
The following commit(s) were added to refs/heads/master by this push:
new db74f62 Add Travis CI config for Python (#354)
db74f62 is described below
commit db74f620a16b1a864fc6a5777607f7cf60a4ba8e
Author: chyzzqo2 <52...@users.noreply.github.com>
AuthorDate: Tue Aug 6 12:41:53 2019 -0700
Add Travis CI config for Python (#354)
---
.gitignore | 15 ++++++++++
.travis.yml | 35 ++++++++++++++++------
python/iceberg/__init__.py | 1 -
python/iceberg/api/expressions/evaluator.py | 2 +-
.../api/expressions/strict_metrics_evaluator.py | 8 +++--
python/iceberg/core/util/bin_packing.py | 1 +
python/tests/__init__.py | 1 -
python/tests/api/__init__.py | 1 -
python/tests/api/test_helpers.py | 12 ++++----
python/tests/api/transforms/__init__.py | 1 -
python/tests/api/types/__init__.py | 1 -
python/tests/core/__init__.py | 1 -
python/tests/core/avro/__init__.py | 1 -
python/tests/core/utils/test_bin_packing.py | 4 +--
14 files changed, 56 insertions(+), 28 deletions(-)
diff --git a/.gitignore b/.gitignore
index 5550eda..39b79f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,18 @@ build
out
# web site build
site/site
+
+__pycache__/
+*.py[cod]
+.eggs/
+.tox/
+env/
+venv/
+*.egg-info/
+test-reports
+build/
+dist/
+sdist/
+.coverage
+coverage.xml
+.pytest_cache/
diff --git a/.travis.yml b/.travis.yml
index a90a272..01f12ff 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,18 +17,35 @@
# under the License.
#
-language: java
sudo: false
dist: trusty
-before_cache:
- - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
-
-cache:
- directories:
- - $HOME/.gradle/caches/
- - $HOME/.gradle/wrapper/
+matrix:
+ include:
+ - language: java
+ name: java
+ before_cache:
+ - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
+ - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
+ cache:
+ directories:
+ - $HOME/.gradle/caches/
+ - $HOME/.gradle/wrapper/
+ - language: python
+ python: 3.6
+ install: pip install tox-travis
+ before_script:
+ - cd python
+ script: tox
+ deploy:
+ provider: pypi
+ user: TBD
+ password:
+ secure: TBD
+ distributions: "sdist bdist_wheel"
+ skip_existing: true
+ on:
+ tags: true
git:
depth: false
diff --git a/python/iceberg/__init__.py b/python/iceberg/__init__.py
index 2456923..13a8339 100644
--- a/python/iceberg/__init__.py
+++ b/python/iceberg/__init__.py
@@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
diff --git a/python/iceberg/api/expressions/evaluator.py b/python/iceberg/api/expressions/evaluator.py
index 3b0bbc6..3f2a29f 100644
--- a/python/iceberg/api/expressions/evaluator.py
+++ b/python/iceberg/api/expressions/evaluator.py
@@ -25,7 +25,7 @@ class Evaluator(object):
THREAD_LOCAL_DATA = threading.local()
def visitor(self):
- if not hasattr(Evaluator.THREAD_LOCAL_DATA, "visitors") :
+ if not hasattr(Evaluator.THREAD_LOCAL_DATA, "visitors"):
Evaluator.THREAD_LOCAL_DATA.visitors = Evaluator.EvalVisitor()
return Evaluator.THREAD_LOCAL_DATA.visitors
diff --git a/python/iceberg/api/expressions/strict_metrics_evaluator.py b/python/iceberg/api/expressions/strict_metrics_evaluator.py
index c8c8a78..a1752f9 100644
--- a/python/iceberg/api/expressions/strict_metrics_evaluator.py
+++ b/python/iceberg/api/expressions/strict_metrics_evaluator.py
@@ -26,9 +26,11 @@ class StrictMetricsEvaluator(object):
def visitor(self):
if not hasattr(self.thread_local_data, "visitors"):
- self.thread_local_data.visitors = StrictMetricsEvaluator.MetricsEvalVisitor(self.expr,
- self.schema,
- self.struct)
+ self.thread_local_data.visitors = StrictMetricsEvaluator.MetricsEvalVisitor(
+ self.expr,
+ self.schema,
+ self.struct
+ )
return self.thread_local_data.visitors
diff --git a/python/iceberg/core/util/bin_packing.py b/python/iceberg/core/util/bin_packing.py
index d7a3105..1ccca2e 100644
--- a/python/iceberg/core/util/bin_packing.py
+++ b/python/iceberg/core/util/bin_packing.py
@@ -17,6 +17,7 @@
from copy import deepcopy
+
class PackingIterator(object):
def __init__(self, items, target_weight, lookback, weight_func):
diff --git a/python/tests/__init__.py b/python/tests/__init__.py
index 2456923..13a8339 100644
--- a/python/tests/__init__.py
+++ b/python/tests/__init__.py
@@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
diff --git a/python/tests/api/__init__.py b/python/tests/api/__init__.py
index 2456923..13a8339 100644
--- a/python/tests/api/__init__.py
+++ b/python/tests/api/__init__.py
@@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
diff --git a/python/tests/api/test_helpers.py b/python/tests/api/test_helpers.py
index baaabbe..c526e5f 100644
--- a/python/tests/api/test_helpers.py
+++ b/python/tests/api/test_helpers.py
@@ -49,14 +49,14 @@ class TestHelpers(object):
class CheckReferencesBound(ExpressionVisitors.ExpressionVisitor):
- def __init__(self, message):
- self.message = message
+ def __init__(self, message):
+ self.message = message
- def predicate(self, pred):
- if isinstance(pred, UnboundPredicate):
- assert_true(False)
+ def predicate(self, pred):
+ if isinstance(pred, UnboundPredicate):
+ assert_true(False)
- return None
+ return None
class TestDataFile(DataFile):
diff --git a/python/tests/api/transforms/__init__.py b/python/tests/api/transforms/__init__.py
index 2456923..13a8339 100644
--- a/python/tests/api/transforms/__init__.py
+++ b/python/tests/api/transforms/__init__.py
@@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
diff --git a/python/tests/api/types/__init__.py b/python/tests/api/types/__init__.py
index 2456923..13a8339 100644
--- a/python/tests/api/types/__init__.py
+++ b/python/tests/api/types/__init__.py
@@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
diff --git a/python/tests/core/__init__.py b/python/tests/core/__init__.py
index 2456923..13a8339 100644
--- a/python/tests/core/__init__.py
+++ b/python/tests/core/__init__.py
@@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
diff --git a/python/tests/core/avro/__init__.py b/python/tests/core/avro/__init__.py
index 2456923..13a8339 100644
--- a/python/tests/core/avro/__init__.py
+++ b/python/tests/core/avro/__init__.py
@@ -14,4 +14,3 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-
diff --git a/python/tests/core/utils/test_bin_packing.py b/python/tests/core/utils/test_bin_packing.py
index a35386e..8e5ccc0 100644
--- a/python/tests/core/utils/test_bin_packing.py
+++ b/python/tests/core/utils/test_bin_packing.py
@@ -17,14 +17,14 @@
import random
-from iceberg.core.util import PackingIterator
+from iceberg.core.util.bin_packing import PackingIterator
import pytest
@pytest.mark.parametrize("splits,lookback,split_size, open_cost", [
([random.randint(0, 64) for x in range(200)], 20, 128, 4), # random splits
([], 20, 128, 4), # no splits
- ([0]*100 + [random.randint(0, 64) for x in range(10)] + [0]*100, 20, 128, 4) # sparse
+ ([0] * 100 + [random.randint(0, 64) for x in range(10)] + [0] * 100, 20, 128, 4) # sparse
])
def test_bin_packing(splits, lookback, split_size, open_cost):