Skip to content
Merged
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
63 changes: 58 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
env:
global:
- CIBW_BUILD='cp37-* cp36-* cp27-*'
- CIBW_TEST_REQUIRES='pytest'
- CIBW_BEFORE_BUILD='pip install "numpy>=1.16" && pip install "pandas>=0.24" && pip install "pytest>=4.3" && pip install "pybind11>=2.4"'
- CIBW_TEST_COMMAND='python -m pytest {project}/tests'
Expand Down Expand Up @@ -417,15 +416,14 @@ matrix:
- (cd jdbccts && make DUCKDB_JAR=../build/release/tools/jdbc/duckdb_jdbc.jar test)




- os: linux
name: Python Package
name: Python 3.7 Package

dist: bionic
language: python
cache: pip
env:
- CIBW_BUILD='cp37-* cp36-* cp27-*'
- CIBW_BUILD='cp37-*'
python: 3.7

install:
Expand All @@ -445,13 +443,67 @@ matrix:
fi


- os: linux
name: Python 3.6 Package
if: (type = push AND branch = master) OR type = pull_request OR tag =~ /^v\d+\.\d+\.\d+$/

dist: bionic
language: python
cache: pip
env:
- CIBW_BUILD='cp36-*'
python: 3.7

install:
- pip install cibuildwheel==0.10.2 twine

script:
- cd tools/pythonpkg
- python setup.py sdist
- mkdir duckdb_tarball && tar xvf dist/duckdb-*.tar.gz --strip-components=1 -C duckdb_tarball
- cibuildwheel --output-dir wheelhouse duckdb_tarball
- cd ../..
- |
if [[ $TRAVIS_TAG ]] || ([ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ]) ; then
python -m twine upload --non-interactive --disable-progress-bar --skip-existing tools/pythonpkg/wheelhouse/*.whl
fi


- os: linux
name: Python 2.7 Package
if: (type = push AND branch = master) OR type = pull_request OR tag =~ /^v\d+\.\d+\.\d+$/

dist: bionic
language: python
cache: pip
env:
- CIBW_BUILD='cp27-*'
python: 3.7

install:
- pip install cibuildwheel==0.10.2 twine

script:
- cd tools/pythonpkg
- python setup.py sdist
- mkdir duckdb_tarball && tar xvf dist/duckdb-*.tar.gz --strip-components=1 -C duckdb_tarball
- cibuildwheel --output-dir wheelhouse duckdb_tarball
- cd ../..
- |
if [[ $TRAVIS_TAG ]] || ([ $TRAVIS_BRANCH = master ] && [ $TRAVIS_PULL_REQUEST = false ]) ; then
python -m twine upload --non-interactive --disable-progress-bar --skip-existing tools/pythonpkg/wheelhouse/*.whl
fi

- os: osx
name: Python Package
if: (type = push AND branch = master) OR type = pull_request OR tag =~ /^v\d+\.\d+\.\d+$/

language: generic
osx_image: xcode11.5

env:
- CIBW_BUILD='cp37-* cp27-*'

install:
- curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
- python3 /tmp/get-pip.py
Expand Down Expand Up @@ -505,6 +557,7 @@ matrix:

- os: linux
name: R Package
if: (type = push AND branch = master) OR type = pull_request OR tag =~ /^v\d+\.\d+\.\d+$/

dist: bionic
language: r
Expand Down
8 changes: 3 additions & 5 deletions tools/pythonpkg/duckdb_python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,10 +421,8 @@ struct DuckDBPyResult {
}

// convert the nullmask
py::array_t<bool> nullmask;
nullmask.resize({mres->collection.count});
bool *nullmask_ptr = nullmask.mutable_data();

auto nullmask = py::array(py::dtype("bool"), mres->collection.count);
auto nullmask_ptr = (bool*) nullmask.mutable_data();
idx_t out_offset = 0;
for (auto &data_chunk : mres->collection.chunks) {
auto &src_nm = FlatVector::Nullmask(data_chunk->data[col_idx]);
Expand Down Expand Up @@ -505,7 +503,7 @@ struct DuckDBPyConnection {
params_set = params;
}

for (auto &single_query_params : params_set) {
for (const auto &single_query_params : params_set) {
if (prep->n_param != py::len(single_query_params)) {
throw runtime_error("Prepared statments needs " + to_string(prep->n_param) + " parameters, " +
to_string(py::len(single_query_params)) + " given");
Expand Down
7 changes: 3 additions & 4 deletions tools/pythonpkg/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ def __str__(self):
description = 'DuckDB embedded database',
keywords = 'DuckDB Database SQL OLAP',
url="https://www.duckdb.org",
long_description = '',
install_requires=[ # these versions are still available for Python 2, newer ones aren't
'numpy>=1.14',
'pandas>=0.23',
long_description = 'See here for an introduction: https://duckdb.org/docs/api/python',
install_requires=[ # these version is still available for Python 2, newer ones aren't
'numpy>=1.14'
],
packages=['duckdb_query_graph'],
include_package_data=True,
Expand Down