Skip to content

Enable linting in CI #316

Enable linting in CI

Enable linting in CI #316

Workflow file for this run

name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: [push, pull_request]
permissions:
contents: read
jobs:
sdist:
name: Create sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: 3.x
- name: Ubuntu library headers
run: |
sudo apt update
# Keep in sync with "Prerequisites" in User's Guide.
sudo apt install libblosc-dev libbz2-dev libhdf5-dev liblz4-dev liblzo2-dev libsnappy-dev libzstd-dev zlib1g-dev
- name: Source distribution
run: |
pip install build
python -m build --sdist
- name: Save source distribution
uses: actions/upload-artifact@v4
with:
name: tables-sdist
path: dist/*.tar.gz
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install lint dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install flake8
if [ -f requirements-lint.txt ]; then pip install -r requirements-lint.txt; fi
- name: Lint (flake8)
run: |
python -m flake8 --count --show-source --statistics tables
build:
name: ${{ matrix.os }} ${{ matrix.python }} ${{ matrix.numpy }} ${{ matrix.name }}
runs-on: ${{ matrix.os }}
needs: sdist
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
# macos-13 is Intel, macos-latest is Apple Silicon
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
# Keep in sync with ``project.classifiers`` in ``pyproject.toml``.
python: ['3.11', '3.12']
numpy: ['numpy']
include:
- os: ubuntu-latest
python: '3.12'
numpy: 'numpy>=2.2.dev0'
- os: ubuntu-latest
python: '3.12'
numpy: 'numpy<2'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python ${{ matrix.python }}
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python }}
auto-update-conda: true
channels: conda-forge
channel-priority: strict
- name: Install dependencies
run: |
# Keep in sync with
# "Prerequisites" in User's Guide,
# ``build-system.requires`` in ``pyproject.toml``.
conda install -q setuptools pip wheel python-build packaging numpy cython bzip2 hdf5 lzo
python -m pip install --require-hashes -r requirements.txt
python -m pip install --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple '${{ matrix.numpy }}'
# Keep in sync with ``project.optional-dependencies.doc`` in ``pyproject.toml``.
# conda install sphinx sphinx_rtd_theme numpydoc ipython
- name: Get source distribution
uses: actions/download-artifact@v4
with:
name: tables-sdist
- name: Installation
run: |
python -m pip install -v tables-*.tar.gz
- name: 'Run test'
run: |
cd .. && python -m tables.tests.test_all -v
pt2to3 -h
ptrepack -h
ptdump -h
pttree -h
build_cblosc:
name: Sdist with cblosc2
runs-on: ubuntu-latest
needs: sdist
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
channels: conda-forge
channel-priority: strict
- name: Install dependencies
run: |
# Keep in sync with "Prerequisites" in User's Guide,
# ``build-system.requires`` in ``pyproject.toml``.
conda install setuptools pip wheel python-build packaging py-cpuinfo "numpy>=2" cython numexpr bzip2 hdf5 lzo 'typing_extensions>=4.4.0' c-blosc2
- name: Get source distrubtion
uses: actions/download-artifact@v4
with:
name: tables-sdist
- name: Installation
run: |
python -m pip install -v tables-*.tar.gz --no-deps
- name: Python blosc2 wheel or conda pkg is not installed
run: |
! conda list | grep -E '^(python-)?blosc2'
- name: 'Run test'
run: |
cd .. && python -m tables.tests.test_all -v
pt2to3 -h
ptrepack -h
ptdump -h
pttree -h