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" diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml new file mode 100644 index 000000000..5e3861818 --- /dev/null +++ b/.github/workflows/build-wheels.yml @@ -0,0 +1,55 @@ +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 -U numpy setuptools pybind11 + - name: Install dependencies ubuntu + if: matrix.os == 'ubuntu-latest' + run: | + 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 + if: matrix.os == 'macOS' + run: | + python -m pip install -U -e .[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 }}-${{matrix.os}}-wheel + path: dist/*.whl + - name: Upload wheel + uses: actions/upload-artifact@v3 + with: + 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..8b6f3b526 --- /dev/null +++ b/.github/workflows/workflow.yml @@ -0,0 +1,58 @@ +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.11 + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: | + ${{ env.pythonLocation }}/lib/python3.11/site-packages + key: ${{ runner.os }}-${{ hashFiles('setup.py') }}-20230418 + + - name: Install dependencies + run: | + 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: Run unittests + run: python runtests.py -u \ No newline at end of file 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 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'),