diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index ee363fa..8659823 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: - python-version: "3.9" + python-version: "3.10" - name: Install Dependencies run: | diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 15ba9b5..1785c63 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: "3.9" + python-version: "3.10" - name: Install dependencies run: python3 -m pip install --upgrade build @@ -44,7 +44,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: "3.9" + python-version: "3.10" - name: Install twine run: python3 -m pip install --upgrade twine @@ -75,7 +75,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: "3.9" + python-version: "3.10" - name: Install twine run: python3 -m pip install --upgrade twine diff --git a/formulae/utils.py b/formulae/utils.py index 5c10f0e..2feccc1 100644 --- a/formulae/utils.py +++ b/formulae/utils.py @@ -3,6 +3,8 @@ import numpy as np import pandas as pd +from packaging.version import Version + def listify(obj): """Wrap all non-list or tuple objects in a list. @@ -44,7 +46,7 @@ def get_interaction_matrix(x, y): def is_categorical_dtype(arr_or_dtype): """Check whether an array-like or dtype is of the pandas Categorical dtype.""" # https://pandas.pydata.org/docs/whatsnew/v2.1.0.html#other-deprecations - if pd.__version__ < "2.1.0": + if Version(pd.__version__) < Version("2.1.0"): return pd.api.types.is_categorical_dtype(arr_or_dtype) else: if hasattr(arr_or_dtype, "dtype"): # it's an array diff --git a/pyproject.toml b/pyproject.toml index 1392982..4778ffe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ requires = ["setuptools>=61.0", "setuptools_scm>=8"] [project] name = "formulae" description = "Formulas for mixed-effects models in Python" -requires-python = ">=3.7" +requires-python = ">=3.8" readme = {file = "README.md", content-type = "text/markdown"} license = {file = "LICENSE"} dynamic = ["version"] @@ -15,6 +15,7 @@ maintainers = [{ name = "Tomás Capretto", email = "tomicapretto@gmail.com" }] dependencies = [ "numpy>=1.16", + "packaging", "pandas>=1.0.0", "scipy>=1.5.4" ]