Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
chore: allow WITH_RUST=false to disable the rust build
Browse files Browse the repository at this point in the history
also update travis to (hopefully) latest pypy

Closes: #1046
  • Loading branch information
pjenvey committed Oct 17, 2017
1 parent 53fb748 commit 7da04f1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ matrix:
include:
- python: 2.7
env: TOXENV=py27 DDB=true CODECOV=true
- python: pypy-5.7.1
- python: pypy
env: TOXENV=pypy DDB=true CODECOV=true
- env: TOXENV=flake8
- env: TOXENV=flake8 WITH_RUST=false
- python: 3.6
env: TOXENV=py36-mypy
env: TOXENV=py36-mypy WITH_RUST=false
allow_failures:
- env: TOXENV=py36-mypy
- env: TOXENV=py36-mypy WITH_RUST=false

before_install:
# https://github.com/travis-ci/travis-ci/issues/7940
Expand All @@ -26,7 +26,7 @@ before_install:
install:
- ${DDB:+make ddb}
- pip install tox ${CODECOV:+codecov}
- curl https://sh.rustup.rs | sh -s -- -y
- if [ ${WITH_RUST:-true} != "false" ]; then curl https://sh.rustup.rs | sh -s -- -y || travis_terminate 1; fi
- export PATH=$PATH:$HOME/.cargo/bin
script:
- tox -- ${CODECOV:+--with-coverage --cover-xml --cover-package=autopush}
Expand Down
15 changes: 10 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@
with io.open(os.path.join(here, 'CHANGELOG.md'), encoding='utf8') as f:
CHANGES = f.read()

WITH_RUST = os.environ.get('WITH_RUST', 'true').lower() not in ('false', '0')

extra_options = {
"packages": find_packages(),
}
if WITH_RUST:
extra_options.update(
setup_requires=['snaek'],
install_requires=['snaek'],
snaek_rust_modules=[
('autopush_rs._native', 'autopush_rs/'),
],
)


setup(name="AutoPush",
Expand Down Expand Up @@ -45,10 +55,5 @@
[nose.plugins]
object-tracker = autopush.noseplugin:ObjectTracker
""",
setup_requires=['snaek'],
install_requires=['snaek'],
snaek_rust_modules=[
('autopush_rs._native', 'autopush_rs/'),
],
**extra_options
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ setenv = with_gmp=no

[testenv:flake8]
commands = flake8 autopush
deps += flake8
deps = flake8

[testenv:py36-mypy]
commands = mypy autopush
Expand Down

0 comments on commit 7da04f1

Please sign in to comment.