From 078bea4345f1497d1e6f2bec23e10ef0f2adb804 Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Tue, 21 Aug 2018 12:13:53 -0400 Subject: [PATCH] Move rustapi_module into examples This is really a test module, but the Rust convention is to put something like this under examples/, and when it lands, we can take advantage of "Project-based Examples for Cargo Projects" - RFC link at https://github.com/rust-lang/rfcs/pull/2517 --- Cargo.toml | 1 - ci/travis/test.sh | 12 ++++++------ {tests => examples}/rustapi_module/.gitignore | 0 {tests => examples}/rustapi_module/Cargo.toml | 0 {tests => examples}/rustapi_module/pyproject.toml | 0 .../rustapi_module/requirements-dev.txt | 0 .../rustapi_module/rustapi_module/__init__.py | 0 {tests => examples}/rustapi_module/setup.py | 0 {tests => examples}/rustapi_module/src/lib.rs | 0 .../rustapi_module/tests/test_datetime.py | 0 {tests => examples}/rustapi_module/tox.ini | 0 11 files changed, 6 insertions(+), 7 deletions(-) rename {tests => examples}/rustapi_module/.gitignore (100%) rename {tests => examples}/rustapi_module/Cargo.toml (100%) rename {tests => examples}/rustapi_module/pyproject.toml (100%) rename {tests => examples}/rustapi_module/requirements-dev.txt (100%) rename {tests => examples}/rustapi_module/rustapi_module/__init__.py (100%) rename {tests => examples}/rustapi_module/setup.py (100%) rename {tests => examples}/rustapi_module/src/lib.rs (100%) rename {tests => examples}/rustapi_module/tests/test_datetime.py (100%) rename {tests => examples}/rustapi_module/tox.ini (100%) diff --git a/Cargo.toml b/Cargo.toml index 672aa210..c6cd5141 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,5 +56,4 @@ members = [ "pyo3cls", "pyo3-derive-backend", "examples/*", - "tests/rustapi_module", ] diff --git a/ci/travis/test.sh b/ci/travis/test.sh index 4f69b17a..cd4b9c5f 100755 --- a/ci/travis/test.sh +++ b/ci/travis/test.sh @@ -7,11 +7,11 @@ cargo test --features $FEATURES for example in examples/*; do cd $example - python setup.py install - pytest -v tests + if [ -f tox.ini ]; then + tox -e py + else + pip install -e . + pytest -v tests + fi cd $TRAVIS_BUILD_DIR done - -cd tests/rustapi_module -tox -e py -cd $TRAVIS_BUILD_DIR diff --git a/tests/rustapi_module/.gitignore b/examples/rustapi_module/.gitignore similarity index 100% rename from tests/rustapi_module/.gitignore rename to examples/rustapi_module/.gitignore diff --git a/tests/rustapi_module/Cargo.toml b/examples/rustapi_module/Cargo.toml similarity index 100% rename from tests/rustapi_module/Cargo.toml rename to examples/rustapi_module/Cargo.toml diff --git a/tests/rustapi_module/pyproject.toml b/examples/rustapi_module/pyproject.toml similarity index 100% rename from tests/rustapi_module/pyproject.toml rename to examples/rustapi_module/pyproject.toml diff --git a/tests/rustapi_module/requirements-dev.txt b/examples/rustapi_module/requirements-dev.txt similarity index 100% rename from tests/rustapi_module/requirements-dev.txt rename to examples/rustapi_module/requirements-dev.txt diff --git a/tests/rustapi_module/rustapi_module/__init__.py b/examples/rustapi_module/rustapi_module/__init__.py similarity index 100% rename from tests/rustapi_module/rustapi_module/__init__.py rename to examples/rustapi_module/rustapi_module/__init__.py diff --git a/tests/rustapi_module/setup.py b/examples/rustapi_module/setup.py similarity index 100% rename from tests/rustapi_module/setup.py rename to examples/rustapi_module/setup.py diff --git a/tests/rustapi_module/src/lib.rs b/examples/rustapi_module/src/lib.rs similarity index 100% rename from tests/rustapi_module/src/lib.rs rename to examples/rustapi_module/src/lib.rs diff --git a/tests/rustapi_module/tests/test_datetime.py b/examples/rustapi_module/tests/test_datetime.py similarity index 100% rename from tests/rustapi_module/tests/test_datetime.py rename to examples/rustapi_module/tests/test_datetime.py diff --git a/tests/rustapi_module/tox.ini b/examples/rustapi_module/tox.ini similarity index 100% rename from tests/rustapi_module/tox.ini rename to examples/rustapi_module/tox.ini