Skip to content

Commit c56e6a4

Browse files
committed
Version 0.8.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
1 parent ee9d52c commit c56e6a4

11 files changed

+142
-46
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -626,4 +626,7 @@ crashlytics-build.properties
626626
fabric.properties
627627

628628
### Test results
629-
/*_result.xml
629+
/*_result_*.xml
630+
631+
### Generated code
632+
/threaded/*.c

CHANGELOG.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
CHANGELOG
22
=========
3+
Version 0.8.0
4+
-------------
5+
* Python 3.3 support is ended. EOL is coming, test was run rarely.
6+
* Move data from setup.cfg to __init__.py and setup.py
7+
38
Version 0.7.0
49
-------------
510
Cythonize python 3, if possible (and gevent present).

CI_REQUIREMENTS.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
six
22
typing >= 3.6
33
futures>=3.1; python_version == "2.7"
4-
asyncio>=3.4; python_version == "3.3"
54
gevent >= 1.2

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include *.rst LICENSE requirements.txt

setup.cfg

+1-33
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,13 @@
11
[metadata]
22
name = threaded
3-
url = https://github.com/penguinolog/threaded
4-
author = Alexey Stepanov
5-
author_email = [email protected]
6-
classifiers =
7-
Development Status :: 4 - Beta
8-
9-
Intended Audience :: Developers
10-
Topic :: Software Development :: Libraries :: Python Modules
11-
12-
License :: OSI Approved :: Apache Software License
13-
14-
Programming Language :: Python :: 2
15-
Programming Language :: Python :: 2.7
16-
Programming Language :: Python :: 3
17-
Programming Language :: Python :: 3.3
18-
Programming Language :: Python :: 3.4
19-
Programming Language :: Python :: 3.5
20-
Programming Language :: Python :: 3.6
21-
22-
Programming Language :: Python :: Implementation :: CPython
23-
Programming Language :: Python :: Implementation :: PyPy
24-
25-
keywords =
26-
pooling
27-
multithreading
28-
threading
29-
asyncio
30-
development
31-
32-
description = Decorator for logging function arguments and return value by human-readable way
33-
long_description = file: README.rst
34-
license = Apache License, Version 2.0
353

364
[options]
375
zip_safe = False
386
packages = find:
397
setup_requires =
408
setuptools > 20.2
419

42-
python_requires = >=2.6,!=3.0.*,!=3.1.*,!=3.2.*
10+
python_requires = >=2.6,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
4311

4412
[bdist_wheel]
4513
# This flag says that the code is written to work on both Python 2 and Python

setup.py

+40-7
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import setuptools
3434

3535
PY3 = sys.version_info[:2] > (2, 7)
36-
PY34 = sys.version_info[:2] > (3, 3)
3736

3837
with open(
3938
os.path.join(
@@ -46,6 +45,9 @@
4645
with open('requirements.txt') as f:
4746
required = f.read().splitlines()
4847

48+
with open('README.rst',) as f:
49+
long_description = f.read()
50+
4951

5052
def _extension(modpath):
5153
"""Make setuptools.Extension."""
@@ -168,9 +170,7 @@ def get_simple_vars_from_src(src):
168170
ast.List, ast.Set, ast.Dict, ast.Tuple
169171
)
170172
if PY3:
171-
ast_data += (ast.Bytes,)
172-
if PY34:
173-
ast_data += (ast.NameConstant,)
173+
ast_data += (ast.Bytes, ast.NameConstant,)
174174

175175
tree = ast.parse(src)
176176

@@ -204,16 +204,49 @@ def get_simple_vars_from_src(src):
204204

205205
variables = get_simple_vars_from_src(source)
206206

207+
classifiers = [
208+
'Development Status :: 4 - Beta',
209+
210+
'Intended Audience :: Developers',
211+
'Topic :: Software Development :: Libraries :: Python Modules',
212+
213+
'License :: OSI Approved :: Apache Software License',
214+
215+
'Programming Language :: Python :: 2',
216+
'Programming Language :: Python :: 2.7',
217+
'Programming Language :: Python :: 3',
218+
'Programming Language :: Python :: 3.4',
219+
'Programming Language :: Python :: 3.5',
220+
'Programming Language :: Python :: 3.6',
221+
222+
'Programming Language :: Python :: Implementation :: CPython',
223+
'Programming Language :: Python :: Implementation :: PyPy',
224+
]
225+
226+
keywords = [
227+
'pooling',
228+
'multithreading',
229+
'threading',
230+
'asyncio',
231+
'gevent',
232+
'development',
233+
]
234+
207235
setup_args = dict(
208236
name='threaded',
237+
author=variables['__author__'],
238+
author_email=variables['__author_email__'],
239+
url=variables['__url__'],
209240
version=variables['__version__'],
241+
license=variables['__license__'],
242+
description=variables['__description__'],
243+
long_description=long_description,
244+
classifiers=classifiers,
245+
keywords=keywords,
210246
extras_require={
211247
':python_version == "2.7"': [
212248
'futures>=3.1',
213249
],
214-
':python_version == "3.3"': [
215-
'asyncio>=3.4',
216-
],
217250
'gevent': [
218251
'gevent >= 1.2'
219252
],

threaded/__init__.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,11 @@
6565
'gthreadpooled'
6666
)
6767

68-
__version__ = '0.7.0'
69-
__author__ = "Alexey Stepanov <[email protected]>"
68+
__version__ = '0.8.0'
69+
__author__ = "Alexey Stepanov"
70+
__author_email__ = '[email protected]'
71+
__url__ = 'https://github.com/penguinolog/threaded'
72+
__description__ = (
73+
"Decorators for running functions in Thread/ThreadPool/IOLoop"
74+
)
75+
__license__ = "Apache License, Version 2.0"

threaded/_class_decorator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import sys
2323
import typing
2424

25-
PY34 = sys.version_info[:2] > (3, 3)
25+
PY3 = sys.version_info[:2] > (3, 3)
2626

2727

2828
class BaseDecorator(typing.Callable):
@@ -76,7 +76,7 @@ def __init__(self, func=None):
7676
self.__func = func
7777
if self.__func is not None:
7878
functools.update_wrapper(self, self.__func)
79-
if not PY34: # pragma: no cover
79+
if not PY3: # pragma: no cover
8080
self.__wrapped__ = self.__func
8181
# pylint: enable=assigning-non-slot
8282
# noinspection PyArgumentList

tools/build-wheels.sh

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
PYTHON_VERSIONS="cp34-cp34m cp35-cp35m cp36-cp36m"
3+
4+
# Avoid creation of __pycache__/*.py[c|o]
5+
export PYTHONDONTWRITEBYTECODE=1
6+
7+
package_name="$1"
8+
if [ -z "$package_name" ]
9+
then
10+
&>2 echo "Please pass package name as a first argument of this script ($0)"
11+
exit 1
12+
fi
13+
14+
arch=`uname -m`
15+
16+
echo
17+
echo
18+
echo "Compile wheels"
19+
for PYTHON in ${PYTHON_VERSIONS}; do
20+
/opt/python/${PYTHON}/bin/pip install -r /io/build_requirements.txt
21+
/opt/python/${PYTHON}/bin/pip wheel /io/ -w /io/dist/
22+
done
23+
24+
echo
25+
echo
26+
echo "Bundle external shared libraries into the wheels"
27+
for whl in /io/dist/${package_name}*${arch}.whl; do
28+
echo "Repairing $whl..."
29+
auditwheel repair "$whl" -w /io/dist/
30+
done
31+
32+
echo "Cleanup OS specific wheels"
33+
rm -fv /io/dist/*-linux_*.whl
34+
35+
echo
36+
echo
37+
echo "Install packages and test"
38+
echo "dist directory:"
39+
ls /io/dist
40+
41+
for PYTHON in ${PYTHON_VERSIONS}; do
42+
echo
43+
echo -n "Test $PYTHON: "
44+
/opt/python/${PYTHON}/bin/python -c "import platform;print(platform.platform())"
45+
/opt/python/${PYTHON}/bin/pip install "$package_name" --no-index -f file:///io/dist
46+
/opt/python/${PYTHON}/bin/pip install pytest
47+
/opt/python/${PYTHON}/bin/py.test -vv /io/test
48+
done

tools/run_docker.sh

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
package_name="$1"
3+
if [ -z "$package_name" ]
4+
then
5+
&>2 echo "Please pass package name as a first argument of this script ($0)"
6+
exit 1
7+
fi
8+
9+
manylinux1_image_prefix="quay.io/pypa/manylinux1_"
10+
dock_ext_args=""
11+
declare -A docker_pull_pids=() # This syntax requires at least bash v4
12+
13+
for arch in x86_64 i686
14+
do
15+
docker pull "${manylinux1_image_prefix}${arch}" &
16+
docker_pull_pids[$arch]=$!
17+
done
18+
19+
for arch in x86_64 i686
20+
do
21+
echo
22+
echo
23+
arch_pull_pid=${docker_pull_pids[$arch]}
24+
echo waiting for docker pull pid $arch_pull_pid to complete downloading container for $arch arch...
25+
wait $arch_pull_pid # await for docker image for current arch to be pulled from hub
26+
[ $arch == "i686" ] && dock_ext_args="linux32"
27+
28+
echo Building wheel for $arch arch
29+
docker run --rm -v `pwd`:/io "${manylinux1_image_prefix}${arch}" $dock_ext_args /io/tools/build-wheels.sh "$package_name"
30+
31+
dock_ext_args="" # Reset docker args, just in case
32+
done

tox.ini

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ skip_missing_interpreters = True
1414
recreate=True
1515
usedevelop = True
1616
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
17+
setev = PYTHONDONTWRITEBYTECODE=1
1718
deps =
1819
sphinx
1920
pytest

0 commit comments

Comments
 (0)