Skip to content

Commit ee5bc81

Browse files
committed
Merge pull request #8 from python-hyper/validation
Rewrite to have validation code instead.
2 parents e7b6092 + b64d932 commit ee5bc81

21 files changed

+820
-214
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "src/rust-certitude"]
2+
path = src/rust-certitude
3+
url = git://github.com/Lukasa/rust-certitude.git

.travis.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
language: python
2+
3+
# We expressly write out the build matrix here because we need to set the
4+
# appropriate target for each platform. Happily, because there's no Linux
5+
# support yet, this is pretty easy!
6+
matrix:
7+
include:
8+
- language: generic
9+
os: osx
10+
env: TOXENV=py27
11+
- language: generic
12+
os: osx
13+
env: TOXENV=py33
14+
- language: generic
15+
os: osx
16+
env: TOXENV=py34
17+
- language: generic
18+
os: osx
19+
env: TOXENV=py35
20+
- language: generic
21+
os: osx
22+
env: TOXENV=pypy
23+
24+
install:
25+
- ./.travis/install.sh
26+
27+
script:
28+
- ./.travis/run.sh

.travis/install.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
# Update Homebrew and install Rust
7+
brew update
8+
brew install rust
9+
10+
# Install PyEnv
11+
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
12+
PYENV_ROOT="$HOME/.pyenv"
13+
PATH="$PYENV_ROOT/bin:$PATH"
14+
eval "$(pyenv init -)"
15+
16+
case "${TOXENV}" in
17+
py27)
18+
curl -O https://bootstrap.pypa.io/get-pip.py
19+
python get-pip.py --user
20+
;;
21+
py33)
22+
pyenv install 3.3.6
23+
pyenv global 3.3.6
24+
;;
25+
py34)
26+
pyenv install 3.4.4
27+
pyenv global 3.4.4
28+
;;
29+
py35)
30+
pyenv install 3.5.1
31+
pyenv global 3.5.1
32+
;;
33+
pypy*)
34+
pyenv install pypy-4.0.1
35+
pyenv global pypy-4.0.1
36+
;;
37+
esac
38+
pyenv rehash
39+
python -m pip install --user virtualenv
40+
python -m virtualenv ~/.venv
41+
source ~/.venv/bin/activate
42+
pip install tox

.travis/run.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -x
5+
6+
PYENV_ROOT="$HOME/.pyenv"
7+
PATH="$PYENV_ROOT/bin:$PATH"
8+
eval "$(pyenv init -)"
9+
source ~/.venv/bin/activate
10+
11+
tox

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include README.rst LICENSE rust_ext.py
2+
recursive-include src/rust-certitude *.rs *.toml

appveyor.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
version: 1.0.{build}
2+
os:
3+
- Visual Studio 2015
4+
clone_depth: 1
5+
environment:
6+
matrix:
7+
- TOOLCHAIN_VERSION: 14.0
8+
RUST: 1.5.0
9+
PYTHON: "C:\\Python35"
10+
PYTHON_VERSION: "3.5.0"
11+
PYTHON_ARCH: "32"
12+
platform: Win32
13+
14+
- TOOLCHAIN_VERSION: 14.0
15+
RUST: beta
16+
PYTHON: "C:\\Python35"
17+
PYTHON_VERSION: "3.5.0"
18+
PYTHON_ARCH: "32"
19+
platform: Win32
20+
21+
- TOOLCHAIN_VERSION: 14.0
22+
RUST: nightly
23+
PYTHON: "C:\\Python35"
24+
PYTHON_VERSION: "3.5.0"
25+
PYTHON_ARCH: "32"
26+
platform: Win32
27+
28+
- TOOLCHAIN_VERSION: 14.0
29+
RUST: 1.5.0
30+
PYTHON: "C:\\Python35-x64"
31+
PYTHON_VERSION: "3.5.0"
32+
PYTHON_ARCH: "64"
33+
platform: x64
34+
35+
- TOOLCHAIN_VERSION: 14.0
36+
RUST: beta
37+
PYTHON: "C:\\Python35-x64"
38+
PYTHON_VERSION: "3.5.0"
39+
PYTHON_ARCH: "64"
40+
platform: x64
41+
42+
- TOOLCHAIN_VERSION: 14.0
43+
RUST: nightly
44+
PYTHON: "C:\\Python35-x64"
45+
PYTHON_VERSION: "3.5.0"
46+
PYTHON_ARCH: "64"
47+
platform: x64
48+
49+
matrix:
50+
allow_failures:
51+
- RUST: nightly
52+
53+
install:
54+
# Install Python (from the official .msi of http://python.org) and pip when
55+
# not already installed.
56+
- "powershell ./appveyor/install.ps1"
57+
- "git submodule update --init --recursive"
58+
59+
build_script: appveyor/build.bat

