Skip to content

Commit

Permalink
Version 0.9.0
Browse files Browse the repository at this point in the history
* Python 3.3 support is ended. EOL is coming, test was run rarely.
* Move data from setup.cfg to __init__.py and setup.py
  • Loading branch information
penguinolog committed Sep 6, 2017
1 parent 18905a2 commit 6bba7e9
Show file tree
Hide file tree
Showing 7 changed files with 131 additions and 37 deletions.
5 changes: 5 additions & 0 deletions 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.
Expand Down
10 changes: 8 additions & 2 deletions binfield/__init__.py
Expand Up @@ -15,5 +15,11 @@

from .binfield import BinField

__version__ = '0.8.3'
__author__ = "Alexey Stepanov <penguinolog@gmail.com>"
__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"
2 changes: 1 addition & 1 deletion binfield/binfield.py
Expand Up @@ -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
Expand Down
35 changes: 1 addition & 34 deletions 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
Expand Down
36 changes: 36 additions & 0 deletions setup.py
Expand Up @@ -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."""
Expand Down Expand Up @@ -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:
Expand Down
48 changes: 48 additions & 0 deletions 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
32 changes: 32 additions & 0 deletions 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

0 comments on commit 6bba7e9

Please sign in to comment.