diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7754cb4..4601225 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,10 @@ CHANGELOG ========= +Version 0.9.0 +------------- +* Python 3.3 support is ended. EOL is coming, test was run rarely. +* Move data from setup.cfg to __init__.py and setup.py + Version 0.8.2 ------------- Fix no __init__ in wheel. diff --git a/binfield/__init__.py b/binfield/__init__.py index 741fffa..ef1e6c5 100644 --- a/binfield/__init__.py +++ b/binfield/__init__.py @@ -15,5 +15,11 @@ from .binfield import BinField -__version__ = '0.8.3' -__author__ = "Alexey Stepanov " +__version__ = '0.9.0' +__author__ = "Alexey Stepanov" +__author_email__ = 'penguinolog@gmail.com' +__url__ = 'https://github.com/penguinolog/binfield' +__description__ = ( + "Python BinField implementation for binary data manipulation" +) +__license__ = "Apache License, Version 2.0" diff --git a/binfield/binfield.py b/binfield/binfield.py index 23dc974..5968de0 100644 --- a/binfield/binfield.py +++ b/binfield/binfield.py @@ -334,7 +334,7 @@ def __new__(mcs, name, bases, classdict): ): # Top level baseclass: cleanup for key in ('_value_', '_size_', '_mask_', '_mapping_'): - classdict.pop(key, None) + classdict.pop(key, None) # pragma: no cover return super( BinFieldMeta, mcs diff --git a/setup.cfg b/setup.cfg index ece6366..3fd4d02 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,42 +1,9 @@ -[metadata] -url = https://github.com/penguinolog/binfield -author = Alexey Stepanov -author_email = penguinolog@gmail.com -classifiers = - Development Status :: 4 - Beta - - Intended Audience :: Developers - Topic :: Software Development :: Libraries :: Python Modules - - License :: OSI Approved :: Apache Software License - - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.3 - Programming Language :: Python :: 3.4 - Programming Language :: Python :: 3.5 - Programming Language :: Python :: 3.6 - - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - Programming Language :: Python :: Implementation :: Jython - -keywords = - binary - binfield - development - -description = Python BinField implementation for binary data manipulation -long_description = file: README.rst -license = Apache License, Version 2.0 - [options] zip_safe = False packages = find: setup_requires = setuptools > 20.2 -python_requires = >=2.6,!=3.0.*,!=3.1.*,!=3.2.* +python_requires = >=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.* [easy_install] zip_ok = false diff --git a/setup.py b/setup.py index 17825c9..7cd8ba2 100644 --- a/setup.py +++ b/setup.py @@ -43,6 +43,9 @@ with open('requirements.txt') as f: required = f.read().splitlines() +with open('README.rst',) as f: + long_description = f.read() + def _extension(modpath): """Make setuptools.Extension.""" @@ -196,9 +199,42 @@ def get_simple_vars_from_src(src): variables = get_simple_vars_from_src(source) +classifiers = [ + 'Development Status :: 4 - Beta', + + 'Intended Audience :: Developers', + 'Topic :: Software Development :: Libraries :: Python Modules', + + 'License :: OSI Approved :: Apache Software License', + + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', +] + +keywords = [ + 'binary', + 'binfield', + 'development', +] + setup_args = dict( name='BinField', + author=variables['__author__'], + author_email=variables['__author_email__'], + url=variables['__url__'], version=variables['__version__'], + license=variables['__license__'], + description=variables['__description__'], + long_description=long_description, + classifiers=classifiers, + keywords=keywords, install_requires=required, ) if cythonize is not None: diff --git a/tools/build-wheels.sh b/tools/build-wheels.sh new file mode 100755 index 0000000..8e771ce --- /dev/null +++ b/tools/build-wheels.sh @@ -0,0 +1,48 @@ +#!/bin/bash +PYTHON_VERSIONS="cp27-cp27mu cp27-cp27m cp34-cp34m cp35-cp35m cp36-cp36m" + +# Avoid creation of __pycache__/*.py[c|o] +export PYTHONDONTWRITEBYTECODE=1 + +package_name="$1" +if [ -z "$package_name" ] +then + &>2 echo "Please pass package name as a first argument of this script ($0)" + exit 1 +fi + +arch=`uname -m` + +echo +echo +echo "Compile wheels" +for PYTHON in ${PYTHON_VERSIONS}; do + /opt/python/${PYTHON}/bin/pip install -r /io/build_requirements.txt + /opt/python/${PYTHON}/bin/pip wheel /io/ -w /io/dist/ +done + +echo +echo +echo "Bundle external shared libraries into the wheels" +for whl in /io/dist/${package_name}*${arch}.whl; do + echo "Repairing $whl..." + auditwheel repair "$whl" -w /io/dist/ +done + +echo "Cleanup OS specific wheels" +rm -fv /io/dist/*-linux_*.whl + +echo +echo +echo "Install packages and test" +echo "dist directory:" +ls /io/dist + +for PYTHON in ${PYTHON_VERSIONS}; do + echo + echo -n "Test $PYTHON: " + /opt/python/${PYTHON}/bin/python -c "import platform;print(platform.platform())" + /opt/python/${PYTHON}/bin/pip install "$package_name" --no-index -f file:///io/dist + /opt/python/${PYTHON}/bin/pip install pytest + /opt/python/${PYTHON}/bin/py.test -vv /io/test +done diff --git a/tools/run_docker.sh b/tools/run_docker.sh new file mode 100755 index 0000000..1ea8c3a --- /dev/null +++ b/tools/run_docker.sh @@ -0,0 +1,32 @@ +#!/bin/bash +package_name="$1" +if [ -z "$package_name" ] +then + &>2 echo "Please pass package name as a first argument of this script ($0)" + exit 1 +fi + +manylinux1_image_prefix="quay.io/pypa/manylinux1_" +dock_ext_args="" +declare -A docker_pull_pids=() # This syntax requires at least bash v4 + +for arch in x86_64 i686 +do + docker pull "${manylinux1_image_prefix}${arch}" & + docker_pull_pids[$arch]=$! +done + +for arch in x86_64 i686 +do + echo + echo + arch_pull_pid=${docker_pull_pids[$arch]} + echo waiting for docker pull pid $arch_pull_pid to complete downloading container for $arch arch... + wait $arch_pull_pid # await for docker image for current arch to be pulled from hub + [ $arch == "i686" ] && dock_ext_args="linux32" + + echo Building wheel for $arch arch + docker run --rm -v `pwd`:/io "${manylinux1_image_prefix}${arch}" $dock_ext_args /io/tools/build-wheels.sh "$package_name" + + dock_ext_args="" # Reset docker args, just in case +done