Skip to content

Commit 3177315

Browse files
committed
remove dup code
1 parent cf71cf3 commit 3177315

File tree

7 files changed

+6
-52
lines changed

7 files changed

+6
-52
lines changed

HISTORY.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
History
33
=======
44

5-
0.8.5 (2017-07-09)
5+
0.8.7 (2017-07-15)
66
------------------
77

88
* First release on PyPI.

rust_pypi_example/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

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

rust_pypi_example/rust/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust_pypi_example/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rust_pypi_example"
3-
version = "0.8.6"
3+
version = "0.8.7"
44
authors = ["Matt McKay <[email protected]>"]
55

66
[lib]

rust_pypi_example/rust_pypi_example.py

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
import os.path
3-
import sys
4-
from cffi import FFI
5-
6-
# See https://github.com/SimonSapin/hello-pyrust
7-
8-
ffi = FFI()
9-
ffi.cdef(open(os.path.join(
10-
# FIXME: path is hard-coded
11-
os.path.dirname(__file__), 'rust', 'src',
12-
'rust_pypi_example.h',
13-
)).read())
14-
15-
if sys.platform == 'win32':
16-
DYNAMIC_LIB_FORMAT = '%s.dll'
17-
elif sys.platform == 'darwin':
18-
DYNAMIC_LIB_FORMAT = 'lib%s.dylib'
19-
elif "linux" in sys.platform:
20-
DYNAMIC_LIB_FORMAT = 'lib%s.so'
21-
else:
22-
raise NotImplementedError('No implementation for "{}".'
23-
' Supported platforms are '
24-
'"win32", "darwin", and "linux"'
25-
''.format(sys.platform))
26-
27-
DLPATH = os.path.join(
28-
# If the crate is built without the "--release" flag
29-
# the path will be 'rust/target/debug' and this will
30-
# cause OSError
31-
os.path.dirname(__file__), 'rust', 'target', 'release',
32-
DYNAMIC_LIB_FORMAT % 'rust_pypi_example'
33-
)
34-
35-
rust_lib = ffi.dlopen(DLPATH)
36-
37-
38-
def main():
39-
assert rust_lib.is_prime(13) == 1
40-
assert rust_lib.is_prime(12) == 0
41-
42-
43-
if __name__ == '__main__':
44-
main()
45-
46-
471
# -*- coding: utf-8 -*-
482
import os.path
493
import os

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.8.6
2+
current_version = 0.8.7
33
tag = True
44
commit = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
setup(
3232
name='rust_pypi_example',
33-
version='0.8.6',
33+
version='0.8.7',
3434
description="Python Boilerplate contains all the boilerplate you need to create a Python wheel with Rust.",
3535
long_description=readme + '\n\n' + history,
3636
author="Matt McKay",

0 commit comments

Comments
 (0)