From 380c4d0f4386cf464dded1979c665e4173969467 Mon Sep 17 00:00:00 2001 From: Simon Boehm Date: Sun, 10 Jul 2022 11:29:38 +0200 Subject: [PATCH 1/3] Test py3.10 on CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea4f8f2..9303ea8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - PYTHON_VERSION: ["3.7", "3.9"] + PYTHON_VERSION: ["3.7", "3.10"] steps: - uses: actions/checkout@v2 - name: Setup conda cache From 6751999750105eaf72b4f1033e404a916659c6bf Mon Sep 17 00:00:00 2001 From: Simon Boehm Date: Sun, 10 Jul 2022 11:34:48 +0200 Subject: [PATCH 2/3] Bump black pre-commit hook --- .pre-commit-config.yaml | 2 +- lleaves/lleaves.py | 2 +- tests/test_categoricals.py | 2 +- tests/test_tree_output.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b5388ec..3749db9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.6.0 hooks: - id: black language_version: python3 diff --git a/lleaves/lleaves.py b/lleaves/lleaves.py index 5a2956c..6a7a448 100644 --- a/lleaves/lleaves.py +++ b/lleaves/lleaves.py @@ -159,7 +159,7 @@ def predict(self, data, n_jobs=os.cpu_count()): f"Data must be of dimension (N, {self.num_feature()}), is {data.shape}." ) # protect against `ctypes.c_int32` silently overflowing and causing SIGSEGV - if n_predictions >= 2 ** 31 - 1: + if n_predictions >= 2**31 - 1: raise ValueError( "Prediction is not supported for datasets with >=2^31-1 rows. " "Split the dataset into smaller chunks first." diff --git a/tests/test_categoricals.py b/tests/test_categoricals.py index 5202ea8..e6e82ce 100644 --- a/tests/test_categoricals.py +++ b/tests/test_categoricals.py @@ -195,7 +195,7 @@ def test_categorical_prediction_llvm_real(data, categorical_model_txt): input = data.draw( st.lists( - st.integers(min_value=0, max_value=2 ** 31 - 2), + st.integers(min_value=0, max_value=2**31 - 2), max_size=llvm_model.num_feature(), min_size=llvm_model.num_feature(), ) diff --git a/tests/test_tree_output.py b/tests/test_tree_output.py index de23c60..18f461a 100644 --- a/tests/test_tree_output.py +++ b/tests/test_tree_output.py @@ -104,7 +104,7 @@ def test_forest_llvm_mode_cat(data, llvm_lgbm_model_cat): input_cats = data.draw( st.lists( - st.integers(min_value=0, max_value=2 ** 31 - 2), + st.integers(min_value=0, max_value=2**31 - 2), min_size=sum(cat_bitvec), max_size=sum(cat_bitvec), ) From 4638d0dd3ec715d672384377f1613a67a298ea13 Mon Sep 17 00:00:00 2001 From: Simon Boehm Date: Sun, 10 Jul 2022 11:44:58 +0200 Subject: [PATCH 3/3] Bump all Github actions --- .github/workflows/ci.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9303ea8..b4f58e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,9 +13,9 @@ jobs: matrix: PYTHON_VERSION: ["3.7", "3.10"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup conda cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/conda_pkgs_dir key: @@ -30,7 +30,7 @@ jobs: use-only-tar-bz2: true use-mamba: true - name: Setup hypothesis DB cache - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ./.hypothesis key: hypothesisDB ${{ matrix.PYTHON_VERSION }} @@ -39,7 +39,7 @@ jobs: run: ./.github/ci.sh ${{ matrix.PYTHON_VERSION }} - name: Publish a Python distribution to PyPI if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.PYTHON_VERSION == '3.7' - uses: pypa/gh-action-pypi-publish@v1.4.2 + uses: pypa/gh-action-pypi-publish@v1.5.0 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} @@ -49,12 +49,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout branch - uses: actions/checkout@v2.1.0 - with: - ref: ${{ github.head_ref }} + uses: actions/checkout@v3 - name: Install Python 3.9 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 - name: Run pre-commit checks - uses: pre-commit/action@v2.0.0 + uses: pre-commit/action@v3.0.0