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

add connectorx #18987

Closed
wants to merge 12 commits into from
12 changes: 9 additions & 3 deletions .ci_support/build_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def build_all(recipes_dir, arch):

deployment_version = (0, 0)
sdk_version = (0, 0)
channel_urls = ['local']
for folder in folders:
cbc = os.path.join(recipes_dir, folder, "conda_build_config.yaml")
if os.path.exists(cbc):
Expand All @@ -79,6 +80,10 @@ def build_all(recipes_dir, arch):
version = tuple([int(x) for x in version.split('.')])
sdk_version = max(sdk_version, deployment_version, version)

if 'channel_sources' in text:
config = load(text, Loader=BaseLoader)
channel_urls += config['channel_sources'][0].split(',')

with open(variant_config_file, 'r') as f:
variant_text = ''.join(f.readlines())

Expand All @@ -100,8 +105,9 @@ def build_all(recipes_dir, arch):
if platform == "osx" and (sdk_version != (0, 0) or deployment_version != (0, 0)):
subprocess.run("run_conda_forge_build_setup", shell=True, check=True)

print("Building {} with conda-forge/label/main".format(','.join(folders)))
channel_urls = ['local', 'conda-forge']
if 'conda-forge' not in channel_urls:
channel_urls.append('conda-forge')
print("Building {} with {}".format(','.join(folders), ','.join(channel_urls)))
build_folders(recipes_dir, folders, arch, channel_urls)


Expand Down Expand Up @@ -202,4 +208,4 @@ def use_mambabuild():
if use_mamba:
use_mambabuild()
subprocess.run("conda clean --all --yes", shell=True, check=True)
build_all(os.path.join(root_dir, "recipes"), args.arch)
build_all(os.path.join(root_dir, "recipes"), args.arch)
2 changes: 1 addition & 1 deletion .ci_support/linux64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fortran_compiler:
target_platform:
- linux-64
channel_sources:
- conda-forge
- conda-forge/label/rust_dev,conda-forge
docker_image:
- quay.io/condaforge/linux-anvil-comp7
cuda_compiler_version:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ cxx_compiler:
fortran_compiler:
- gfortran
channel_sources:
- conda-forge
- conda-forge/label/rust_dev,conda-forge
target_platform:
- osx-64
2 changes: 1 addition & 1 deletion .ci_support/win64.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
channel_sources:
- conda-forge
- conda-forge/label/rust_dev,conda-forge
target_platform:
- win-64
16 changes: 16 additions & 0 deletions recipes/connectorx/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -ex

cp $SRC_DIR/README.md $SRC_DIR/connectorx-python/README.md
cp $SRC_DIR/LICENSE $SRC_DIR/connectorx-python/LICENSE

pushd $SRC_DIR/connectorx-python
poetry install
popd

maturin build --no-sdist --release --strip --manylinux off --interpreter="${PYTHON}" -m connectorx-python/Cargo.toml

"${PYTHON}" -m pip install $SRC_DIR/connectorx-python/target/wheels/*.whl --no-deps -vv

cargo-bundle-licenses --format yaml --output THIRDPARTY.yml
2 changes: 2 additions & 0 deletions recipes/connectorx/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
channel_sources:
- conda-forge/label/rust_dev,conda-forge
58 changes: 58 additions & 0 deletions recipes/connectorx/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{% set name = "connectorx" %}
{% set version = "0.3.0" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
- url: https://github.com/sfu-db/connector-x/archive/refs/tags/v{{ version }}.tar.gz
sha256: c8d13ac38d9da5793f8ccb0c3777761bcfaa89f0f18cbf0597d0bd4f347612c9

build:
number: 0
skip: true # [py<37 or win]

requirements:
build:
- python # [build_platform != target_platform]
- cross-python_{{ target_platform }} # [build_platform != target_platform]
- crossenv # [build_platform != target_platform]
- {{ compiler('c') }}
- {{ compiler('rust') }}
- posix # [win]
- cmake
- make # [unix]
- cargo-bundle-licenses
host:
- python
- pip
- poetry
- maturin >=0.12.11,<0.13
run:
- python
- numpy >=1.21.5
- libzlib

test:
imports:
- connectorx
commands:
- pip check
requires:
- pip

about:
home: https://github.com/sfu-db/connector-x
license: MIT
license_family: MIT
license_file:
- LICENSE
- THIRDPARTY.yml
summary: "Fastest library to load data from DB to DataFrames in Rust and Python"
dev_url: https://github.com/sfu-db/connector-x

extra:
recipe-maintainers:
- timkpaine
- wangxiaoying