Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Adding github workflow #1330

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 28 additions & 66 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,21 +33,19 @@ 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
- run:
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
Expand All @@ -56,40 +54,29 @@ 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
- run:
command: |
. .circleci/gcc_test.sh

"gcc6":
"gcc12":
docker:
- image: gcc:6
- image: gcc:12
working_directory: ~/repo
steps:
- checkout
- run:
command: |
. .circleci/gcc_test.sh

"gcc7":
"gcc11":
docker:
- image: gcc:7
- image: gcc:12
working_directory: ~/repo
steps:
- checkout
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"
55 changes: 55 additions & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -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
58 changes: 58 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[metadata]
description-file = README.md
description_file = README.md
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -180,18 +180,17 @@ 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',
'Operating System :: POSIX',
'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'),
Expand Down