appveyor/build.bat

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
REM Copyright 2015 Brian Smith.
2+
REM Copyright 2016 Cory Benfield.
3+
REM
4+
REM Permission to use, copy, modify, and/or distribute this software for any
5+
REM purpose with or without fee is hereby granted, provided that the above
6+
REM copyright notice and this permission notice appear in all copies.
7+
REM
8+
REM THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
9+
REM WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10+
REM MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
11+
REM ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12+
REM WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13+
REM ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14+
15+
echo on
16+
SetLocal EnableDelayedExpansion
17+
18+
REM This is the recommended way to choose the toolchain version, according to
19+
REM Appveyor's documentation.
20+
SET PATH=C:\Program Files (x86)\MSBuild\%TOOLCHAIN_VERSION%\Bin;%PATH%
21+
22+
set VCVARSALL="C:\Program Files (x86)\Microsoft Visual Studio %TOOLCHAIN_VERSION%\VC\vcvarsall.bat"
23+
24+
if [%Platform%] NEQ [x64] goto win32
25+
set TARGET_ARCH=x86_64
26+
set TARGET_PROGRAM_FILES=%ProgramFiles%
27+
call %VCVARSALL% amd64
28+
if %ERRORLEVEL% NEQ 0 exit 1
29+
goto download
30+
31+
:win32
32+
echo on
33+
if [%Platform%] NEQ [Win32] exit 1
34+
set TARGET_ARCH=i686
35+
set TARGET_PROGRAM_FILES=%ProgramFiles(x86)%
36+
call %VCVARSALL% amd64_x86
37+
if %ERRORLEVEL% NEQ 0 exit 1
38+
goto download
39+
40+
:download
41+
REM vcvarsall turns echo off
42+
echo on
43+
44+
REM Install Rust
45+
set RUST_URL=https://static.rust-lang.org/dist/rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi
46+
echo Downloading %RUST_URL%...
47+
mkdir build
48+
powershell -Command "(New-Object Net.WebClient).DownloadFile('%RUST_URL%', 'build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi')"
49+
if %ERRORLEVEL% NEQ 0 (
50+
echo ...downloading failed.
51+
exit 1
52+
)
53+
54+
start /wait msiexec /i build\rust-%RUST%-%TARGET_ARCH%-pc-windows-msvc.msi INSTALLDIR="%TARGET_PROGRAM_FILES%\Rust %RUST%" /quiet /qn /norestart
55+
if %ERRORLEVEL% NEQ 0 exit 1
56+
57+
set PATH="%PYTHON%";"%PYTHON%\Scripts";"%TARGET_PROGRAM_FILES%\Rust %RUST%\bin";%PATH%
58+
59+
link /?
60+
cl /?
61+
rustc --version
62+
cargo --version
63+
64+
python -m pip install -U setuptools pip
65+
if %ERRORLEVEL% NEQ 0 exit 1
66+
67+
python -m pip install -r test_requirements.txt
68+
if %ERRORLEVEL% NEQ 0 exit 1
69+
70+
python -m pip install .
71+
if %ERRORLEVEL% NEQ 0 exit 1
72+
73+
py.test test/
74+
if %ERRORLEVEL% NEQ 0 exit 1

0 commit comments

Comments
 (0)