Skip to content

Commit

Permalink
Preparing 8.0
Browse files Browse the repository at this point in the history
Cytonize binfield, if possible.
  • Loading branch information
penguinolog committed Sep 4, 2017
1 parent a5813ea commit d5d0d04
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -15,15 +15,16 @@ after_success:
- coveralls
notifications:
email: true
before_deploy:
- pip install -r build_requirements.txt
deploy:
- provider: pypi
distributions: sdist bdist_wheel
distributions: sdist bdist_wheel bdist_egg
server: https://testpypi.python.org/pypi
user: penguinolog
password:
secure: W3FhBk/wSbsadb1lzafwZINWWnEIV5QvlWjqXB2p1HI+TU+RBQLATYljUsIr/V5sU3sheUg+0O7uUpRyeA1QVsqp0swNZI6v5q++yqlCnYUyWgT/HfkzqdBpm2HkHqShZo7U7rlwAXJJyDzlANfDsq9elztmlLUo2k6QHHa6+09fOH+x7qFoEauysnxniW4i9F3NHlJFgVzkR4iCE7SoaJOqY24357g5vwcQbTEAPto9g6EdJlvlzggBu4eJlKgqa//x1+8sMwbuAnV0FlxCN+ty4nMns/Aocdh3FlvyEbc1ndEV7runARsaCwdRDgrDD3iv/XPFL8Q2xN1gRiB2yUWr2p2UbTV2RJYvPYwl/7tNp2hKXtRiU95TC0DL2XP69KhS+FedFBZ9WiIO6ZnkhlDd6PlO/9GRBOsK8AK1qaeMVvFYacgX77mKSIjguwtLpmwtaIJgRm/DMKK1SWi1LswSUW6oDAFKJTUedTkQ86XFpqYf0zxY6JGg8sqLDXntIpeSAjng9A8KWiGLXM1Kh7xvAm2FLvAHyox9kufYDdkFVzMYPWmz1+D4hSJReqm8YS5srawbNiAsDNAg3wgwydB8drrlGpOMu688NwBhWPgTCZHZnRtR1foGCD5rEHELIP7ja8J8Afupwtjgg+wFEaHMY8F9p9Vqy4sbiTPBr6A=
on:
python: 3.5
tags: false
# PyPI
- provider: pypi
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.rst
@@ -1,5 +1,9 @@
CHANGELOG
=========
Version 0.8.0
-------------
Cytonize binfield, if possible.

Version 0.7.6
-------------
Update setup.py from doctedsted get_simple_vars_from_src.
Expand Down
2 changes: 1 addition & 1 deletion binfield/__init__.py
Expand Up @@ -15,5 +15,5 @@

from .binfield import BinField

__version__ = '0.7.6'
__version__ = '0.8.0'
__author__ = "Alexey Stepanov <penguinolog@gmail.com>"
2 changes: 2 additions & 0 deletions binfield/binfield.py
Expand Up @@ -11,6 +11,8 @@
# License for the specific language governing permissions and limitations
# under the License.

# cython: binding=True, embedsignature=True

"""BinField module.
Implements BinField in Python
Expand Down
2 changes: 2 additions & 0 deletions build_requirements.txt
@@ -0,0 +1,2 @@
Cython; platform_python_implementation == "CPython"
-r requirements.txt
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -42,7 +42,7 @@ python_requires = >=2.6,!=3.0.*,!=3.1.*,!=3.2.*
# This flag says that the code is written to work on both Python 2 and Python
# 3. If at all possible, it is good practice to do this. If you cannot, you
# will need to generate wheels for each Python version that you support.
universal=1
universal=0

[build_sphinx]
all_files = 1
Expand Down
19 changes: 19 additions & 0 deletions setup.py
Expand Up @@ -18,6 +18,10 @@
import os.path
import sys

try:
from Cython.Build import cythonize
except ImportError:
cythonize = None
import setuptools

PY3 = sys.version_info[:2] > (2, 7)
Expand All @@ -35,6 +39,20 @@
required = f.read().splitlines()


def _extension(modpath):
"""Make setuptools.Extension."""
return setuptools.Extension(modpath, [modpath.replace('.', '/') + '.py'])


requires_optimization = [
_extension('binfield.binfield'),
]

ext_modules = cythonize(
requires_optimization
) if cythonize is not None else ()


# noinspection PyUnresolvedReferences
def get_simple_vars_from_src(src):
"""Get simple (string/number/boolean and None) assigned values from source.
Expand Down Expand Up @@ -127,4 +145,5 @@ def get_simple_vars_from_src(src):
name='BinField',
version=variables['__version__'],
install_requires=required,
ext_modules=ext_modules,
)

0 comments on commit d5d0d04

Please sign in to comment.