Skip to content

Commit

Permalink
Merge pull request #3 from snipsco/release/0.1.0
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
adrienball authored Jan 24, 2019
2 parents 1bc66db + 3413a67 commit 7165125
Show file tree
Hide file tree
Showing 69 changed files with 3,517 additions and 20 deletions.
56 changes: 56 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
environment:
matrix:
- PYTHON: "C:\\Python27-x64"
TARGET: x86_64-pc-windows-msvc
- PYTHON: "C:\\Python36-x64"
TARGET: x86_64-pc-windows-msvc
- PYTHON: "C:\\Python37-x64"
TARGET: x86_64-pc-windows-msvc

branches:
only:
- develop
- master

install:
- if "%APPVEYOR_REPO_BRANCH%" == "develop" if NOT "%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH:~0,8%" == "release/" if NOT "%APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH:~0,5%" == "main/" appveyor exit
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init.exe -y --default-host %TARGET%
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- if defined MSYS2_BITS set PATH=%PATH%;C:\msys64\mingw%MSYS2_BITS%\bin
- rustc -V
- cargo -V
- ps: (Get-Content python/ffi/Cargo.toml) | ForEach-Object { $_ -replace "^snips-nlu-parsers-ffi-macros = .*$", "snips-nlu-parsers-ffi-macros = { path = `"../../ffi/ffi-macros`" }" } | Set-Content python/ffi/Cargo.toml
- "%PYTHON%\\python.exe -m pip install -r python/requirements.txt"

build: false

test_script:
- cargo build --verbose
- cargo test --all --verbose
- cd python
- "%PYTHON%\\python.exe -m pip install -e . --verbose --install-option=\"--verbose\""
- "%PYTHON%\\python.exe -m unittest discover"

after_test:
- ECHO "BUILDING WHEELS..."
- "%PYTHON%\\python.exe setup.py bdist_wheel"

artifacts:
- path: python\dist\*
name: pypiartifacts

for:
-
branches:
only:
- master

environment:
matrix:
- PYTHON: "C:\\Python27"
TARGET: i686-pc-windows-msvc
- PYTHON: "C:\\Python36"
TARGET: i686-pc-windows-msvc
- PYTHON: "C:\\Python37"
TARGET: i686-pc-windows-msvc
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Generated by Cargo
# will have compiled files and executables
/target/
*/target
*/**/target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# Intellij
/.idea
54 changes: 54 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
language: python
conditions: v1

matrix:
include:
- if: branch = master
os: osx
osx_image: xcode8
language: generic
env:
- TOXENV=py27
- if: branch = master
os: osx
osx_image: xcode8
language: generic
env:
- TOXENV=py36
- if: branch = master
os: osx
osx_image: xcode8
language: generic
env:
- TOXENV=py37
- if: branch = master
os: linux
python: 2.7
env:
- TOXENV=py27
- os: linux
python: 3.6
env:
- TOXENV=py36
- if: branch = master
os: linux
python: 3.7
# cf https://github.com/travis-ci/travis-ci/issues/9815
dist: xenial
sudo: true
env:
- TOXENV=py37

before_install: . ./.travis/before_install.sh

install:
- ./.travis/install.sh

script:
- ./.travis/test.sh

before_script:
- echo $TRAVIS_COMMIT
- echo $TRAVIS_TAG
- echo $TRAVIS_BRANCH
- echo $TRAVIS_BUILD_NUMBER
35 changes: 35 additions & 0 deletions .travis/before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Install Rust
curl https://sh.rustup.rs -sSf | bash -s -- -y
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update || brew update

brew outdated openssl || brew upgrade openssl
brew install [email protected]

# install pyenv
git clone --depth 1 https://github.com/pyenv/pyenv ~/.pyenv
PYENV_ROOT="$HOME/.pyenv"
PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

case "${TOXENV}" in
py27)
pyenv install 2.7.14
pyenv global 2.7.14
;;
py36)
pyenv install 3.6.1
pyenv global 3.6.1
;;
py37)
pyenv install 3.7.2
pyenv global 3.7.2
;;
esac
pyenv rehash

# A manual check that the correct version of Python is running.
python --version
fi
20 changes: 20 additions & 0 deletions .travis/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

export PATH="/usr/local/bin:$HOME/.cargo/bin:$PATH"

PYTHON_PATH=$(which python"$PYTHON_VERSION")
COMMIT_ID=$(git rev-parse --short HEAD)
VENV_PATH="/tmp/venv$PYTHON_VERSION-$COMMIT_ID"

warn() { echo "$@" >&2; }

die() { warn "$@"; exit 1; }

escape() {
echo "$1" | sed 's/\([\.\$\*]\)/\\\1/g'
}

has() {
local item=$1; shift
echo " $@ " | grep -q " $(escape $item) "
}
8 changes: 8 additions & 0 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -ev

source .travis/common.sh

perl -p -i -e \
"s/^snips-nlu-parsers-ffi-macros = .*\$/snips-nlu-parsers-ffi-macros = { path = \"..\/..\/ffi\/ffi-macros\" \}/g" \
python/ffi/Cargo.toml
17 changes: 17 additions & 0 deletions .travis/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -ev

source .travis/common.sh

echo "Running rust tests..."
export PATH="$HOME/.cargo/bin:$PATH"
cargo build --all
cargo test --all

if [ "$TRAVIS_BRANCH" == "master" ]; then
echo "Running python tests..."
cd python
python -m pip install tox
tox
cd ../..
fi
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Changelog
All notable changes to this project will be documented in this file.
29 changes: 29 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[package]
name = "snips-nlu-parsers"
version = "0.1.0"
authors = ["Adrien Ball <[email protected]>"]
edition = "2018"

[workspace]
members = [
".",
"ffi",
"ffi/ffi-macros",
"python/ffi"
]

[dependencies]
failure = "0.1"
itertools = "0.7"
lazy_static = "1.0"
regex = "0.2"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
gazetteer-entity-parser = { git = "https://github.com/snipsco/gazetteer-entity-parser", tag = "0.6.0" }
rustling-ontology = { git = "https://github.com/snipsco/rustling-ontology", tag = "0.17.7" }
snips-nlu-ontology = { git = "https://github.com/snipsco/snips-nlu-ontology", tag = "0.62.0" }
snips-nlu-utils = { git = "https://github.com/snipsco/snips-nlu-utils", tag = "0.7.1" }

[dev-dependencies]
tempfile = "3.0"
27 changes: 9 additions & 18 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
MIT License
## License

Copyright (c) 2019 Snips
Licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
### Contribution

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
Loading

0 comments on commit 7165125

Please sign in to comment.