diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml new file mode 100644 index 00000000..e0c9014c --- /dev/null +++ b/.github/workflows/build_wheels.yml @@ -0,0 +1,76 @@ +name: Build and upload to PyPI + +on: + pull_request: + release: + types: + - published + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-20.04, macos-10.15, windows-2019] + + steps: + - uses: actions/checkout@v2 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.1.3 + + - uses: actions/upload-artifact@v2 + with: + path: ./wheelhouse/*.whl + + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.8' + + - name: Install build dependencies + run: python -m pip install setuptools setuptools-scm wheel Cython numpy scikit-learn + - name: Build sdist + run: python setup.py sdist + + - uses: actions/upload-artifact@v2 + with: + path: dist/*.tar.gz + + upload_testpypi: + needs: [build_wheels, build_sdist] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.4.2 + with: + user: __token__ + password: ${{ secrets.GH_TESTPYPI_UPLOAD }} + repository_url: https://test.pypi.org/legacy/ + + upload_pypi: + needs: [build_wheels, build_sdist, upload_testpypi] + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v2 + with: + name: artifact + path: dist + + - uses: pypa/gh-action-pypi-publish@v1.4.2 + with: + user: __token__ + password: ${{ secrets.GH_PYPI_UPLOAD }} \ No newline at end of file diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5ae58f32..ce0cddb0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,15 +7,19 @@ Changelog ========= -Unreleased ----------- +2.0.2 - 2021-11-03 +------------------ **Bug fix:** - Fixed the sign of the log likelihood of the Gaussian distribution (not used for fitting coefficients). -- Renamed functions checking for qc.matrix compliance to refer to tabmat. - Fixed the wide benchmarks which had duplicated columns (categorical and numerical). +** Other:** + +- The CI now builds the wheels and upload to pypi with every new release. +- Renamed functions checking for qc.matrix compliance to refer to tabmat. + 2.0.1 - 2021-10-11 ------------------ diff --git a/pyproject.toml b/pyproject.toml index b2fcb48f..21d38daa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,3 +27,17 @@ line_length = 88 known_first_party = "glum" skip_glob = '\.eggs/*,\.git/*,\.venv/*,build/*,dist/*' default_section = 'THIRDPARTY' + +[tool.cibuildwheel] +skip = ["cp310-*", "pp*"] +test-requires = ["pytest", "pytest-xdist"] + +[tool.cibuildwheel.macos] +before-all = [ + "brew install llvm libomp", +] + +[tool.cibuildwheel.macos.environment] +LDFLAGS="-L/usr/local/lib" +CXX="/usr/local/opt/llvm/bin/clang++" +CC="/usr/local/opt/llvm/bin/clang" diff --git a/setup.py b/setup.py index ca0dd4a6..c28e3f15 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,13 @@ import os import sys -from os import path import numpy as np from Cython.Build import cythonize from setuptools import Extension, find_packages, setup -here = path.abspath(path.dirname(__file__)) +here = os.path.abspath(os.path.dirname(__file__)) -with open(path.join(here, "README.md"), encoding="utf-8") as f: +with open(os.path.join(here, "README.md"), encoding="utf-8") as f: long_description = f.read() if sys.platform == "win32":