From 9de5472f9ca60be331e69b449a65650f6cbfdd89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Sun, 5 Jan 2020 23:04:58 +0100 Subject: [PATCH] travis: Enable mac build. --- .cargo/config | 5 +++++ .travis.yml | 42 ++++++++++++++++++++++++++++++++---------- Pipfile | 4 ++-- Pipfile.lock | 18 ++++++++++-------- 4 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 .cargo/config diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 0000000..15d5d32 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,5 @@ +[target.x86_64-apple-darwin] +rustflags = [ + "-C", "link-arg=-undefined", + "-C", "link-arg=dynamic_lookup", +] diff --git a/.travis.yml b/.travis.yml index 1a2d329..767a900 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ -dist: bionic - language: python +dist: bionic services: - docker @@ -46,21 +45,44 @@ before_script: jobs: include: + - os: osx + osx_image: xcode11.3 + language: rust + install: + - pip3 install -U maturin pytest + - maturin list-python + - cargo build + - cp target/debug/libtantivy.dylib tantivy/tantivy.so + script: + - python3 -m pytest -v - language: rust name: 'rust linters' install: rustup component add clippy rustfmt script: - - cargo clippy - - cargo fmt -- --check + - cargo clippy + - cargo fmt -- --check stage: lint script: - pipenv run py.test -rws -v tests/ deploy: - provider: script - script: "ci/deploy.sh" - on: - tags: true - repo: tantivy-search/tantivy-py - python: 3.8 + # Deploy for linux using the manylinux docker image. + provider: script + script: "ci/deploy.sh" + on: + tags: true + condition: $TRAVIS_OS_NAME = linux + repo: tantivy-search/tantivy-py + provider: script + script: "ci/deploy.sh" + + # Deploy for macos using maturin directly + provider: script + script: + - maturin list-python + - maturin publish --interpreter python3.7 --username __token__ --password $MATURIN_PASSWORD --no-sdist + on: + tags: true + condition: $TRAVIS_OS_NAME = osx + repo: tantivy-search/tantivy-py diff --git a/Pipfile b/Pipfile index ee65506..e11d515 100644 --- a/Pipfile +++ b/Pipfile @@ -8,5 +8,5 @@ maturin = ">=0.7.7" pytest = ">=4.0" e1839a8 = {path = "."} -[requires] -python_version = "3.8" +[packages] +e1839a8 = {path = "."} diff --git a/Pipfile.lock b/Pipfile.lock index 027a35d..acf08ef 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,12 +1,10 @@ { "_meta": { "hash": { - "sha256": "1c94e878490fee6005d6f867575b7724b9129e90d5f766d8344985bb9b3a4e07" + "sha256": "41c202984a446d0a86a392ae69f2ffb01299874a6ef817a8353daddc8bb80175" }, "pipfile-spec": 6, - "requires": { - "python_version": "3.8" - }, + "requires": {}, "sources": [ { "name": "pypi", @@ -15,7 +13,11 @@ } ] }, - "default": {}, + "default": { + "e1839a8": { + "path": "." + } + }, "develop": { "attrs": { "hashes": [ @@ -48,10 +50,10 @@ }, "packaging": { "hashes": [ - "sha256:28b924174df7a2fa32c1953825ff29c61e2f5e082343165438812f00d3a7fc47", - "sha256:d9551545c6d761f3def1677baf08ab2a3ca17c56879e70fecba2fc4dde4ed108" + "sha256:aec3fdbb8bc9e4bb65f0634b9f551ced63983a529d6a8931817d52fdd0816ddb", + "sha256:fe1d8331dfa7cc0a883b49d75fc76380b2ab2734b220fbb87d774e4fd4b851f8" ], - "version": "==19.2" + "version": "==20.0" }, "pluggy": { "hashes": [