Skip to content
Snippets Groups Projects
Unverified Commit 5bdcef33 authored by Quoc-Tuan Truong's avatar Quoc-Tuan Truong Committed by GitHub
Browse files

Update CI tools (#509)

parent 1b0515dc
No related branches found
No related tags found
No related merge requests found
build: off
environment:
PYPI_PASSWORD:
secure: cTOEFT9KZZBMDVJgZzi9IpUKnJVxzESacNbQbFraRIA=
matrix:
- PYTHON_VERSION: "3.6"
MINICONDA: "C:\\Miniconda3-x64"
PYTHON_ARCH: "64"
- PYTHON_VERSION: "3.7"
MINICONDA: "C:\\Miniconda3-x64"
PYTHON_ARCH: "64"
platform:
- x64
matrix:
fast_finish: true
init:
- ECHO %PYTHON_VERSION% %MINICONDA%
install:
- set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%
- conda config --set always_yes yes --set changeps1 no
- conda info -a
- conda create -q -n test-environment python=%PYTHON_VERSION% numpy~=1.19.0 scipy Cython
- activate test-environment
- python -m pip install --upgrade pip
- pip install wheel twine pytest
- python --version
- python -c "import struct; print(struct.calcsize('P') * 8)"
- pip install -e .[tests]
test_script:
- python -m pytest --cov=cornac
after_test:
- python setup.py bdist_wheel
- ps: rm dist/*.egg
artifacts:
- path: dist\*
deploy_script:
- echo "Starting Artifact Deployment"
# Make .pypirc file for twine
- echo [distutils] > %USERPROFILE%\\.pypirc
- echo index-servers = >> %USERPROFILE%\\.pypirc
- echo pypi >> %USERPROFILE%\\.pypirc
- echo [pypi] >> %USERPROFILE%\\.pypirc
- echo username=qttruong >> %USERPROFILE%\\.pypirc
- echo password=%PYPI_PASSWORD% >> %USERPROFILE%\\.pypirc
# Upload to PyPI
- set HOME=%USERPROFILE%
- ps: If ($env:APPVEYOR_REPO_TAG -eq "true" -And $env:APPVEYOR_REPO_BRANCH -eq "master") { Invoke-Expression "twine upload --skip-existing dist/*.whl" 2>$null } Else { write-output "Not on a tag on master, won't deploy to pypi"}
- echo "Finished Artifact Deployment"
\ No newline at end of file
version: 2
jobs:
build:
working_directory: ~/cornac
docker:
- image: circleci/python:3.6.9
environment:
PIPENV_VENV_IN_PROJECT: true
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.6/site-packages
- restore_cache:
key: deps9-{{ .Branch }}
- run:
name: Install dependencies
no_output_timeout: 30m
command: |
sudo pip install --upgrade pip
sudo pip install --only-binary=numpy,scipy numpy~=1.19.0 scipy Cython pytest pytest-cov
sudo pip install -e .[tests]
- save_cache:
key: deps9-{{ .Branch }}
paths:
- ".venv"
- "/usr/local/bin"
- "/usr/local/lib/python3.6/site-packages"
- run:
name: Run tests
no_output_timeout: 30m
command: |
python -m pytest --cov=cornac
# codecov is deprecated, need to migrate to new uploader https://docs.codecov.com/docs/codecov-uploader
# codecov || echo "codecov failed"
...@@ -16,8 +16,8 @@ jobs: ...@@ -16,8 +16,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-20.04, macos-10.15, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9] python-version: ["3.8", "3.9", "3.10", "3.11"]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
...@@ -26,17 +26,22 @@ jobs: ...@@ -26,17 +26,22 @@ jobs:
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Brew unlink gcc@9 to avoid build error with OpenMP on MacOS
if: matrix.os == 'macos-10.15'
run: brew unlink gcc@9
- name: Display Python version - name: Display Python version
run: python -c "import sys; print(sys.version)" run: python -c "import sys; print(sys.version)"
- name: Install dependencies - name: Upgrade pip wheel setuptools
run: python -m pip install wheel setuptools pip --upgrade
- name: Install numpy
run: |
python -m pip install numpy==1.24.3
python -c "import numpy; print(numpy.__version__)"
- name: Install other dependencies
run: | run: |
python -m pip install --only-binary=numpy,scipy numpy scipy Cython pytest pytest-cov flake8 python -m pip install scipy Cython pytest pytest-cov flake8
python -m pip install -e .[tests] python -m pip install -e .[tests]
- name: Lint with flake8 - name: Lint with flake8
......
...@@ -19,8 +19,8 @@ jobs: ...@@ -19,8 +19,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-20.04, macos-10.15, windows-latest] os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9] python-version: ["3.8", "3.9", "3.10", "3.11"]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
...@@ -30,22 +30,23 @@ jobs: ...@@ -30,22 +30,23 @@ jobs:
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Brew unlink gcc@9 to avoid build error with OpenMP on MacOS
if: matrix.os == 'macos-10.15'
run: brew unlink gcc@9
- name: Display Python version - name: Display Python version
run: python -c "import sys; print(sys.version)" run: python -c "import sys; print(sys.version)"
- name: Install dependencies - name: Install numpy
run: |
python -m pip install numpy==1.24.3
python -c "import numpy; print(numpy.__version__)"
- name: Install other dependencies
run: | run: |
python -m pip install --only-binary=numpy,scipy numpy scipy Cython wheel python -m pip install scipy Cython wheel
- name: Build wheels - name: Build wheels
run: python setup.py bdist_wheel run: python setup.py bdist_wheel
- name: Rename Linux wheels to supported platform of PyPI - name: Rename Linux wheels to supported platform of PyPI
if: matrix.os == 'ubuntu-20.04' if: matrix.os == 'ubuntu-latest'
run: for f in dist/*.whl; do mv "$f" "$(echo "$f" | sed s/linux/manylinux1/)"; done run: for f in dist/*.whl; do mv "$f" "$(echo "$f" | sed s/linux/manylinux1/)"; done
- name: Publish wheels to GitHub artifacts - name: Publish wheels to GitHub artifacts
...@@ -57,7 +58,7 @@ jobs: ...@@ -57,7 +58,7 @@ jobs:
publish-pypi: publish-pypi:
needs: [build-wheels] needs: [build-wheels]
runs-on: ubuntu-20.04 runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
...@@ -69,14 +70,19 @@ jobs: ...@@ -69,14 +70,19 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: "3.10"
- name: Display Python version - name: Display Python version
run: python -c "import sys; print(sys.version)" run: python -c "import sys; print(sys.version)"
- name: Install dependencies - name: Install numpy
run: |
python -m pip install numpy==1.24.3
python -c "import numpy; print(numpy.__version__)"
- name: Install other dependencies
run: | run: |
python -m pip install --only-binary=numpy,scipy numpy scipy Cython wheel python -m pip install scipy Cython wheel
- name: Build source tar file - name: Build source tar file
run: python setup.py sdist run: python setup.py sdist
......
...@@ -311,10 +311,10 @@ setup( ...@@ -311,10 +311,10 @@ setup(
"Intended Audience :: Education", "Intended Audience :: Education",
"Intended Audience :: Developers", "Intended Audience :: Developers",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: Apache Software License",
"Topic :: Software Development", "Topic :: Software Development",
"Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment