diff --git a/HISTORY.rst b/HISTORY.rst index 1fb9580..46a9486 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,7 +2,7 @@ History ======= -0.8.2 (2017-06-23) +0.8.7 (2017-07-15) ------------------ * First release on PyPI. diff --git a/Makefile b/Makefile index 1cfc897..dff2685 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: clean clean-test clean-pyc clean-build clean-venv docs help install dist release test test-all +.PHONY: clean clean-test clean-pyc clean-build clean-venv docs help install dist test test-all .DEFAULT_GOAL := help define BROWSER_PYSCRIPT import os, webbrowser, sys @@ -58,6 +58,7 @@ lint: venv ## check style with flake8 venv/bin/python -m flake8 rust_pypi_example tests test: venv ## This will use py.test because of pytest-runner + venv/bin/python setup.py build_ext venv/bin/python setup.py check venv/bin/python setup.py test @@ -87,16 +88,14 @@ docs: venv ## generate Sphinx HTML documentation, including API docs servedocs: venv docs ## compile the docs watching for changes venv/bin/python -m watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . -release: venv clean ## package and upload a release - venv/bin/python setup.py sdist upload - venv/bin/python setup.py bdist_wheel upload - dist: venv clean ## builds source and wheel package venv/bin/python setup.py sdist + venv/bin/python setup.py build_ext venv/bin/python setup.py bdist_wheel ls -l dist install: venv clean ## install the package to the active Python's site-packages + venv/bin/python setup.py build_ext venv/bin/python setup.py install diff --git a/appveyor.yml b/appveyor.yml index 14746ac..3cca5ef 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -77,15 +77,17 @@ install: - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin - rustc -Vv - cargo -V - - "%PYTHON_DIR%\\python.exe -m pip install pip>=9.0.1 ruamel.yaml==0.14.12" + - "%PYTHON_DIR%\\python.exe -m pip install -U pip>=9.0.1" + # without updating wheel and setuptools, ruamel.yaml will fail on python 3.4 + - "%PYTHON_DIR%\\python.exe -m pip install -U wheel setuptools" - "%PYTHON_DIR%\\python.exe -m pip install -U urllib3[secure] scikit-ci==0.14.0" - - "%PYTHON_DIR%\\python -m ci install" + - "%PYTHON_DIR%\\python.exe -m ci install" build_script: - - "%PYTHON_DIR%\\python -m ci build" + - "%PYTHON_DIR%\\python.exe -m ci build" test_script: - - "%PYTHON_DIR%\\python -m ci test" + - "%PYTHON_DIR%\\python.exe -m ci test" - ps: >- Get-ChildItem .\dist\ diff --git a/rust_pypi_example/__init__.py b/rust_pypi_example/__init__.py index ed7d6e5..28da4f0 100644 --- a/rust_pypi_example/__init__.py +++ b/rust_pypi_example/__init__.py @@ -2,4 +2,4 @@ __author__ = """Matt McKay""" __email__ = 'mckaymatt@gmail.com' -__version__ = '0.8.3' +__version__ = '0.8.7' diff --git a/rust_pypi_example/rust/Cargo.lock b/rust_pypi_example/rust/Cargo.lock index fd49d2c..762504a 100644 --- a/rust_pypi_example/rust/Cargo.lock +++ b/rust_pypi_example/rust/Cargo.lock @@ -1,4 +1,4 @@ [root] name = "rust_pypi_example" -version = "0.8.3" +version = "0.8.7" diff --git a/rust_pypi_example/rust/Cargo.toml b/rust_pypi_example/rust/Cargo.toml index 286cf65..dd66366 100644 --- a/rust_pypi_example/rust/Cargo.toml +++ b/rust_pypi_example/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust_pypi_example" -version = "0.8.3" +version = "0.8.7" authors = ["Matt McKay "] [lib] diff --git a/rust_pypi_example/rust_pypi_example.py b/rust_pypi_example/rust_pypi_example.py index 6d4088b..4285796 100644 --- a/rust_pypi_example/rust_pypi_example.py +++ b/rust_pypi_example/rust_pypi_example.py @@ -1,49 +1,3 @@ -# -*- coding: utf-8 -*- -import os.path -import sys -from cffi import FFI - -# See https://github.com/SimonSapin/hello-pyrust - -ffi = FFI() -ffi.cdef(open(os.path.join( - # FIXME: path is hard-coded - os.path.dirname(__file__), 'rust', 'src', - 'rust_pypi_example.h', -)).read()) - -if sys.platform == 'win32': - DYNAMIC_LIB_FORMAT = '%s.dll' -elif sys.platform == 'darwin': - DYNAMIC_LIB_FORMAT = 'lib%s.dylib' -elif "linux" in sys.platform: - DYNAMIC_LIB_FORMAT = 'lib%s.so' -else: - raise NotImplementedError('No implementation for "{}".' - ' Supported platforms are ' - '"win32", "darwin", and "linux"' - ''.format(sys.platform)) - -DLPATH = os.path.join( - # If the crate is built without the "--release" flag - # the path will be 'rust/target/debug' and this will - # cause OSError - os.path.dirname(__file__), 'rust', 'target', 'release', - DYNAMIC_LIB_FORMAT % 'rust_pypi_example' - ) - -rust_lib = ffi.dlopen(DLPATH) - - -def main(): - assert rust_lib.is_prime(13) == 1 - assert rust_lib.is_prime(12) == 0 - - -if __name__ == '__main__': - main() - - # -*- coding: utf-8 -*- import os.path import os diff --git a/setup.cfg b/setup.cfg index d383be0..0e721b7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.8.3 +current_version = 0.8.7 tag = True commit = True diff --git a/setup.py b/setup.py index c8f116a..717a757 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ setup( name='rust_pypi_example', - version='0.8.3', + version='0.8.7', description="Python Boilerplate contains all the boilerplate you need to create a Python wheel with Rust.", long_description=readme + '\n\n' + history, author="Matt McKay",