diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index b60c66c1..65b0f1a8 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -90,69 +90,6 @@ jobs: python -m pip install pytest python -m pytest - build-linux-pandas12: - needs: code-checks - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: "3.8" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install "pandas<1.3.0" tableauhyperapi pyarrow - - name: Build extensions - run: | - python setup.py build_ext --inplace - - name: Test with pytest - run: | - python -m pip install pytest - python -m pytest - - build-macos-pandas12: - needs: code-checks - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: "3.8" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install "pandas<1.3.0" tableauhyperapi pyarrow - - name: Build extensions - run: | - python setup.py build_ext --inplace - - name: Test with pytest - run: | - python -m pip install pytest - python -m pytest - - build-windows-pandas12: - needs: code-checks - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: "3.8" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install "pandas<1.3.0" tableauhyperapi pyarrow - - name: Build extensions - run: | - python setup.py build_ext --inplace - - name: Test with pytest - run: | - python -m pip install pytest - python -m pytest - build-linux-hyper-0_0_14567-compat: needs: code-checks runs-on: ubuntu-latest diff --git a/.github/workflows/pythonpublish.yml b/.github/workflows/pythonpublish.yml deleted file mode 100644 index 4623b8ef..00000000 --- a/.github/workflows/pythonpublish.yml +++ /dev/null @@ -1,101 +0,0 @@ -name: Create Platform Wheels - -on: - release: - types: [created, edited] - workflow_dispatch: - -jobs: - deploy-manylinux: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Docker Build - run: | - docker run --rm -e PLAT=manylinux2014_x86_64 -e PYVER=${{ matrix.python-version }} -v `pwd`:/io quay.io/pypa/manylinux2014_x86_64 /io/manylinux_build.sh - ls wheelhouse/ - - name: Install and test wheel - run: | - mkdir temp - cd temp - python -m pip install --upgrade pip - python -m pip install numpy pandas tableauhyperapi pytest # TODO: only pytest - python -m pip install pantab --no-index -f ../wheelhouse - python -c "import pantab; pantab.test()" - cd .. - - name: Upload linux wheel artifact - uses: actions/upload-artifact@v1 - with: - name: ${{ matrix.python-version }}-manylinux - path: wheelhouse - - deploy-macos: - runs-on: macos-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install setuptools wheel tableauhyperapi numpy - - name: Build wheels - run: | - python setup.py bdist_wheel - - name: Install and test wheel - run: | - mkdir temp - cd temp - python -m pip install pandas pytest - python -m pip install pantab --no-index -f ../dist - python -c "import pantab; pantab.test()" - cd .. - - name: Upload linux wheel artifact - uses: actions/upload-artifact@v1 - with: - name: ${{ matrix.python-version }}-macos - path: dist - - deploy-windows: - runs-on: windows-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install setuptools wheel tableauhyperapi numpy - - name: Build wheels - run: | - python setup.py bdist_wheel - - name: Install and test wheel - run: | - mkdir temp - cd temp - python -m pip install pandas "pytest<7.1" - python -m pip install pantab --no-index -f ../dist - python -c "import pantab; pantab.test()" - cd .. - - name: Upload linux wheel artifact - uses: actions/upload-artifact@v1 - with: - name: ${{ matrix.python-version }}-windows - path: dist diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml new file mode 100644 index 00000000..1e266c57 --- /dev/null +++ b/.github/workflows/wheels.yml @@ -0,0 +1,33 @@ +name: Build + +on: [push, pull_request] + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, windows-2019, macOS-11] + + steps: + - uses: actions/checkout@v4 + + # Used to host cibuildwheel + - uses: actions/setup-python@v3 + + - name: Build wheels for ${{ matrix.os }} + uses: pypa/cibuildwheel@v2.16.2 + env: + CIBW_BUILD: "cp39-*64 cp310-*64 cp311-*64 cp312-*64" + CIBW_SKIP: "*musllinux*" + CIBW_TEST_REQUIRES: "pytest" + CIBW_TEST_COMMAND: "pytest {project}/pantab/tests" + # to supply options, put them in 'env', like: + # env: + # CIBW_SOME_OPTION: value + + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl diff --git a/pantab/_compat.py b/pantab/_compat.py index bdfa0a8b..fe03b20b 100644 --- a/pantab/_compat.py +++ b/pantab/_compat.py @@ -1,8 +1,7 @@ -from distutils.version import LooseVersion - import pandas as pd +from pandas.util.version import parse -PANDAS_120 = LooseVersion(pd.__version__) >= LooseVersion("1.2.0") -PANDAS_130 = LooseVersion(pd.__version__) >= LooseVersion("1.3.0") +PANDAS_120 = parse(pd.__version__) >= parse("1.2.0") +PANDAS_130 = parse(pd.__version__) >= parse("1.3.0") __all__ = ["PANDAS_120", "PANDAS_130"] diff --git a/pyproject.toml b/pyproject.toml index 36219566..ccb5e5c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,3 +4,8 @@ requires = ["setuptools", "wheel", "tableauhyperapi", "oldest-supported-numpy"] [tool.towncrier] package = "pantab" filename = "NEWS.rst" + +[tool.pytest.ini_options] +testpaths = [ + "pantab/tests", +]