From 7c5076086e27711ed1b8315f559a4285b1551396 Mon Sep 17 00:00:00 2001 From: Hadi Hamoud Date: Sun, 23 Nov 2025 12:52:41 +0300 Subject: [PATCH] relaxed python dependency, added headers for C/C++ execution of onion --- .github/workflows/ci.yml | 4 +++- .github/workflows/release.yml | 13 +++++++++---- .../deduplication/onion/src/Makefile | 2 +- .../deduplication/onion/src/Makefile.g | 2 +- .../deduplication/onion/src_sc/Makefile | 2 +- .../deduplication/onion/src_sc/Makefile.g | 2 +- pyproject.toml | 7 +++++-- scripts/build_onion.sh | 6 ++++-- 8 files changed, 25 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c471bb0..1fc2afa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,8 +55,10 @@ jobs: include: - os: ubuntu-latest artifact_name: onion-linux-x86_64 - - os: macos-latest + - os: macos-13 artifact_name: onion-darwin-x86_64 + - os: macos-14 + artifact_name: onion-darwin-arm64 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index babc49c..64c0fee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,8 +17,10 @@ jobs: include: - os: ubuntu-latest artifact_name: onion-linux-x86_64 - - os: macos-latest + - os: macos-13 artifact_name: onion-darwin-x86_64 + - os: macos-14 + artifact_name: onion-darwin-arm64 steps: - uses: actions/checkout@v4 @@ -55,8 +57,10 @@ jobs: include: - os: ubuntu-latest onion_artifact: onion-linux-x86_64 - - os: macos-latest + - os: macos-13 onion_artifact: onion-darwin-x86_64 + - os: macos-14 + onion_artifact: onion-darwin-arm64 - os: windows-latest onion_artifact: none @@ -141,10 +145,11 @@ jobs: environment: release steps: - # Only use Linux wheel to avoid conflicts + # Download all platform-specific wheels - uses: actions/download-artifact@v4 with: - name: wheels-ubuntu-latest + pattern: wheels-* + merge-multiple: true path: dist/ - uses: actions/download-artifact@v4 diff --git a/dalla_data_processing/deduplication/onion/src/Makefile b/dalla_data_processing/deduplication/onion/src/Makefile index 72f5009..de497f3 100644 --- a/dalla_data_processing/deduplication/onion/src/Makefile +++ b/dalla_data_processing/deduplication/onion/src/Makefile @@ -1,7 +1,7 @@ include ../Makefile.config CC=g++ -CFLAGS=-Wall -O3 +CFLAGS=-Wall -O3 -std=c++11 -I/opt/homebrew/opt/google-sparsehash/include OBJS=version.o buzhash.o TARGETS=hashgen hashdup onion diff --git a/dalla_data_processing/deduplication/onion/src/Makefile.g b/dalla_data_processing/deduplication/onion/src/Makefile.g index fe85085..725af09 100644 --- a/dalla_data_processing/deduplication/onion/src/Makefile.g +++ b/dalla_data_processing/deduplication/onion/src/Makefile.g @@ -2,7 +2,7 @@ include ../Makefile.config CC=g++ #CFLAGS=-Wall -O3 -CFLAGS=-Wall -g +CFLAGS=-Wall -g -std=c++11 -I/opt/homebrew/opt/google-sparsehash/include OBJS=version.o buzhash.o TARGETS=hashgen hashdup onion diff --git a/dalla_data_processing/deduplication/onion/src_sc/Makefile b/dalla_data_processing/deduplication/onion/src_sc/Makefile index 72f5009..de497f3 100644 --- a/dalla_data_processing/deduplication/onion/src_sc/Makefile +++ b/dalla_data_processing/deduplication/onion/src_sc/Makefile @@ -1,7 +1,7 @@ include ../Makefile.config CC=g++ -CFLAGS=-Wall -O3 +CFLAGS=-Wall -O3 -std=c++11 -I/opt/homebrew/opt/google-sparsehash/include OBJS=version.o buzhash.o TARGETS=hashgen hashdup onion diff --git a/dalla_data_processing/deduplication/onion/src_sc/Makefile.g b/dalla_data_processing/deduplication/onion/src_sc/Makefile.g index fe85085..725af09 100644 --- a/dalla_data_processing/deduplication/onion/src_sc/Makefile.g +++ b/dalla_data_processing/deduplication/onion/src_sc/Makefile.g @@ -2,7 +2,7 @@ include ../Makefile.config CC=g++ #CFLAGS=-Wall -O3 -CFLAGS=-Wall -g +CFLAGS=-Wall -g -std=c++11 -I/opt/homebrew/opt/google-sparsehash/include OBJS=version.o buzhash.o TARGETS=hashgen hashdup onion diff --git a/pyproject.toml b/pyproject.toml index c0dd637..76edced 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,13 +11,16 @@ authors = [ {name = "Digital Research Unit - Arab Center", email = "dru@dohainstitute.edu.qa"} ] readme = "README.md" -requires-python = ">=3.12,<3.13" +requires-python = ">=3.10" keywords = ["arabic", "nlp", "data-processing", "deduplication", "stemming", "readability", "quality"] classifiers = [ "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Text Processing :: Linguistic", ] @@ -83,7 +86,7 @@ dalla_data_processing = ["py.typed"] [tool.ruff] line-length = 100 -target-version = "py312" +target-version = "py310" src = ["dalla_data_processing"] [tool.ruff.lint] diff --git a/scripts/build_onion.sh b/scripts/build_onion.sh index 00dfef2..2ade718 100755 --- a/scripts/build_onion.sh +++ b/scripts/build_onion.sh @@ -63,14 +63,16 @@ if [[ "$OSTYPE" == "darwin"* ]]; then # On macOS, add Homebrew paths for sparsehash if command -v brew &> /dev/null; then BREW_PREFIX=$(brew --prefix) - EXTRA_CFLAGS="-I${BREW_PREFIX}/include" + SPARSEHASH_PREFIX=$(brew --prefix google-sparsehash 2>/dev/null || echo "${BREW_PREFIX}") + EXTRA_CFLAGS="-I${SPARSEHASH_PREFIX}/include" echo -e "${YELLOW}Using Homebrew prefix: ${BREW_PREFIX}${NC}" + echo -e "${YELLOW}Using sparsehash include: ${SPARSEHASH_PREFIX}/include${NC}" fi fi # Build onion echo -e "${YELLOW}Compiling Onion...${NC}" -if make CFLAGS="-Wall -O3 ${EXTRA_CFLAGS}"; then +if make CFLAGS="-Wall -O3 -std=c++11 ${EXTRA_CFLAGS}"; then echo -e "${GREEN}✓ Compilation successful${NC}" else echo -e "${RED}✗ Compilation failed${NC}"