From c5da6d88d93737c35e1645a284f5adcfd4a682a7 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Tue, 18 May 2021 16:17:49 +0300 Subject: [PATCH 1/5] migrate to GitHub Actions --- .github/workflows/main.yml | 68 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 25 -------------- README.rst | 9 ++--- appveyor.yml | 66 ------------------------------------ 4 files changed, 71 insertions(+), 97 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..6d9e8f51 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,68 @@ +name: Package tests + +on: + push: + branches: + - github_actions + pull_request: + branches: + - master + +jobs: + test: + name: ${{ matrix.os }}, Python ${{ matrix.python_version }} (${{ matrix.python_arch }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python_version: + - '3.6' + - '3.7' + - '3.8' + - '3.9' + python_arch: + - x64 + include: + - os: windows-latest + python_version: '3.6' + python_arch: x86 + - os: windows-latest + python_version: '3.7' + python_arch: x86 + - os: windows-latest + python_version: '3.8' + python_arch: x86 + - os: windows-latest + python_version: '3.9' + python_arch: x86 + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 3 + - name: Install Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python_version }} + architecture: ${{ matrix.python_arch }} + - name: Check Python version + shell: python + run: | + import struct + import sys + + assert sys.version_info[:2] == tuple(map(int, "${{ matrix.python_version }}".split("."))) + assert f"x{struct.calcsize('P') * 8}".replace("32", "86") == "${{ matrix.python_arch }}" + - name: Install package + run: | + python -m pip install --upgrade pip + pip install -r requirements_build.txt -r requirements_test.txt + python setup.py build + python setup.py install + - name: Run tests + run: pytest -v --pyargs lightning diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c35efb10..00000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: generic - -env: - matrix: - - PYTHON_VERSION=3.6 - - PYTHON_VERSION=3.7 - - PYTHON_VERSION=3.8 - - PYTHON_VERSION=3.9 - -install: - - wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda update -q conda - # Useful for debugging any issues with conda - - conda info -a - - - conda create -q -n test-environment python=$PYTHON_VERSION numpy scipy pytest cython scikit-learn joblib - - source activate test-environment - - make all - -script: - - pytest -v --pyargs lightning diff --git a/README.rst b/README.rst index c2642f9f..f7b73600 100644 --- a/README.rst +++ b/README.rst @@ -1,10 +1,7 @@ .. -*- mode: rst -*- -.. image:: https://travis-ci.org/scikit-learn-contrib/lightning.svg?branch=master - :target: https://travis-ci.org/scikit-learn-contrib/lightning - -.. image:: https://ci.appveyor.com/api/projects/status/mmm0llccmvn5iooq?svg=true - :target: https://ci.appveyor.com/project/fabianp/lightning/branch/master +.. image:: https://github.com/scikit-learn-contrib/lightning/actions/workflows/main.yml/badge.svg?branch=master + :target: https://github.com/scikit-learn-contrib/lightning/actions/workflows/main.yml .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.200504.svg :target: https://doi.org/10.5281/zenodo.200504 @@ -66,7 +63,7 @@ penalty on the News20 dataset (c.f., `Blondel et al. 2013 Dependencies ------------ -lightning requires Python >= 3.6, setuptools, Numpy >= 1.12, SciPy >= 0.19 and +lightning requires Python >= 3.6, setuptools, Joblib, Numpy >= 1.12, SciPy >= 0.19 and scikit-learn >= 0.19. Building from source also requires Cython and a working C/C++ compiler. To run the tests you will also need pytest. Installation diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 4f47661f..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,66 +0,0 @@ -# AppVeyor.com is a Continuous Integration service to build and run tests under -# Windows - -image: Visual Studio 2019 - -# Not a .NET project, we build scikit-learn in the install step instead -build: false - -environment: - matrix: - - PYTHON: "C:\\Python36" - PYTHON_VERSION: "3.6.8" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python36-x64" - PYTHON_VERSION: "3.6.8" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python37" - PYTHON_VERSION: "3.7.5" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python37-x64" - PYTHON_VERSION: "3.7.5" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python38" - PYTHON_VERSION: "3.8.7" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python38-x64" - PYTHON_VERSION: "3.8.7" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python39" - PYTHON_VERSION: "3.9.1" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python39-x64" - PYTHON_VERSION: "3.9.1" - PYTHON_ARCH: "64" - - -install: - # Miniconda is pre-installed in the worker build - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PYTHON%\\Library\\mingw-w64\\bin;%PYTHON%\\Library\\bin;%PYTHON%\\Library\\usr\\bin;%PATH%" - - "python -m pip install -U pip" - - # Check that we have the expected version and architecture for Python - - "python --version" - - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" - - "python -m pip --version" - - - "python -m pip install --timeout=60 numpy scipy cython pytest scikit-learn wheel joblib" - - "python setup.py bdist_wheel bdist_wininst" - - - ps: "ls dist" - # Install the generated wheel package to test it - - "python -m pip install --pre --no-index --find-links dist/ sklearn-contrib-lightning" - -test_script: - - "pytest -v --pyargs lightning" - -artifacts: - # Archive the generated wheel package in the ci.appveyor.com build report. - - path: dist\* From 340aa6aff902c472ab6b60c7226a07d26f4996d5 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Thu, 20 May 2021 16:31:00 +0300 Subject: [PATCH 2/5] fail test --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d9e8f51..7da599ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,7 +57,7 @@ jobs: import sys assert sys.version_info[:2] == tuple(map(int, "${{ matrix.python_version }}".split("."))) - assert f"x{struct.calcsize('P') * 8}".replace("32", "86") == "${{ matrix.python_arch }}" + assert f"x{struct.calcsize('P') * 8}".replace("32", "87") == "${{ matrix.python_arch }}" - name: Install package run: | python -m pip install --upgrade pip From ab23162e8b9af46d53fb062e893a0df6425f0800 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Thu, 20 May 2021 16:46:03 +0300 Subject: [PATCH 3/5] Revert "fail test" This reverts commit 340aa6aff902c472ab6b60c7226a07d26f4996d5. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7da599ed..6d9e8f51 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,7 +57,7 @@ jobs: import sys assert sys.version_info[:2] == tuple(map(int, "${{ matrix.python_version }}".split("."))) - assert f"x{struct.calcsize('P') * 8}".replace("32", "87") == "${{ matrix.python_arch }}" + assert f"x{struct.calcsize('P') * 8}".replace("32", "86") == "${{ matrix.python_arch }}" - name: Install package run: | python -m pip install --upgrade pip From c5b8051492520baec50c20b601d68219af0fe2c2 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Thu, 20 May 2021 16:47:06 +0300 Subject: [PATCH 4/5] simplify installation process --- .github/workflows/gh_pages.yml | 1 - .github/workflows/main.yml | 1 - MANIFEST.in | 1 + README.rst | 3 +-- 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml index a7101bd3..e1eff7e8 100644 --- a/.github/workflows/gh_pages.yml +++ b/.github/workflows/gh_pages.yml @@ -20,7 +20,6 @@ jobs: - name: Install package run: | pip install -r requirements_build.txt - python setup.py build python setup.py install - name: Build docs run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6d9e8f51..2c31fed1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,7 +62,6 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements_build.txt -r requirements_test.txt - python setup.py build python setup.py install - name: Run tests run: pytest -v --pyargs lightning diff --git a/MANIFEST.in b/MANIFEST.in index bfa52e1f..899995cb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include MANIFEST.in include Makefile +include requirements*.txt recursive-include lightning *.c *.h *.cpp *.pyx *.pxd diff --git a/README.rst b/README.rst index f7b73600..53f346b7 100644 --- a/README.rst +++ b/README.rst @@ -87,8 +87,7 @@ The development version of lightning can be installed from its git repository. I git clone https://github.com/scikit-learn-contrib/lightning.git cd lightning - python setup.py build - sudo python setup.py install + python setup.py install Documentation ------------- From 82669b46565512910d6b7ceb8b15a8a20cca5bab Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Thu, 20 May 2021 17:45:08 +0300 Subject: [PATCH 5/5] master branch --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c31fed1..3afe8bdb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Package tests on: push: branches: - - github_actions + - master pull_request: branches: - master