Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor & Cleanup setup.py / setup.cfg #632

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on: [push, pull_request]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]

steps:
- uses: actions/checkout@v2

- name: Build wheels
uses: pypa/cibuildwheel@v2.3.1
# to supply options, put them in 'env', like:
env:
CIBW_ARCHS_MACOS: x86_64 arm64 universal2


- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
100 changes: 100 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Adapted from: https://github.com/alan-turing-institute/sktime/blob/main/.github/workflows/test.yml
name: Lint and Test

on:
push:
branches:
- main
- refactor/setup # Only for testing
pull_request:
branches:
- main

jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Setup Requirements
run: |
python -m pip install -r lint-requirements.txt
- name: Run Linting
run: |
flake8 setup.py lightfm tests
black --check setup.py lightfm tests


test-linux:
needs: linting
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r test-requirements.txt
- name: Install LightFM
run: |
python -m pip install .
- name: Show dependecies
run: python -m pip list
- name: Test with pytest
run: |
mv lightfm lightfm_
python -m pytest
mv lightfm_ lightfm


test-windows:
needs: linting
runs-on: windows-2019
strategy:
matrix:
python-version: [3.7] # , 3.8
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: anaconda, conda-forge

- run: conda --version
- run: which python

- name: Fix windows paths
if: ${{ runner.os == 'Windows' }}
run: echo "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Install conda libpython
run: conda install -c anaconda libpython

- name: Install conda dependencies
run: |
conda install -c conda-forge pip wheel
conda install -c conda-forge --file test-requirements.txt
- name: Install LightFM
run: python -m pip install .

- name: Show dependecies
run: conda list

- name: Run tests
run: |
mv lightfm lightfm_
python -m pytest
mv lightfm_ lightfm


30 changes: 17 additions & 13 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,30 @@ build: false

environment:
matrix:
- PYTHON_VERSION: 2.7
MINICONDA: C:\Miniconda-x64
- PYTHON_VERSION: 3.8
MINICONDA: C:\Miniconda38-x64
- PYTHON_VERSION: 3.7
MINICONDA: C:\Miniconda37-x64

init:
- "ECHO %PYTHON_VERSION% %MINICONDA%"

install:
- "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda create --name lightfm numpy scipy scikit-learn
- activate lightfm

- cmd: "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%"
- cmd: conda config --set always_yes yes --set changeps1 no
- cmd: conda config --add channels conda-forge
- cmd: conda update -q conda
- cmd: conda info -a
- cmd: "conda create -q -n test-environment -c conda-forge python=%PYTHON_VERSION% numpy scipy scikit-learn"
- cmd: activate test-environment
# Install the build dependencies of the project.
- conda install --yes --file test-requirements.txt

- cmd: conda install -c conda-forge --yes --file test-requirements.txt
# Install lightfm
- pip install -e .
- cmd: pip install -e .
# List installed environment
- cmd: python --version
- cmd: conda list

test_script:
# Run the project tests
- py.test tests/ -x
- cmd: pytest tests/