Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.10 support #1

Open
wants to merge 2 commits into
base: v4.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Aerospike Python Client
Dependencies
------------

The Python client for Aerospike works with Python 2.7, 3.4, 3.5, 3.6, 3.7, 3.8 running on
**64-bit** OS X 10.9+ and Linux.
The Python client for Aerospike works with Python 2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 3.10
running on **64-bit** OS X 10.9+ and Linux.

NOTE: The following dependencies only apply to installations that build from source
on linux, or OS X installations.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.0
4.0.1
11 changes: 11 additions & 0 deletions scripts/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM quay.io/pypa/manylinux_2_24_x86_64

RUN apt-get update && \
apt-get install -y libssl-dev; \
mkdir -p /code

WORKDIR /code

CMD /code/scripts/incontainer-build.sh


9 changes: 9 additions & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -e

git submodule update --init

docker build -f scripts/Dockerfile.build -t aerospike-wheel-builder:latest .

docker run -it -v $(pwd):/code aerospike-wheel-builder:latest /code/scripts/manylinuxbuild.sh
10 changes: 6 additions & 4 deletions scripts/manylinuxbuild.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#!/bin/bash

set -e

# Compile wheels
for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" wheel ./ -w /work/tempwheels
"${PYBIN}/pip" wheel ./ -w /code/work/tempwheels
done

# Bundle external shared libraries into the wheels
for whl in /work/tempwheels/*.whl; do
auditwheel repair "$whl" --plat manylinux2010_x86_64 -w /work/wheels/
for whl in /code/work/tempwheels/*.whl; do
auditwheel repair "$whl" --plat manylinux_2_24_x86_64 -w /code/work/wheels/
done

for PYBIN in /opt/python/*/bin/; do
${PYBIN}/pip install aerospike -f /work/wheels/
${PYBIN}/pip install aerospike -f /code/work/wheels/ --no-index
${PYBIN}/python -c "import aerospike; print('Installed aerospike version{}'.format(aerospike.__version__))"
done
16 changes: 16 additions & 0 deletions scripts/os_version
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,22 @@ main() {
distro_short="el${distro_version}"
;;
'ubuntu' )
case "$distro_version" in
"17"* )
distro_version="14.04"
;;
"18"* )
distro_version="16.04"
;;
"2"* )
distro_version="20.04"
;;
* )
error "Unsupported linux distibution version: $distro_id $distro_version"
error "Guessing compatibility with Ubuntu 16.04"
distro_version="16.04"
;;
esac
distro_long="${distro_id}${distro_version}"
distro_version=${distro_version%.*}
distro_short="${distro_id}${distro_version}"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
os.environ['ARCHFLAGS'] = '-arch x86_64'
AEROSPIKE_C_VERSION = os.getenv('AEROSPIKE_C_VERSION')
if not AEROSPIKE_C_VERSION:
AEROSPIKE_C_VERSION = '4.6.18'
AEROSPIKE_C_VERSION = '4.6.24'
DOWNLOAD_C_CLIENT = os.getenv('DOWNLOAD_C_CLIENT')
AEROSPIKE_C_HOME = os.getenv('AEROSPIKE_C_HOME')
PREFIX = None
Expand Down
2 changes: 1 addition & 1 deletion src/main/aerospike.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ AerospikeConstants operator_constants[] = {
MOD_INIT(aerospike)
{

const char version[8] = "4.0.0";
const char version[8] = "4.0.1";
// Makes things "thread-safe"
PyEval_InitThreads();
int i = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/main/client/truncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ AerospikeClient_Truncate(AerospikeClient * self, PyObject * args, PyObject * kwd
}

// Start conversion of the nanosecond parameter
if PyLong_Check(py_nanos) {
if (PyLong_Check(py_nanos)) {

temp_long = PyLong_AsLongLong(py_nanos);
// There was a negative number outside of the range of - 2 ^ 63
Expand All @@ -147,7 +147,7 @@ AerospikeClient_Truncate(AerospikeClient * self, PyObject * args, PyObject * kwd
goto CLEANUP;
}

} else if PyInt_Check(py_nanos) {
} else if (PyInt_Check(py_nanos)) {
long tempInt;
tempInt = PyInt_AsLong(py_nanos);

Expand Down