Skip to content

Commit dfafb88

Browse files
vagrantvagrant
vagrant
authored and
vagrant
committed
add appveyor and fix osx
1 parent 9efb570 commit dfafb88

File tree

10 files changed

+103
-16
lines changed

10 files changed

+103
-16
lines changed

HISTORY.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
History
33
=======
44

5-
0.1.0 (2017-05-17)
5+
0.5.0 (2017-05-19)
66
------------------
77

88
* First release on PyPI.

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ trust_pypi_example
1818
:alt: Updates
1919

2020

21-
Python Boilerplate contains all the boilerplate you need to create a Python wheel with Rust.
21+
Example of https://github.com/mckaymatt/cookiecutter-pypackage-rust-cross-platform-publish All the boilerplate for a Python Wheel package with a Rust binary module.
2222

2323

2424
* Free software: Apache Software License 2.0

appveyor.yml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Based on the "trust" template v0.1.1
2+
# https://github.com/japaric/trust/tree/v0.1.1
3+
4+
environment:
5+
global:
6+
# TODO This is the Rust channel that build jobs will use by default but can be
7+
# overridden on a case by case basis down below
8+
RUST_VERSION: stable
9+
10+
# TODO Update this to match the name of your project.
11+
CRATE_NAME: trust
12+
13+
# TODO These are all the build jobs. Adjust as necessary. Comment out what you
14+
# don't need
15+
matrix:
16+
# MinGW
17+
- TARGET: i686-pc-windows-gnu
18+
- TARGET: x86_64-pc-windows-gnu
19+
20+
# MSVC
21+
- TARGET: i686-pc-windows-msvc
22+
- TARGET: x86_64-pc-windows-msvc
23+
24+
# Testing other channels
25+
- TARGET: x86_64-pc-windows-gnu
26+
RUST_VERSION: nightly
27+
- TARGET: x86_64-pc-windows-msvc
28+
RUST_VERSION: nightly
29+
30+
install:
31+
- ps: >-
32+
If ($Env:TARGET -eq 'x86_64-pc-windows-gnu') {
33+
$Env:PATH += ';C:\msys64\mingw64\bin'
34+
} ElseIf ($Env:TARGET -eq 'i686-pc-windows-gnu') {
35+
$Env:PATH += ';C:\msys64\mingw32\bin'
36+
}
37+
- curl -sSf -o rustup-init.exe https://win.rustup.rs/
38+
- rustup-init.exe -y --default-host %TARGET% --default-toolchain %RUST_VERSION%
39+
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
40+
- rustc -Vv
41+
- cargo -V
42+
43+
# TODO This is the "test phase", tweak it as you see fit
44+
test_script:
45+
# we don't run the "test phase" when doing deploys
46+
- if [%APPVEYOR_REPO_TAG%]==[false] (
47+
cargo build --target %TARGET% &&
48+
cargo build --target %TARGET% --release &&
49+
cargo test --target %TARGET% &&
50+
cargo test --target %TARGET% --release &&
51+
cargo run --target %TARGET% &&
52+
cargo run --target %TARGET% --release
53+
)
54+
55+
before_deploy:
56+
# TODO Update this to build the artifacts that matter to you
57+
- cargo rustc --target %TARGET% --release --bin hello -- -C lto
58+
- ps: ci\before_deploy.ps1
59+
60+
deploy:
61+
artifact: /.*\.zip/
62+
# TODO update `auth_token.secure`
63+
# - Create a `public_repo` GitHub token. Go to: https://github.com/settings/tokens/new
64+
# - Encrypt it. Go to https://ci.appveyor.com/tools/encrypt
65+
# - Paste the output down here
66+
auth_token:
67+
secure: t3puM/2hOig26EHhAodcZBc61NywF7/PFEpimR6SwGaCiqS07KR5i7iAhSABmBp7
68+
description: ''
69+
on:
70+
# TODO Here you can pick which targets will generate binary releases
71+
# In this example, there are some targets that are tested using the stable
72+
# and nightly channels. This condition makes sure there is only one release
73+
# for such targets and that's generated using the stable channel
74+
RUST_VERSION: stable
75+
appveyor_repo_tag: true
76+
provider: GitHub
77+
78+
cache:
79+
- C:\Users\appveyor\.cargo\registry
80+
- target
81+
82+
branches:
83+
only:
84+
# Release tags
85+
- /^v\d+\.\d+\.\d+.*$/
86+
- master
87+
88+
notifications:
89+
- provider: Email
90+
on_build_success: false
91+
92+
# Building is done in the test phase, so we disable Appveyor's build phase.
93+
build: false
94+

ci/script.sh

+1-7
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,7 @@ pyenv_build_test_bundle() {
5050
fi
5151
cp dist/*.whl wheelhouse
5252
python setup.py develop
53-
make clean-pyc
54-
set +e # Bad. i'm getting segfaults on OSX when I test for some reason.
55-
py.test -vvv tests
56-
make clean-pyc
57-
python setup.py test || true
58-
set -e
59-
make clean-pyc
53+
python setup.py test
6054
python setup.py check
6155

6256
set +x

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.1.0
2+
current_version = 0.5.0
33
commit = True
44
tag = True
55

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030

3131
setup(
3232
name='trust_pypi_example',
33-
version='0.1.0',
34-
description="Python Boilerplate contains all the boilerplate you need to create a Python wheel with Rust.",
33+
version='0.5.0',
34+
description="Example of https://github.com/mckaymatt/cookiecutter-pypackage-rust-cross-platform-publish All the boilerplate for a Python Wheel package with a Rust binary module.",
3535
long_description=readme + '\n\n' + history,
3636
author="Matt McKay",
3737
author_email='[email protected]',

trust_pypi_example/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__author__ = """Matt McKay"""
44
__email__ = '[email protected]'
5-
__version__ = '0.1.0'
5+
__version__ = '0.5.0'

trust_pypi_example/rust/Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

trust_pypi_example/rust/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "trust_pypi_example"
3-
version = "0.1.0"
3+
version = "0.5.0"
44
authors = ["Matt McKay <[email protected]>"]
55

66
[lib]

trust_pypi_example/rust/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ pub extern "C" fn is_prime(n: *const c_int) -> c_int {
88
}
99
for i in 2 .. n {
1010
if n % i == 0 {
11-
println!("{} % {} is 0", n, i);
1211
return 0
1312
}
1413
}

0 commit comments

Comments
 (0)