-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding backwards-compatible Python 3 support, tested up to 3.8.2. Verified to still work with Python 2.7. Also adds a makefile and scripts to build binary manylinux wheels for several python versions.
- Loading branch information
1 parent
2e2e64a
commit 810f4b3
Showing
6 changed files
with
97 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ lib64/ | |
parts/ | ||
sdist/ | ||
var/ | ||
wheelhouse/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.PHONEY: help | ||
help: | ||
@echo "Targets:" | ||
@echo " clean: Removes distribution folders and artifacts from building" | ||
@echo " manylinux-wheels: Builds binary and manylinux wheels for several python versions" | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -rf dist wheelhouse build __pycache__ *.so *.egg-info | ||
|
||
.PHONY: manylinux-wheels | ||
manylinux-wheels: | ||
docker run -v $(shell pwd):/io quay.io/pypa/manylinux1_x86_64:latest \ | ||
/io/bin/build-manylinux-wheel.sh 27 35 36 37 38 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
PYTHON_VERSIONS=$@ | ||
|
||
if [[ -z "${PYTHON_VERSIONS}" ]] ; then | ||
echo "Usage: $(basename $0) <version>..." >&2 | ||
echo " A version is the two numbers in the major.minor python that you want to build" >&2 | ||
echo " Example: for python 2.7 and 3.8 both" >&2 | ||
echo "" >&2 | ||
echo " $ $(basename $0) 27 38" >&2 | ||
exit 1 | ||
fi | ||
|
||
function get-variants() { | ||
local version="$1" | ||
|
||
if [[ "${version}" = '38' ]] ; then | ||
echo / | ||
elif [[ "${version}" = '27' ]] ; then | ||
echo m mu | ||
else | ||
echo m | ||
fi | ||
} | ||
|
||
cd /io | ||
|
||
for version in ${PYTHON_VERSIONS} ; do | ||
for variant in $(get-variants "${version}") ; do | ||
/opt/python/cp${version}-cp${version}${variant}/bin/python setup.py bdist_wheel | ||
done | ||
done | ||
|
||
for f in dist/*.whl ; do | ||
/opt/python/cp37-cp37m/bin/auditwheel repair "${f}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
#!/usr/bin/env python | ||
|
||
from distutils.core import setup, Extension | ||
from setuptools import setup, Extension | ||
setup( | ||
name='pypredict', | ||
version='1.5.0', | ||
version='1.6.0', | ||
author="Jesse Trutna", | ||
author_email="[email protected]", | ||
url="https://github.com/nsat/pypredict", | ||
py_modules=['predict'], | ||
ext_modules=[Extension('cpredict', ['predict.c'])], | ||
classifiers=[ | ||
'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
], | ||
py_modules=['predict'], | ||
ext_modules=[Extension('cpredict', ['predict.c'])] | ||
) |