diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 1bce1342..7f007da8 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -15,21 +15,22 @@ concurrency: jobs: lint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - uses: pre-commit/action@v3.0.0 test: name: test on ${{ matrix.py }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: py: + - '3.11' - '3.10' - '3.9' - '3.8' @@ -40,7 +41,7 @@ jobs: - name: setup python for tox uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: install tox run: python -m pip install tox - name: setup python for test ${{ matrix.py }} @@ -64,7 +65,7 @@ jobs: check: name: check ${{ matrix.tox_env }} - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: @@ -73,10 +74,10 @@ jobs: - dev steps: - uses: actions/checkout@v4 - - name: setup Python 3.10 + - name: setup Python 3.11 uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: install tox run: python -m pip install tox - name: run check for ${{ matrix.tox_env }} @@ -90,7 +91,7 @@ jobs: - name: setup python to build package uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: install build run: python -m pip install build - uses: actions/checkout@v4 @@ -109,7 +110,7 @@ jobs: - name: setup python to build package uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: install build run: python -m pip install build - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b72d8c74..e95c05db 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.1.0 + rev: v4.4.0 hooks: - id: check-ast - id: check-builtin-literals @@ -12,56 +12,52 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/asottile/pyupgrade - rev: v2.29.1 + rev: v3.10.1 hooks: - id: pyupgrade - args: [ "--py36-plus" ] + args: [ "--py37-plus" ] - repo: https://github.com/PyCQA/isort rev: 5.12.0 hooks: - id: isort - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.7.0 hooks: - id: black args: [ --safe ] - repo: https://github.com/asottile/blacken-docs - rev: v1.12.0 + rev: 1.16.0 hooks: - id: blacken-docs - additional_dependencies: [ black==21.12b0 ] - - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + additional_dependencies: [ black==23.7 ] + - repo: https://github.com/tox-dev/pyproject-fmt + rev: "1.1.0" hooks: - - id: rst-backticks + - id: pyproject-fmt + additional_dependencies: ["tox>=4.11"] - repo: https://github.com/tox-dev/tox-ini-fmt - rev: "0.5.1" + rev: "1.3.1" hooks: - id: tox-ini-fmt args: [ "-p", "fix" ] - - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.20.0 - hooks: - - id: setup-cfg-fmt - args: [ --min-py3-version, "3.7", "--max-py-version", "3.10" ] - repo: https://github.com/PyCQA/flake8 - rev: 4.0.1 + rev: 6.1.0 hooks: - id: flake8 additional_dependencies: - - flake8-bugbear==21.11.29 - - flake8-comprehensions==3.7 - - flake8-pytest-style==1.6 - - flake8-unused-arguments==0.0.9 - - flake8-noqa==1.2.1 - - pep8-naming==0.12.1 + - flake8-bugbear==23.7.10 + - flake8-comprehensions==3.14 + - flake8-pytest-style==1.7.2 + - flake8-unused-arguments==0.0.13 + - flake8-noqa==1.3.2 + - pep8-naming==0.13.3 - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.5.1 hooks: - id: mypy exclude: ui-tests-ipw[78]\/.* additional_dependencies: - - "pandas-stubs" - - "types-Pygments" - - "types-colorama" - - "types-setuptools" + - "pandas-stubs>=2.0.3.230814" + - "types-Pygments>=2.16" + - "types-colorama>=0.4.15.12" + - "types-setuptools>=68.1.0.1" diff --git a/ipydatagrid/_version.py b/ipydatagrid/_version.py index ed3880dc..278d88f1 100644 --- a/ipydatagrid/_version.py +++ b/ipydatagrid/_version.py @@ -1,4 +1,4 @@ # Copyright (c) Bloomberg. # Distributed under the terms of the Modified BSD License. -__version__ = "1.1.17" +__version__ = "1.2.0" diff --git a/ipydatagrid/datagrid.py b/ipydatagrid/datagrid.py index 510db227..f6987c91 100644 --- a/ipydatagrid/datagrid.py +++ b/ipydatagrid/datagrid.py @@ -512,7 +512,8 @@ def get_dataframe_index(self, dataframe): return "key" def get_cell_value(self, column_name, primary_key_value): - """Gets the value for a single or multiple cells by column name and index name. + """Gets the value for a single or multiple cells by column name and + index name. Tuples should be used to index into multi-index columns.""" row_indices = self._get_row_index_of_primary_key(primary_key_value) diff --git a/package.json b/package.json index 9828a83d..6a4ebecf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ipydatagrid", - "version": "1.1.17", + "version": "1.2.0", "description": "Fast Datagrid widget for the Jupyter Notebook and JupyterLab", "keywords": [ "jupyter", diff --git a/pyproject.toml b/pyproject.toml index 665a0857..a3079d6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,71 +1,57 @@ [build-system] +build-backend = "hatchling.build" requires = [ - "hatchling", - "jupyterlab~=4.0", + "hatchling>=1.18", + "jupyterlab>=4.0.5", ] -build-backend = "hatchling.build" [project] name = "ipydatagrid" +version = "1.2.0" description = "Fast Datagrid widget for the Jupyter Notebook and JupyterLab" readme = "README.md" -requires-python = ">=3.7" +keywords = [ + "IPython", + "Jupyter", + "Widgets", +] authors = [ { name = "Bloomberg" }, ] -keywords = [ - "IPython", - "Jupyter", - "Widgets", -] +requires-python = ">=3.7" classifiers = [ - "Framework :: Jupyter", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", + "Framework :: Jupyter", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", ] dependencies = [ - "bqplot>=0.11.6", - "ipywidgets>=7.6.0,<9", - "pandas", - "py2vega>=0.5.0", + "bqplot>=0.11.6", + "ipywidgets<9,>=7.6", + "pandas>=2.1", + "py2vega>=0.5", ] -version = "1.1.17" - -[project.license] -file = "LICENSE.txt" - -[project.optional-dependencies] -test = [ - "nbval>=0.9", - "pandas<=1.3.5", - "pytest-cov>=3", - "pytest>=6", +optional-dependencies.test = [ + "nbval>=0.10", + "pytest>=7.4", + "pytest-cov>=4.1", ] - -[project.urls] -Homepage = "https://github.com/bloomberg/ipydatagrid" +urls.Homepage = "https://github.com/bloomberg/ipydatagrid" +project.license = {file = "LICENSE.txt"} [tool.hatch.build] artifacts = [ "ipydatagrid/nbextension/index.*", "ipydatagrid/labextension", ] - -[tool.hatch.build.targets.wheel.shared-data] -"ipydatagrid/nbextension" = "share/jupyter/nbextensions/ipydatagrid" -"ipydatagrid/labextension" = "share/jupyter/labextensions/ipydatagrid" -"ipydatagrid.json" = "etc/jupyter/nbconfig/notebook.d/ipydatagrid.json" - -[tool.hatch.build.targets.sdist] -exclude = [ +targets.sdist.exclude = [ ".github", "examples", "tests", @@ -82,6 +68,11 @@ exclude = [ "jest*", ] +[tool.hatch.build.targets.wheel.shared-data] +"ipydatagrid/nbextension" = "share/jupyter/nbextensions/ipydatagrid" +"ipydatagrid/labextension" = "share/jupyter/labextensions/ipydatagrid" +"ipydatagrid.json" = "etc/jupyter/nbconfig/notebook.d/ipydatagrid.json" + [tool.hatch.build.hooks.jupyter-builder] ensured-targets = [ "ipydatagrid/nbextension/index.js", @@ -99,6 +90,10 @@ npm = [ "jlpm", ] +[tool.black] +line-length = 80 +exclude = "/(\n \\.eggs\n | \\.git\n | \\.hg\n | \\.mypy_cache\n | \\.tox\n | \\.venv\n | _build\n | buck-out\n | build\n | dist\n)/\n" + [tool.isort] profile = "black" known_first_party = [ @@ -113,10 +108,6 @@ disable = "C0330, C0326" [tool.pylint.format] max-line-length = "80" -[tool.black] -line-length = 80 -exclude = "/(\n \\.eggs\n | \\.git\n | \\.hg\n | \\.mypy_cache\n | \\.tox\n | \\.venv\n | _build\n | buck-out\n | build\n | dist\n)/\n" - [tool.tbump] field = [ { name = "channel", default = "" }, @@ -124,7 +115,7 @@ field = [ ] [tool.tbump.version] -current = "1.1.17" +current = "1.2.0" regex = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)((?Pa|b|rc|.dev)(?P\\d+))?" [tool.tbump.git] diff --git a/tox.ini b/tox.ini index 47e86231..05f161a2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,34 +1,34 @@ [tox] -envlist = +requires = + tox>=4.2 +env_list = fix + py311 py310 py39 py38 py37 - py36 pypy3 docs pkg_desc -isolated_build = true skip_missing_interpreters = true -minversion = 3.7 [testenv] +package = wheel +wheel_build_env = .pkg extras = test commands = pytest {tty:--color=yes} tests pytest --nbval examples -package = wheel -wheel_build_env = .pkg [testenv:fix] description = format the code base to adhere to our styles, and complain about what we cannot do automatically -passenv = - PROGRAMDATA skip_install = true deps = - pre-commit>=2 + pre-commit>=3.3.3 +pass_env = + PROGRAMDATA commands = pre-commit run --all-files --show-diff-on-failure @@ -36,15 +36,15 @@ commands = description = check that the long description is valid skip_install = true deps = - build[virtualenv]>=0.7 - twine>=3.7 + build[virtualenv]>=1 + twine>=4.0.2 commands = python -m build --sdist --wheel . -o {envtmpdir} twine check {envtmpdir}/* [testenv:dev] description = dev environment with all deps at {envdir} -usedevelop = true +package = editable extras = dev test