-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix tests * update ci to run test
- Loading branch information
Showing
24 changed files
with
261 additions
and
39 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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Description: builds Python's wheels. | ||
# The script needs yum or apt | ||
# | ||
# Envionment Arguments: (handled by `args.py`) | ||
# PYTHON_HOME: the path to the Python installation, which will be used to build the wheels for. | ||
# Empty if you want to use multiple Pythons by providing PYTHON_HOMES. This has the highest priority. If set, we won't consider PYTHON_HOMES and PYTHON_VERSIONS | ||
# PYTHON_HOMES: comma-separated directories that either contains Python installations or are Python installations. | ||
# PYTHON_VERSIONS: versions of Python separated by comma if you want to restricted to specific versions. | ||
# Arguments: | ||
# -t <target>: target platform. See https://doc.rust-lang.org/nightly/rustc/platform-support.html | ||
|
||
export PATH=$EXTRA_PATH:$PATH | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
||
while getopts t: flag | ||
do | ||
case "${flag}" in | ||
t) target=${OPTARG};; | ||
esac | ||
done | ||
|
||
if [ -z "$target" ] | ||
then | ||
echo "target is not set (-t <target>). See more: https://doc.rust-lang.org/nightly/rustc/platform-support.html" | ||
exit 1 | ||
fi | ||
|
||
echo "::group::Setup build tools" | ||
# ############################################## | ||
# to build rocksdb, we need CLang and LLVM | ||
echo "Install CLang and LLVM" | ||
if ! command -v yum &> /dev/null | ||
then | ||
# debian | ||
apt update | ||
apt install -y clang-11 | ||
else | ||
# centos | ||
# https://developers.redhat.com/blog/2018/07/07/yum-install-gcc7-clang# | ||
yum install -y llvm-toolset-7 | ||
source /opt/rh/llvm-toolset-7/enable | ||
fi | ||
|
||
# ############################################## | ||
echo "Install Rust" | ||
if ! command -v cargo &> /dev/null | ||
then | ||
# install rust and cargo | ||
curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable | ||
source $HOME/.cargo/env | ||
else | ||
echo "Rust is already installed." | ||
rustup show | ||
fi | ||
|
||
if [ ! -d $(rustc --print target-libdir --target "$target" ) ] | ||
then | ||
rustup target add $target; | ||
fi | ||
|
||
echo "::endgroup::" | ||
echo | ||
|
||
echo "::group::Discovering Python" | ||
IFS=',' read -a PYTHON_HOMES <<< $(MINIMUM_PYTHON_VERSION=3.8 python $SCRIPT_DIR/pydiscovery.py) | ||
if [ ${#PYTHON_HOMES[@]} -eq 0 ]; then | ||
echo "No Python found. Did you forget to set any environment variable PYTHON_HOME or PYTHON_HOMES?" | ||
else | ||
for PYTHON_HOME in "${PYTHON_HOMES[@]}" | ||
do | ||
echo "Found $PYTHON_HOME" | ||
done | ||
fi | ||
echo "::endgroup::" | ||
echo | ||
|
||
for PYTHON_HOME in "${PYTHON_HOMES[@]}" | ||
do | ||
echo "::group::Building for Python $PYTHON_HOME" | ||
|
||
echo "Run: $PYTHON_HOME/bin/pip install maturin" | ||
"$PYTHON_HOME/bin/pip" install maturin | ||
|
||
echo "Run: $PYTHON_HOME/bin/maturin build -r -o dist -i $PYTHON_HOME/bin/python --target $target" | ||
"$PYTHON_HOME/bin/maturin" build -r -o dist -i "$PYTHON_HOME/bin/python" --target $target | ||
|
||
echo "::endgroup::" | ||
echo | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
from __future__ import print_function | ||
import os, subprocess, re | ||
|
||
|
||
homes = [] | ||
if "PYTHON_HOME" in os.environ: | ||
homes.append(os.environ["PYTHON_HOME"]) | ||
elif "PYTHON_HOMES" in os.environ: | ||
lst = os.environ["PYTHON_HOMES"].split(",") | ||
for path in lst: | ||
if os.path.exists(os.path.join(path, "bin", "python")): | ||
# is the python directory | ||
homes.append(path) | ||
else: | ||
for subpath in os.listdir(path): | ||
if os.path.exists(os.path.join(path, subpath, "bin", "python")): | ||
homes.append(os.path.join(path, subpath)) | ||
|
||
if "PYTHON_VERSIONS" in os.environ: | ||
versions = os.environ["PYTHON_VERSIONS"].split(",") | ||
filtered_homes = [] | ||
for home in homes: | ||
output = ( | ||
subprocess.check_output([os.path.join(home, "bin", "python"), "-V"]) | ||
.decode() | ||
.strip() | ||
) | ||
for version in versions: | ||
m = re.match("Python ([\d\.)]+)", output) | ||
assert m is not None | ||
pyversion = m.group(1) | ||
if pyversion.startswith(version): | ||
filtered_homes.append(home) | ||
break | ||
|
||
homes = filtered_homes | ||
|
||
|
||
if "MINIMUM_PYTHON_VERSION" in os.environ: | ||
minimum_version = [int(d) for d in os.environ["MINIMUM_PYTHON_VERSION"].split(".")] | ||
filtered_homes = [] | ||
for home in homes: | ||
output = ( | ||
subprocess.check_output([os.path.join(home, "bin", "python"), "-V"]) | ||
.decode() | ||
.strip() | ||
) | ||
m = re.match(r"Python ([\d\.)]+)", output) | ||
assert m is not None | ||
pyversion = m.group(1).split(".") | ||
|
||
if all( | ||
int(pyversion[i]) >= minimum_version[i] for i in range(len(minimum_version)) | ||
): | ||
filtered_homes.append(home) | ||
|
||
homes = filtered_homes | ||
|
||
print(",".join(homes)) | ||
exit(0) |
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name = "drepr" | |
version = "2.10.0" | ||
description = "Data Representation Language for Reading Heterogeneous Datasets" | ||
readme = "README.md" | ||
requires-python = ">=3.7" | ||
requires-python = ">=3.8" | ||
license = {file = "LICENSE"} | ||
authors = [{name = "Binh Vu", email = "[email protected]"}] | ||
|
||
|
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,6 +1,3 @@ | ||
# from drepr.version import __version__ | ||
# from drepr.engine import execute, FileOutput, MemoryOutput, OutputFormat | ||
from drepr.engine import execute, FileOutput, MemoryOutput, OutputFormat | ||
# from drepr.graph_deprecated import Graph | ||
# from drepr.models import DRepr, DReprBuilder | ||
# from drepr import outputs | ||
# from drepr import models | ||
from drepr.models import DRepr, DReprBuilder |
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
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,5 +0,0 @@ | ||
from .array_backend.array_backend import ArrayBackend | ||
from .graph_backend.graph_backend import GraphBackend | ||
from .namespace import Namespace | ||
from .base_output_sm import FCondition | ||
from .prop_data_ndarray import PropDataNDArray | ||
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
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.