From 6dfdf9c754d0b5a974453577436c588f01471d2a Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Wed, 13 Sep 2023 10:12:09 +0200 Subject: [PATCH 01/22] reverting all of yesterday's changes --- .github/workflows/wheels.yml | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9954741..e96b262 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -10,7 +10,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, macOS-12] + os: [ubuntu-20.04, macOS-11] steps: - uses: actions/checkout@v3 @@ -37,29 +37,8 @@ jobs: fi && ./build-deps.sh CIBW_BEFORE_ALL_MACOS: > - brew install pkg-config autoconf-archive autoconf automake && - git clone https://github.com/tukaani-project/xz && - cd xz && - autoreconf --install && ./configure && make && make install && - cd .. && - git clone https://github.com/unicode-org/icu && - cd icu/icu4c/source && - ./configure && make && make install && ls -l /usr/local/lib/libicu* && - cd ../../../ && - git clone https://gitlab.gnome.org/GNOME/libxml2 && - cd libxml2 && - autoreconf --install && ./configure && make && make install && - cd ../ && - wget https://software.wise-guys.nl/download/libtextcat-2.2.tar.gz && - tar xzf libtextcat-2.2.tar.gz && - cd libtextcat-2.2 && autoreconf -i && ./configure && make && make install && - mkdir /usr/local/include/libtextcat/ && cp src/*.h /usr/local/include/libtextcat/ && - cd ../ && - git clone https://github.com/LanguageMachines/frog && - cd frog && - ./build-deps.sh && - ./bootstrap.sh && - ./configure && make && make install + brew tap fbkarsdorp/homebrew-lamachine && + brew install frog CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64 CIBW_SKIP: "*-win* *-manylinux_i686 pp*" From 3e61e747b8d5248e70f7f4b5a5b78244429d856f Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Wed, 13 Sep 2023 10:24:12 +0200 Subject: [PATCH 02/22] macos wheel building: switch to cirrus ci for native macos arm64 runners --- .cirrus.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000..c09d039 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,24 @@ +######################################################### +# Build arm64 wheels for OSX on Cirrus CI +######################################################### + +cirrus_wheels_macos_arm64_task: + name: Build macOS arm64 wheels. + trigger_type: manual + macos_instance: + image: ghcr.io/cirruslabs/macos-monterey-xcode:13.3.1 + env: + PATH: /opt/homebrew/opt/python@3.10/bin:$PATH + CIBW_ARCHS_MACOS: arm64 + install_pre_requirements_script: + - brew install python@3.10 + - ln -s python3 /opt/homebrew/opt/python@3.10/bin/python + - which python + - python --version + install_cibuildwheel_script: + - python -m pip install cibuildwheel + run_cibuildwheel_script: + - CIBW_SKIP="*-win32 *-manylinux_* *-musllinux_*" CIBW_ARCHS_MACOS="arm64" CIBW_BUILD="cp39-* cp310-* cp311-*" CIBW_BEFORE_ALL_MACOS="brew tap fbkarsdorp/homebrew-lamachine && brew install frog" cibuildwheel --platform macos + wheels_artifacts: + path: "wheelhouse/*" + From fbad767e937607d293a12c9c0e7a910093f3c2f7 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Wed, 13 Sep 2023 10:53:02 +0200 Subject: [PATCH 03/22] wheel building debug: increase verbosity --- .cirrus.yml | 3 +-- .github/workflows/wheels.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index c09d039..3db002a 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,6 @@ cirrus_wheels_macos_arm64_task: name: Build macOS arm64 wheels. - trigger_type: manual macos_instance: image: ghcr.io/cirruslabs/macos-monterey-xcode:13.3.1 env: @@ -18,7 +17,7 @@ cirrus_wheels_macos_arm64_task: install_cibuildwheel_script: - python -m pip install cibuildwheel run_cibuildwheel_script: - - CIBW_SKIP="*-win32 *-manylinux_* *-musllinux_*" CIBW_ARCHS_MACOS="arm64" CIBW_BUILD="cp39-* cp310-* cp311-*" CIBW_BEFORE_ALL_MACOS="brew tap fbkarsdorp/homebrew-lamachine && brew install frog" cibuildwheel --platform macos + - CIBW_BUILD_VERBOSITY=3 CIBW_SKIP="*-win32 *-manylinux_* *-musllinux_*" CIBW_ARCHS_MACOS="arm64" CIBW_BUILD="cp39-* cp310-* cp311-*" CIBW_BEFORE_ALL_MACOS="brew tap fbkarsdorp/homebrew-lamachine && brew install frog" cibuildwheel --platform macos wheels_artifacts: path: "wheelhouse/*" diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index e96b262..db3a0ac 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -25,7 +25,7 @@ jobs: run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_ARCHS_LINUX: "x86_64" - CIBW_ARCHS_MACOS: "x86_64 arm64" + CIBW_ARCHS_MACOS: "x86_64" CIBW_BEFORE_ALL_LINUX: > if command -v apt-get; then apt-get -y git libicu-dev libxml2-dev libexttextcat-dev libxslt1-dev libbz2-dev zlib1g-dev autoconf automake autoconf-archive libtool autotools-dev gcc g++ make From ed7ab8d22267b12ec66bafa9fd4e4223275adba6 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Wed, 13 Sep 2023 11:02:31 +0200 Subject: [PATCH 04/22] debug setup.py --- .cirrus.yml | 3 ++- setup.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 3db002a..4c8998f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,8 +4,9 @@ cirrus_wheels_macos_arm64_task: name: Build macOS arm64 wheels. + trigger_type: manual macos_instance: - image: ghcr.io/cirruslabs/macos-monterey-xcode:13.3.1 + image: ghcr.io/cirruslabs/macos-monterey-xcode:latest env: PATH: /opt/homebrew/opt/python@3.10/bin:$PATH CIBW_ARCHS_MACOS: arm64 diff --git a/setup.py b/setup.py index 8b0b8f8..90face3 100755 --- a/setup.py +++ b/setup.py @@ -4,13 +4,16 @@ from Cython.Build import cythonize import platform import os +import sys includedirs = [] libdirs = [] +print(f"system={platform.system()} machine={platform.machine()}", file=sys.stderr) if platform.system() == "Darwin": #we are running on Mac OS X (with homebrew hopefully), stuff is in specific locations: if platform.machine().lower() == "arm64": + print("(macos arm64 detected)", file=sys.stderr) libdirs.append("/opt/homebrew/lib") includedirs.append("/opt/homebrew/include") libdirs.append("/opt/homebrew/icu4c/lib") @@ -42,6 +45,8 @@ else: extra_options = ['-D U_USING_ICU_NAMESPACE=1'] +print(f"include_dirs={' '.join(includedirs)} library_dirs={' '.join(libdirs)} extra_options={' '.join(extra_options)}", file=sys.stderr) + extensions = cythonize([ Extension("frog", [ "frog_wrapper.pyx"], From 3d25acc2154f9dd97ccbd234e439ca890813e851 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Wed, 13 Sep 2023 11:09:36 +0200 Subject: [PATCH 05/22] macos wheel building: explicitly install icu4c and libxml2 --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 4c8998f..3468577 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -18,7 +18,7 @@ cirrus_wheels_macos_arm64_task: install_cibuildwheel_script: - python -m pip install cibuildwheel run_cibuildwheel_script: - - CIBW_BUILD_VERBOSITY=3 CIBW_SKIP="*-win32 *-manylinux_* *-musllinux_*" CIBW_ARCHS_MACOS="arm64" CIBW_BUILD="cp39-* cp310-* cp311-*" CIBW_BEFORE_ALL_MACOS="brew tap fbkarsdorp/homebrew-lamachine && brew install frog" cibuildwheel --platform macos + - CIBW_BUILD_VERBOSITY=3 CIBW_SKIP="*-win32 *-manylinux_* *-musllinux_*" CIBW_ARCHS_MACOS="arm64" CIBW_BUILD="cp39-* cp310-* cp311-*" CIBW_BEFORE_ALL_MACOS="brew tap fbkarsdorp/homebrew-lamachine && brew install icu4c libxml2 frog" cibuildwheel --platform macos wheels_artifacts: path: "wheelhouse/*" From 023b89cb1fe3e9aabd26765f5ac4231e779d52d0 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Wed, 13 Sep 2023 11:14:35 +0200 Subject: [PATCH 06/22] macosx wheel building: compile against homebrew's 'keg-only' libxml2 and icu4c --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index 90face3..be70787 100755 --- a/setup.py +++ b/setup.py @@ -21,6 +21,10 @@ libdirs.append("/opt/homebrew/libxml2/lib") includedirs.append("/opt/homebrew/libxml2/include") includedirs.append("/opt/homebrew/libxml2/include/libxml2") + libdirs.append("/opt/homebrew/opt/icu4c/lib") + includedirs.append("/opt/homebrew/opt/icu4c/include") + libdirs.append("/opt/homebrew/opt/libxml2/lib") + includedirs.append("/opt/homebrew/opt/libxml2/include") else: #we are running on Mac OS X with homebrew, stuff is in specific locations: libdirs.append("/usr/local/opt/icu4c/lib") From 1babaa474b127bc2f6fa5ec4b0ed66be4eb10d89 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Tue, 31 Oct 2023 16:11:47 +0100 Subject: [PATCH 07/22] updated dependencies for frog 0.31 --- frog_wrapper.pyx | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frog_wrapper.pyx b/frog_wrapper.pyx index 167d2f4..84ca1ba 100644 --- a/frog_wrapper.pyx +++ b/frog_wrapper.pyx @@ -20,7 +20,7 @@ import sys cimport libfolia_classes cimport frog_classes -FROGDATAVERSION = "0.21" +FROGDATAVERSION = "0.22" UCTODATAVERSION = "0.9.1" try: diff --git a/setup.py b/setup.py index be70787..faa4735 100755 --- a/setup.py +++ b/setup.py @@ -66,7 +66,7 @@ setup( name = 'python-frog', - version = '0.6.7', #also ensure UCTODATAVERSION and FROGDATAVERSION are good in frog_wrapper.pyx + version = '0.6.8', #also ensure UCTODATAVERSION and FROGDATAVERSION are good in frog_wrapper.pyx author = "Maarten van Gompel", author_email = "proycon@anaproy.nl", description = ("Python binding to Frog, an NLP suite for Dutch doing part-of-speech tagging, lemmatisation, morphological analysis, named-entity recognition, shallow parsing, and dependency parsing."), From e169d84bf52a488ccee9aded27100bae0ab471c4 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Mon, 20 Nov 2023 12:10:10 +0100 Subject: [PATCH 08/22] Allow passing docid as string instead of bytes #26 For backward-compatibility, passing bytes is still allowed as well --- frog_wrapper.pyx | 5 ++++- setup.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frog_wrapper.pyx b/frog_wrapper.pyx index 84ca1ba..fc5ac48 100644 --- a/frog_wrapper.pyx +++ b/frog_wrapper.pyx @@ -122,7 +122,10 @@ cdef class FrogOptions: elif key.lower() in ('debug','debugflag'): if value: self.capi.insert(b"d", b"1", False) elif key.lower() in ('docid','id'): - self.capi.insert(b"id", value) + if isinstance(value, bytes): + self.capi.insert(b"id", value) + else: + self.capi.insert(b"id", value.encode('utf-8')) elif key.lower() in ('numthreads','threads'): self.capi.insert(b"threads",value) else: diff --git a/setup.py b/setup.py index faa4735..e8c265e 100755 --- a/setup.py +++ b/setup.py @@ -66,7 +66,7 @@ setup( name = 'python-frog', - version = '0.6.8', #also ensure UCTODATAVERSION and FROGDATAVERSION are good in frog_wrapper.pyx + version = '0.6.9', #also ensure UCTODATAVERSION and FROGDATAVERSION are good in frog_wrapper.pyx author = "Maarten van Gompel", author_email = "proycon@anaproy.nl", description = ("Python binding to Frog, an NLP suite for Dutch doing part-of-speech tagging, lemmatisation, morphological analysis, named-entity recognition, shallow parsing, and dependency parsing."), From 5d57c18ca7302e94a2ee21ca2005bab58705978f Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Mon, 27 Nov 2023 15:03:38 +0100 Subject: [PATCH 09/22] codemeta fix --- codemeta-harvest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codemeta-harvest.json b/codemeta-harvest.json index a770f0e..767e19e 100644 --- a/codemeta-harvest.json +++ b/codemeta-harvest.json @@ -15,5 +15,5 @@ }, "contIntegration": "https://github.com/proycon/python-frog/actions/workflows/python-frog.yml", "applicationCategory": [ "https://vocabs.dariah.eu/tadirah/annotating", "https://vocabs.dariah.eu/tadirah/tagging", "https://vocabs.dariah.eu/tadirah/namedEntityRecognition", "https://vocabs.dariah.eu/tadirah/posTagging", "https://vocabs.dariah.eu/tadirah/segmenting", "https://vocabs.dariah.eu/tadirah/treeTagging", "https://vocabs.dariah.eu/tadirah/contextualizing" , "https://w3id.org/nwo-research-fields#Linguistics", "https://w3id.org/nwo-research-fields#TextualAndContentAnalysis" ], - "developmentStatus": [ "https://www.repostatus.org/#active", "https://w3id.org/research-technology-readiness-levels#Level9Proven" ], + "developmentStatus": [ "https://www.repostatus.org/#active", "https://w3id.org/research-technology-readiness-levels#Level9Proven" ] } From 976801722deae5d2a5285f1f0bcfc476f7ae4436 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Tue, 5 Dec 2023 15:47:42 +0100 Subject: [PATCH 10/22] version bump --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e8c265e..81c086c 100755 --- a/setup.py +++ b/setup.py @@ -66,7 +66,7 @@ setup( name = 'python-frog', - version = '0.6.9', #also ensure UCTODATAVERSION and FROGDATAVERSION are good in frog_wrapper.pyx + version = '0.6.10', #also ensure UCTODATAVERSION and FROGDATAVERSION are good in frog_wrapper.pyx author = "Maarten van Gompel", author_email = "proycon@anaproy.nl", description = ("Python binding to Frog, an NLP suite for Dutch doing part-of-speech tagging, lemmatisation, morphological analysis, named-entity recognition, shallow parsing, and dependency parsing."), From 33991c0085f67808312c5999ec2ec81186b5adc5 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Thu, 12 Sep 2024 15:46:48 +0200 Subject: [PATCH 11/22] ci: updaded wheel building --- .github/workflows/wheels.yml | 42 +++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index db3a0ac..d9e754a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -6,42 +6,64 @@ on: [workflow_dispatch] jobs: build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} + name: Build wheels on for ${{matrix.python.cp}}-${{ matrix.buildplat.sys }} + runs-on: ${{ matrix.buildplat.runs_on }} strategy: matrix: - os: [ubuntu-20.04, macOS-11] + buildplat: + - { runs_on: ubuntu-20.04, sys: manylinux, arch: x86_64, benv: "" } + - { runs_on: macos-12, sys: macosx, arch: x86_64, benv: "12.0" } + - { runs_on: macos-14, sys: macosx, arch: arm64, benv: "14.0" } + python: + - { cp: "cp38", rel: "3.8" } + - { cp: "cp39", rel: "3.9" } + - { cp: "cp310", rel: "3.10" } + - { cp: "cp311", rel: "3.11" } + - { cp: "cp312", rel: "3.12" } steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4.1.1 # Used to host cibuildwheel - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v5 + with: + python-version: 3.11 - name: Install cibuildwheel run: python -m pip install cibuildwheel - - name: Build wheels + - name: Build wheels (Linux) + if: ${{ runner.os != 'macOS' }} run: python -m cibuildwheel --output-dir wheelhouse env: + CIBW_BUILD: ${{ matrix.python.cp }}-${{ matrix.buildplat.sys }}* CIBW_ARCHS_LINUX: "x86_64" - CIBW_ARCHS_MACOS: "x86_64" CIBW_BEFORE_ALL_LINUX: > if command -v apt-get; then apt-get -y git libicu-dev libxml2-dev libexttextcat-dev libxslt1-dev libbz2-dev zlib1g-dev autoconf automake autoconf-archive libtool autotools-dev gcc g++ make elif command -v yum; then yum install -y git libicu-devel libxml2-devel libxslt-devel libexttextcat zlib-devel bzip2-devel libtool autoconf-archive autoconf automake m4 wget + #on CentOS 7 we also have libtar-devel libexttextcat-devel which will be installed by build-deps.sh, on 8 they are missing and will be installed from source or otherwise elif command -v apk; then apk add build-base git autoconf-archive autoconf automake libtool bzip2-dev icu-dev libxml2-dev libexttextcat-dev libtool rsync && rsync -av --ignore-existing /usr/share/aclocal/*.m4 /usr/local/share/aclocal/ fi && ./build-deps.sh + CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64 + CIBW_SKIP: "*-win* *-manylinux_i686 pp*" + + - name: Build wheels (macOS) + if: ${{ runner.os == 'macOS' }} + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: ${{ matrix.python.cp }}-${{ matrix.buildplat.sys }}* + CIBW_ARCHS: ${{ matrix.buildplat.arch }} + CIBW_ENVIRONMENT: "MACOSX_DEPLOYMENT_TARGET=${{ matrix.buildplat.benv }}" CIBW_BEFORE_ALL_MACOS: > brew tap fbkarsdorp/homebrew-lamachine && brew install frog - CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64 - CIBW_SKIP: "*-win* *-manylinux_i686 pp*" - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: ${{matrix.python.cp}}-${{matrix.buildplat.sys}}-${{matrix.buildplat.arch}} path: ./wheelhouse/*.whl From 6b56ff6b7c688b7d42aedf27d91c7672528776c4 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Thu, 12 Sep 2024 16:01:55 +0200 Subject: [PATCH 12/22] ci: skip python3.8 on mac --- .github/workflows/wheels.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d9e754a..c6c934a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -53,7 +53,7 @@ jobs: CIBW_SKIP: "*-win* *-manylinux_i686 pp*" - name: Build wheels (macOS) - if: ${{ runner.os == 'macOS' }} + if: ${{ runner.os == 'macOS' && runner.python != "3.8" }} run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python.cp }}-${{ matrix.buildplat.sys }}* @@ -64,6 +64,7 @@ jobs: brew install frog - uses: actions/upload-artifact@v4 + if: ${{ ! (runner.os == 'macOS' && runner.python == "3.8") }} with: name: ${{matrix.python.cp}}-${{matrix.buildplat.sys}}-${{matrix.buildplat.arch}} path: ./wheelhouse/*.whl From 02946db86196b25270972fe316bb6414290d079c Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Mon, 28 Oct 2024 17:28:59 +0100 Subject: [PATCH 13/22] ci: syntax fix something must have changed github-side --- .github/workflows/wheels.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index c6c934a..b08f2a6 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -20,6 +20,7 @@ jobs: - { cp: "cp310", rel: "3.10" } - { cp: "cp311", rel: "3.11" } - { cp: "cp312", rel: "3.12" } + - { cp: "cp313", rel: "3.13" } steps: - uses: actions/checkout@v4.1.1 @@ -53,7 +54,7 @@ jobs: CIBW_SKIP: "*-win* *-manylinux_i686 pp*" - name: Build wheels (macOS) - if: ${{ runner.os == 'macOS' && runner.python != "3.8" }} + if: ${{ runner.os == 'macOS' && runner.python != '3.8' }} run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python.cp }}-${{ matrix.buildplat.sys }}* @@ -64,7 +65,7 @@ jobs: brew install frog - uses: actions/upload-artifact@v4 - if: ${{ ! (runner.os == 'macOS' && runner.python == "3.8") }} + if: ${{ ! (runner.os == 'macOS' && runner.python == '3.8') }} with: name: ${{matrix.python.cp}}-${{matrix.buildplat.sys}}-${{matrix.buildplat.arch}} path: ./wheelhouse/*.whl From 873ff9b0594f3102b285b0aae3093f2f7e70d4b4 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Tue, 17 Dec 2024 12:37:54 +0100 Subject: [PATCH 14/22] ci: wheel building update --- .github/workflows/wheels.yml | 27 +++++++++++++++++------ build-deps.sh | 42 ++++++++++++++++++++---------------- setup.py | 2 +- 3 files changed, 45 insertions(+), 26 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b08f2a6..992f55e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -12,7 +12,8 @@ jobs: matrix: buildplat: - { runs_on: ubuntu-20.04, sys: manylinux, arch: x86_64, benv: "" } - - { runs_on: macos-12, sys: macosx, arch: x86_64, benv: "12.0" } + - { runs_on: ubuntu-20.04, sys: musllinux, arch: x86_64, benv: "" } + - { runs_on: ubuntu-20.04, sys: musllinux, arch: aarch64, benv: "" } - { runs_on: macos-14, sys: macosx, arch: arm64, benv: "14.0" } python: - { cp: "cp38", rel: "3.8" } @@ -33,8 +34,8 @@ jobs: - name: Install cibuildwheel run: python -m pip install cibuildwheel - - name: Build wheels (Linux) - if: ${{ runner.os != 'macOS' }} + - name: Build wheels (Linux glibc) + if: ${{ matrix.buildplat.sys == 'manylinux' }} run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python.cp }}-${{ matrix.buildplat.sys }}* @@ -50,11 +51,25 @@ jobs: rsync -av --ignore-existing /usr/share/aclocal/*.m4 /usr/local/share/aclocal/ fi && ./build-deps.sh - CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux2014_x86_64 + CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/manylinux_2_28_x86_64 + CIBW_SKIP: "*-win* *-manylinux_i686 pp*" + + - name: Build wheels (Linux musl) + if: ${{ matrix.buildplat.sys == 'musllinux' }} + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_BUILD: ${{ matrix.python.cp }}-${{ matrix.buildplat.sys }}* + CIBW_ARCHS_LINUX: "x86_64 aarch64" + CIBW_BEFORE_ALL_LINUX: > + apk add build-base git autoconf-archive autoconf automake libtool bzip2-dev icu-dev libxml2-dev libexttextcat-dev libtool rsync && + mkdir -p /usr/local/share/aclocal/ && rsync -av --ignore-existing /usr/share/aclocal/*.m4 /usr/local/share/aclocal/ && + ./build-deps.sh + CIBW_MUSLLINUX_X86_64_IMAGE: quay.io/pypa/musllinux_1_1_x86_64 + CIBW_MUSLLINUX_AARCH64_IMAGE: quay.io/pypa/musllinux_1_1_aarch64 CIBW_SKIP: "*-win* *-manylinux_i686 pp*" - name: Build wheels (macOS) - if: ${{ runner.os == 'macOS' && runner.python != '3.8' }} + if: ${{ runner.os == 'macOS' && matrix.python.cp != 'cp38' }} run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python.cp }}-${{ matrix.buildplat.sys }}* @@ -65,7 +80,7 @@ jobs: brew install frog - uses: actions/upload-artifact@v4 - if: ${{ ! (runner.os == 'macOS' && runner.python == '3.8') }} + if: ${{ ! (runner.os == 'macOS' && matrix.python.cp == '3.8') }} with: name: ${{matrix.python.cp}}-${{matrix.buildplat.sys}}-${{matrix.buildplat.arch}} path: ./wheelhouse/*.whl diff --git a/build-deps.sh b/build-deps.sh index 04fc8e4..0173d14 100755 --- a/build-deps.sh +++ b/build-deps.sh @@ -7,6 +7,8 @@ set -e . /etc/os-release +echo "OS: $ID">&2 +echo "VERSION: $VERSION_ID">&2 get_latest_version() { #Finds the latest git tag or falls back to returning the git default branch (usually master or main) @@ -27,24 +29,27 @@ if [ "$ID" = "almalinux" ] || [ "$ID" = "centos" ] || [ "$ID" = "rhel" ]; then #needed for manylinux_2_28 container which ships custom autoconf, possibly others too? export ACLOCAL_PATH=/usr/share/aclocal fi - if [ "$VERSION_ID" = "7" ]; then - yum install -y libexttextcat-devel - if [ -d /opt/rh/devtoolset-10/root/usr/lib ]; then - #we are running in the manylinux2014 image - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/opt/rh/devtoolset-10/root/usr/lib - #libxml2 is out of date, compile and install a new one - yum install -y xz - wget https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz - unxz libxml2-2.9.14.tar.xz - tar -xf libxml2-2.9.14.tar - cd libxml2-2.9.14 && ./configure --prefix=$PREFIX --without-python && make && make install - cd .. - fi - elif [ "$VERSION_ID" = "8" ]; then - #they forgot to package libexttextcat-devel? grab one manually: - wget https://github.com/proycon/LaMachine/raw/master/deps/centos8/libexttextcat-devel-3.4.5-2.el8.x86_64.rpm - yum install -y libexttextcat-devel-3.4.5-2.el8.x86_64.rpm - fi + case $VERSION_ID in + 7*) + yum install -y libexttextcat-devel + if [ -d /opt/rh/devtoolset-10/root/usr/lib ]; then + #we are running in the manylinux2014 image + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/opt/rh/devtoolset-10/root/usr/lib + #libxml2 is out of date, compile and install a new one + yum install -y xz + wget https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz + unxz libxml2-2.9.14.tar.xz + tar -xf libxml2-2.9.14.tar + cd libxml2-2.9.14 && ./configure --prefix=$PREFIX --without-python && make && make install + cd .. + fi + ;; + 8*) + #they forgot to package libexttextcat-devel? grab one manually: + wget https://github.com/proycon/LaMachine/raw/master/deps/centos8/libexttextcat-devel-3.4.5-2.el8.x86_64.rpm + yum install -y libexttextcat-devel-3.4.5-2.el8.x86_64.rpm + ;; + esac fi PWD="$(pwd)" @@ -77,5 +82,4 @@ for PACKAGE in LanguageMachines/ticcutils LanguageMachines/libfolia LanguageMach done cd $PWD [ -n "$BUILDDIR" ] && rm -Rf "$BUILDDIR" - echo "Dependencies installed" >&2 diff --git a/setup.py b/setup.py index 81c086c..0c62463 100755 --- a/setup.py +++ b/setup.py @@ -66,7 +66,7 @@ setup( name = 'python-frog', - version = '0.6.10', #also ensure UCTODATAVERSION and FROGDATAVERSION are good in frog_wrapper.pyx + version = '0.6.11', #also ensure UCTODATAVERSION and FROGDATAVERSION are good in frog_wrapper.pyx author = "Maarten van Gompel", author_email = "proycon@anaproy.nl", description = ("Python binding to Frog, an NLP suite for Dutch doing part-of-speech tagging, lemmatisation, morphological analysis, named-entity recognition, shallow parsing, and dependency parsing."), From 7cff8d36fc9f9ea288d4a09bf9312e7762eb1bc3 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Tue, 17 Dec 2024 12:54:47 +0100 Subject: [PATCH 15/22] ci: no aarch64 for musllinux yet --- .github/workflows/wheels.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 992f55e..8112e16 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -13,7 +13,6 @@ jobs: buildplat: - { runs_on: ubuntu-20.04, sys: manylinux, arch: x86_64, benv: "" } - { runs_on: ubuntu-20.04, sys: musllinux, arch: x86_64, benv: "" } - - { runs_on: ubuntu-20.04, sys: musllinux, arch: aarch64, benv: "" } - { runs_on: macos-14, sys: macosx, arch: arm64, benv: "14.0" } python: - { cp: "cp38", rel: "3.8" } @@ -59,7 +58,7 @@ jobs: run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python.cp }}-${{ matrix.buildplat.sys }}* - CIBW_ARCHS_LINUX: "x86_64 aarch64" + CIBW_ARCHS_LINUX: "x86_64" CIBW_BEFORE_ALL_LINUX: > apk add build-base git autoconf-archive autoconf automake libtool bzip2-dev icu-dev libxml2-dev libexttextcat-dev libtool rsync && mkdir -p /usr/local/share/aclocal/ && rsync -av --ignore-existing /usr/share/aclocal/*.m4 /usr/local/share/aclocal/ && From 0dea00c555d31fe9141e7f9c03fc419692ce60e7 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Tue, 17 Dec 2024 13:07:16 +0100 Subject: [PATCH 16/22] use c++17 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0c62463..8002bf3 100755 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ include_dirs=includedirs, library_dirs=libdirs, libraries=['frog','ucto','folia'], - extra_compile_args=['--std=c++0x'] + extra_options) + extra_compile_args=['--std=c++17'] + extra_options) ], compiler_directives={"language_level": "3"} ) From b411da925d1e58922a2339f8a93e78be6d4a649f Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Thu, 20 Mar 2025 17:20:36 +0100 Subject: [PATCH 17/22] fix numthreads parsing, expect int value Not ideal though (int to str in cython and back to int on the C++ side) Ref: https://github.com/proycon/python-frog/issues/5 --- frog_wrapper.pyx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frog_wrapper.pyx b/frog_wrapper.pyx index fc5ac48..8da1948 100644 --- a/frog_wrapper.pyx +++ b/frog_wrapper.pyx @@ -127,7 +127,10 @@ cdef class FrogOptions: else: self.capi.insert(b"id", value.encode('utf-8')) elif key.lower() in ('numthreads','threads'): - self.capi.insert(b"threads",value) + if isinstance(value, int): + self.capi.insert(b"threads",str(value).encode('utf-8')) + else: + self.capi.insert(b"threads",value) else: if key == 'x': self.shadow['xmlin'] = True From 1b1cb85fa118463a3d8dd5ae175c71ab391a126a Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Thu, 20 Mar 2025 17:22:35 +0100 Subject: [PATCH 18/22] version bump --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8002bf3..c091c4f 100755 --- a/setup.py +++ b/setup.py @@ -66,7 +66,7 @@ setup( name = 'python-frog', - version = '0.6.11', #also ensure UCTODATAVERSION and FROGDATAVERSION are good in frog_wrapper.pyx + version = '0.6.12', #also ensure UCTODATAVERSION and FROGDATAVERSION are good in frog_wrapper.pyx author = "Maarten van Gompel", author_email = "proycon@anaproy.nl", description = ("Python binding to Frog, an NLP suite for Dutch doing part-of-speech tagging, lemmatisation, morphological analysis, named-entity recognition, shallow parsing, and dependency parsing."), From 345b52c7e2dae72953571e90b8e63d5c61bf1651 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Mon, 2 Feb 2026 10:25:03 +0100 Subject: [PATCH 19/22] ci: added python 3.14 to wheel builder --- .github/workflows/wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8112e16..b6f230e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -21,6 +21,7 @@ jobs: - { cp: "cp311", rel: "3.11" } - { cp: "cp312", rel: "3.12" } - { cp: "cp313", rel: "3.13" } + - { cp: "cp314", rel: "3.14" } steps: - uses: actions/checkout@v4.1.1 From ce9a6904658d87700fd37cf696a840b86173743f Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Mon, 2 Feb 2026 15:25:09 +0100 Subject: [PATCH 20/22] ci: wheels: ubuntu 20.04 is deprecated on github actions, upgrading --- .github/workflows/wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index b6f230e..3ab0821 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -11,8 +11,8 @@ jobs: strategy: matrix: buildplat: - - { runs_on: ubuntu-20.04, sys: manylinux, arch: x86_64, benv: "" } - - { runs_on: ubuntu-20.04, sys: musllinux, arch: x86_64, benv: "" } + - { runs_on: ubuntu-22.04, sys: manylinux, arch: x86_64, benv: "" } + - { runs_on: ubuntu-22.04, sys: musllinux, arch: x86_64, benv: "" } - { runs_on: macos-14, sys: macosx, arch: arm64, benv: "14.0" } python: - { cp: "cp38", rel: "3.8" } From f30a543ce83bca84ac80c0b6088cc61bb9784ce3 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Mon, 2 Feb 2026 15:37:02 +0100 Subject: [PATCH 21/22] ci: wheels: no python 3.14 on alpine yet --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 3ab0821..a0b3a7e 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -55,7 +55,7 @@ jobs: CIBW_SKIP: "*-win* *-manylinux_i686 pp*" - name: Build wheels (Linux musl) - if: ${{ matrix.buildplat.sys == 'musllinux' }} + if: ${{ matrix.buildplat.sys == 'musllinux' && matrix.python.cp != 'cp314' }} run: python -m cibuildwheel --output-dir wheelhouse env: CIBW_BUILD: ${{ matrix.python.cp }}-${{ matrix.buildplat.sys }}* From 6201c88aa29df766efd938787613ea781394ffec Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Mon, 2 Feb 2026 15:54:42 +0100 Subject: [PATCH 22/22] setup.py: license classifier is deprecated, removing --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c091c4f..feb491c 100755 --- a/setup.py +++ b/setup.py @@ -70,7 +70,7 @@ author = "Maarten van Gompel", author_email = "proycon@anaproy.nl", description = ("Python binding to Frog, an NLP suite for Dutch doing part-of-speech tagging, lemmatisation, morphological analysis, named-entity recognition, shallow parsing, and dependency parsing."), - license = "GPLv3", + license = "GPL-3.0-only", keywords = "nlp computational_linguistics dutch pos lemmatizer", url = "https://github.com/proycon/python-frog", ext_modules = extensions, @@ -86,6 +86,5 @@ "Operating System :: POSIX", "Intended Audience :: Developers", "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", ], )