From cfdec0762a50a526da9ac0e4afe4ce01da5e3db8 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 16:00:20 +0200 Subject: [PATCH 01/16] . --- .circleci/config.yml | 94 +++++++++++++------------------------------- 1 file changed, 28 insertions(+), 66 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a1cd8a40e..cdd55b1ce 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,11 +20,11 @@ # command: | # . .circleci/cmake_test.sh -version: 2 +version: 2.1 jobs: - "py368": + "py310": docker: - - image: circleci/python:3.6.8 + - image: circleci/python:3.10 working_directory: ~/repo steps: - checkout @@ -33,10 +33,9 @@ jobs: . .circleci/setup_circleimg.sh . .circleci/python_test.sh - - "py357": + "py311": docker: - - image: circleci/python:3.5.7 + - image: circleci/python:3.11 working_directory: ~/repo steps: - checkout @@ -44,10 +43,9 @@ jobs: command: | . .circleci/setup_circleimg.sh . .circleci/python_test.sh - - "py3410": + "py39": docker: - - image: circleci/python:3.4.10 + - image: circleci/python:3.9 working_directory: ~/repo steps: - checkout @@ -56,20 +54,9 @@ jobs: . .circleci/setup_circleimg.sh . .circleci/python_test.sh - "py2715": + "gcc13": docker: - - image: circleci/python:2.7.15 - working_directory: ~/repo - steps: - - checkout - - run: - command: | - . .circleci/setup_circleimg.sh - . .circleci/python_test.sh - - "gcc5": - docker: - - image: gcc:5 + - image: gcc:13 working_directory: ~/repo steps: - checkout @@ -77,9 +64,9 @@ jobs: command: | . .circleci/gcc_test.sh - "gcc6": + "gcc12": docker: - - image: gcc:6 + - image: gcc:12 working_directory: ~/repo steps: - checkout @@ -87,9 +74,9 @@ jobs: command: | . .circleci/gcc_test.sh - "gcc7": + "gcc11": docker: - - image: gcc:7 + - image: gcc:12 working_directory: ~/repo steps: - checkout @@ -107,9 +94,9 @@ jobs: command: | . .circleci/gcc_test.sh - "debian-stretch-gcc": + "debian-bullseye-gcc": docker: - - image: debian:stretch + - image: debian:bullseye working_directory: ~/repo steps: - checkout @@ -118,9 +105,9 @@ jobs: . .circleci/setup_debian.sh . .circleci/gcc_test.sh - "debian-stretch-cmake": + "debian-bullseye-cmake": docker: - - image: debian:stretch + - image: debian:bullseye working_directory: ~/repo steps: - checkout @@ -129,9 +116,9 @@ jobs: . .circleci/setup_debian.sh . .circleci/cmake_test.sh - "debian-stretch-python": + "debian-bullseye-python": docker: - - image: debian:stretch + - image: debian:bullseye working_directory: ~/repo steps: - checkout @@ -141,28 +128,6 @@ jobs: pip install . python runtests.py -u - "debian-jessie-gcc": - docker: - - image: debian:jessie - working_directory: ~/repo - steps: - - checkout - - run: - command: | - . .circleci/setup_debian.sh - . .circleci/gcc_test.sh - - "debian-jessie-cmake": - docker: - - image: debian:jessie - working_directory: ~/repo - steps: - - checkout - - run: - command: | - . .circleci/setup_debian.sh - . .circleci/cmake_test.sh - "website-build": docker: - image: node:latest @@ -180,17 +145,14 @@ workflows: version: 2 build: jobs: - - "py368" - - "py357" - - "py3410" - - "py2715" - - "gcc5" - - "gcc6" - - "gcc7" + - "py311" + - "py310" + - "py39" + - "gcc13" + - "gcc12" + - "gcc11" - "gcclatest" - "website-build" - - "debian-stretch-gcc" - - "debian-stretch-cmake" - - "debian-stretch-python" - - "debian-jessie-gcc" - - "debian-jessie-cmake" + - "debian-bullseye-gcc" + - "debian-bullseye-cmake" + - "debian-bullseye-python" From e090c1502618c6daca63297412dec5d850433732 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 16:03:10 +0200 Subject: [PATCH 02/16] . --- setup.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 16b9094c8..52ea10d22 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ import platform import io -__version__ = '0.9.2' +__version__ = '0.9.3' FASTTEXT_SRC = "src" # Based on https://github.com/pybind/python_example @@ -180,10 +180,9 @@ def _get_readme(): 'Intended Audience :: Developers', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'Topic :: Software Development', 'Topic :: Scientific/Engineering', 'Operating System :: Microsoft :: Windows', @@ -191,7 +190,7 @@ def _get_readme(): 'Operating System :: Unix', 'Operating System :: MacOS', ], - install_requires=['pybind11>=2.2', "setuptools >= 0.7.0", "numpy"], + install_requires=['pybind11>=2.10', "setuptools >= 67.6.1", "numpy"], cmdclass={'build_ext': BuildExt}, packages=[ str('fasttext'), From 8995780052bbd7c82591eb2ceddeec4b5748df3f Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 16:04:34 +0200 Subject: [PATCH 03/16] . --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index b88034e41..08aedd7e6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ [metadata] -description-file = README.md +description_file = README.md From 4a5ed8b99aea6528389775d7650695006cd15d9b Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 16:11:52 +0200 Subject: [PATCH 04/16] . --- .github/workflows/build-wheels.yml | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/build-wheels.yml diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 000000000..1b67061be --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -0,0 +1,59 @@ +name: CI +on: [ push, pull_request ] +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + python: [ "3.9", "3.10", "3.11" ] + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: | + ${{ env.pythonLocation }}/lib/python${{ matrix.python }}/site-packages + ~/.torch + key: ${{ runner.os }}-torch${{ matrix.torch }}-${{ hashFiles('setup.py') }}-20230418 + - name: Install dependencies macOS + if: matrix.os == 'macos-latest' + run: | + python -m pip install -U pip + python -m pip install numpy setuptools pybind11 + - name: Install dependencies ubuntu + if: matrix.os == 'ubuntu-latest' + run: | + python -m pip install -U pip + python -m pip install numpy setuptools pybind11 + python -m pip install .[all] + - name: Build and install macos + if: matrix.os == 'macOS' + run: | + python -m pip install .[all] + - name: Create wheel + run: | + python -m pip install wheel + python setup.py bdist_wheel + - name: Upload wheel + uses: actions/upload-artifact@v3 + with: + name: fasttext-${{ matrix.python }}-pytorch${{ matrix.torch }}-${{matrix.os}}-wheel + path: dist/*.whl + - name: Build and install linux + if: matrix.os == 'ubuntu-latest' + run: | + python -m pip install -e .[all] + python -m fasttext.utils.collect_env + - name: Upload wheel + uses: actions/upload-artifact@v3 + with: + name: fasttext-${{ matrix.python }}-pytorch${{ matrix.torch }}-${{matrix.os}}-wheel + path: dist/*.whl \ No newline at end of file From 015a1047ff2c5323c553bc2354c34df5a6333ed4 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 16:16:12 +0200 Subject: [PATCH 05/16] . --- .github/workflows/build-wheels.yml | 6 +-- .github/workflows/workflow.yml | 59 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/workflow.yml diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 1b67061be..216833f31 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -37,7 +37,7 @@ jobs: - name: Build and install macos if: matrix.os == 'macOS' run: | - python -m pip install .[all] + python -m pip install -e .[all] - name: Create wheel run: | python -m pip install wheel @@ -45,7 +45,7 @@ jobs: - name: Upload wheel uses: actions/upload-artifact@v3 with: - name: fasttext-${{ matrix.python }}-pytorch${{ matrix.torch }}-${{matrix.os}}-wheel + name: fasttext-${{ matrix.python }}-${{matrix.os}}-wheel path: dist/*.whl - name: Build and install linux if: matrix.os == 'ubuntu-latest' @@ -55,5 +55,5 @@ jobs: - name: Upload wheel uses: actions/upload-artifact@v3 with: - name: fasttext-${{ matrix.python }}-pytorch${{ matrix.torch }}-${{matrix.os}}-wheel + name: fasttext-${{ matrix.python }}-${{matrix.os}}-wheel path: dist/*.whl \ No newline at end of file diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml new file mode 100644 index 000000000..b9fe4646b --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,59 @@ +name: CI +on: [ push, pull_request ] + +# Run linter with github actions for quick feedbacks. +# Run macos tests with github actions. Linux (CPU & GPU) tests currently runs on CircleCI +jobs: + linter: + runs-on: ubuntu-latest + # run on PRs, or commits to facebookresearch (not internal) + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Install dependencies + # flake8-bugbear flake8-comprehensions are useful but not available internally + run: | + python -m pip install --upgrade pip + python -m pip install flake8==6.0.0 isort==5.12.0 + python -m pip install black==23.1.0 + flake8 --version + - name: Lint + run: | + echo "Running isort" + isort -c --sp . . + echo "Running black" + black -l 100 --check . + echo "Running flake8" + flake8 . + + macos_tests: + runs-on: macos-latest + # run on PRs, or commits to facebookresearch (not internal) + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: | + ${{ env.pythonLocation }}/lib/python3.10/site-packages + key: ${{ runner.os }}-${{ hashFiles('setup.py') }}-20230418 + + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install numpy setuptools pybind11 + - name: Build and install + run: | + python -m pip install -e .[all] + - name: Run unittests + run: . .circleci/python_test.sh \ No newline at end of file From d24f439ec8823ef0c3e9f0dfc378f1230f10c27b Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 16:18:30 +0200 Subject: [PATCH 06/16] . --- .github/workflows/build-wheels.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 216833f31..32096d060 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -33,7 +33,6 @@ jobs: run: | python -m pip install -U pip python -m pip install numpy setuptools pybind11 - python -m pip install .[all] - name: Build and install macos if: matrix.os == 'macOS' run: | @@ -51,7 +50,6 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | python -m pip install -e .[all] - python -m fasttext.utils.collect_env - name: Upload wheel uses: actions/upload-artifact@v3 with: From 2d1b13fafd03f12c640806d62fc1fac2bb6457b9 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 16:20:23 +0200 Subject: [PATCH 07/16] updated --- .github/workflows/workflow.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index b9fe4646b..e49598b93 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -37,15 +37,15 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Cache dependencies uses: actions/cache@v3 with: path: | - ${{ env.pythonLocation }}/lib/python3.10/site-packages + ${{ env.pythonLocation }}/lib/python3.11/site-packages key: ${{ runner.os }}-${{ hashFiles('setup.py') }}-20230418 - name: Install dependencies From fb76d2beb0184a264d42aabe1bc42413dfa9a857 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 16:27:47 +0200 Subject: [PATCH 08/16] updated --- .github/workflows/build-wheels.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 32096d060..62ae9cb73 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -27,16 +27,16 @@ jobs: if: matrix.os == 'macos-latest' run: | python -m pip install -U pip - python -m pip install numpy setuptools pybind11 + python -m pip install -U numpy setuptools pybind11 - name: Install dependencies ubuntu if: matrix.os == 'ubuntu-latest' run: | python -m pip install -U pip - python -m pip install numpy setuptools pybind11 + python -m pip install -U numpy setuptools pybind11 - name: Build and install macos if: matrix.os == 'macOS' run: | - python -m pip install -e .[all] + python -m pip install -U -e .[all] - name: Create wheel run: | python -m pip install wheel @@ -46,10 +46,6 @@ jobs: with: name: fasttext-${{ matrix.python }}-${{matrix.os}}-wheel path: dist/*.whl - - name: Build and install linux - if: matrix.os == 'ubuntu-latest' - run: | - python -m pip install -e .[all] - name: Upload wheel uses: actions/upload-artifact@v3 with: From 8cbb20f1f27dc436e09377ab4800eb74ddc45274 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 16:29:32 +0200 Subject: [PATCH 09/16] . --- .github/workflows/workflow.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index e49598b93..4f221b09e 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -52,8 +52,5 @@ jobs: run: | python -m pip install -U pip python -m pip install numpy setuptools pybind11 - - name: Build and install - run: | - python -m pip install -e .[all] - name: Run unittests run: . .circleci/python_test.sh \ No newline at end of file From fabd3aaffb72f8f8ba01600063a860ae5955f235 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 16:29:59 +0200 Subject: [PATCH 10/16] finished --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 4f221b09e..a37ebb335 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -53,4 +53,4 @@ jobs: python -m pip install -U pip python -m pip install numpy setuptools pybind11 - name: Run unittests - run: . .circleci/python_test.sh \ No newline at end of file + run: python runtests.py -u \ No newline at end of file From 2a7fe1d52d368406b1dc2e39b384066ef5e6c48a Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 16:30:11 +0200 Subject: [PATCH 11/16] finished --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index a37ebb335..668e04053 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -51,6 +51,6 @@ jobs: - name: Install dependencies run: | python -m pip install -U pip - python -m pip install numpy setuptools pybind11 + python -m pip install -U numpy setuptools pybind11 - name: Run unittests run: python runtests.py -u \ No newline at end of file From c2118be2dd2e2f011b31e7b11d99992b6cd7fc53 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 19:26:02 +0200 Subject: [PATCH 12/16] . --- .github/workflows/build-wheels.yml | 1 + .github/workflows/workflow.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 62ae9cb73..3baf0e854 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -31,6 +31,7 @@ jobs: - name: Install dependencies ubuntu if: matrix.os == 'ubuntu-latest' run: | + apt install g++ make cmake build-essential python -m pip install -U pip python -m pip install -U numpy setuptools pybind11 - name: Build and install macos diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 668e04053..3a6812928 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -50,6 +50,7 @@ jobs: - name: Install dependencies run: | + apt install g++ make cmake build-essential python -m pip install -U pip python -m pip install -U numpy setuptools pybind11 - name: Run unittests From bd15daf239802c719b427887a6bc8ceb3d6b6749 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 19:27:43 +0200 Subject: [PATCH 13/16] . --- .github/workflows/build-wheels.yml | 2 +- .github/workflows/workflow.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 3baf0e854..66a243463 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -31,7 +31,7 @@ jobs: - name: Install dependencies ubuntu if: matrix.os == 'ubuntu-latest' run: | - apt install g++ make cmake build-essential + sudo apt-get install install g++ make cmake build-essential python -m pip install -U pip python -m pip install -U numpy setuptools pybind11 - name: Build and install macos diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 3a6812928..35e106f7d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -50,7 +50,7 @@ jobs: - name: Install dependencies run: | - apt install g++ make cmake build-essential + sudo apt-get install install g++ make cmake build-essential python -m pip install -U pip python -m pip install -U numpy setuptools pybind11 - name: Run unittests From 496d1c3e94d31a75454b19b49f9d52c4ca951d6b Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 19:29:02 +0200 Subject: [PATCH 14/16] . --- .github/workflows/workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 35e106f7d..ae4051afa 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -50,6 +50,7 @@ jobs: - name: Install dependencies run: | + sudo apt-get update sudo apt-get install install g++ make cmake build-essential python -m pip install -U pip python -m pip install -U numpy setuptools pybind11 From 4946db208503f63f2101514db1b53144e9661cc0 Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 19:29:17 +0200 Subject: [PATCH 15/16] build wheels --- .github/workflows/build-wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 66a243463..767589a0b 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -31,6 +31,7 @@ jobs: - name: Install dependencies ubuntu if: matrix.os == 'ubuntu-latest' run: | + sudo apt-get update sudo apt-get install install g++ make cmake build-essential python -m pip install -U pip python -m pip install -U numpy setuptools pybind11 From 5d85cbbc6e7b3d8065581c96acb89a043a0a45af Mon Sep 17 00:00:00 2001 From: johnnynunez Date: Tue, 18 Apr 2023 19:32:15 +0200 Subject: [PATCH 16/16] fix --- .github/workflows/build-wheels.yml | 4 ++-- .github/workflows/workflow.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 767589a0b..5e3861818 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -31,8 +31,8 @@ jobs: - name: Install dependencies ubuntu if: matrix.os == 'ubuntu-latest' run: | - sudo apt-get update - sudo apt-get install install g++ make cmake build-essential + sudo apt-get update && + sudo apt-get install g++ make cmake build-essential python -m pip install -U pip python -m pip install -U numpy setuptools pybind11 - name: Build and install macos diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ae4051afa..8b6f3b526 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -51,7 +51,7 @@ jobs: - name: Install dependencies run: | sudo apt-get update - sudo apt-get install install g++ make cmake build-essential + sudo apt-get install g++ make cmake build-essential python -m pip install -U pip python -m pip install -U numpy setuptools pybind11 - name: Run unittests