diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ed235e..e9cebfd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,18 +4,21 @@ on: push: branches: - master + - r* + tags: + - '*' pull_request: branches: - master + - r* + release: + types: [published] workflow_dispatch: jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.9", "3.10"] steps: - name: Checkout @@ -24,7 +27,7 @@ jobs: - name: Set up python uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.12" - name: Install python build dependencies run: | @@ -33,23 +36,25 @@ jobs: - name: Build wheels run: | python -m build --wheel --sdist + cd tensorboard_plugin && python -m build --wheel --sdist && cd .. mkdir wheelhouse mv dist/* wheelhouse/ + mv tensorboard_plugin/dist/* wheelhouse/ - name: List and check wheels run: | pip install twine pkginfo>=1.11.0 - ${{ matrix.ls || 'ls -lh' }} wheelhouse/ + ls -lh wheelhouse/ twine check wheelhouse/* - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: wheels-${{ matrix.python-version }} + name: wheels path: ./wheelhouse/* upload_to_pypi: name: Upload to PyPI runs-on: ubuntu-latest - if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags')) || (github.event_name == 'workflow_dispatch') + if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.event_name == 'workflow_dispatch') needs: [build] environment: name: pypi @@ -60,7 +65,7 @@ jobs: - name: Retrieve wheels uses: actions/download-artifact@v4.1.8 with: - merge-multiple: true + name: wheels path: wheels - name: List the build artifacts @@ -70,7 +75,8 @@ jobs: - name: Upload to PyPI uses: pypa/gh-action-pypi-publish@release/v1.12 with: - packages_dir: wheels/ - repository_url: https://pypi.org/legacy/ - verify_metadata: false + password: ${{ secrets.PYPI_API_TOKEN || secrets.PYPI_TOKEN || secrets.PYPI_PASSWORD }} + packages-dir: wheels/ + skip-existing: true + verify-metadata: false verbose: true diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 4b33fe1..e2e6fcb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,10 +20,10 @@ jobs: git config user.email 41898282+github-actions[bot]@users.noreply.github.com if: (github.event_name != 'pull_request') - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' cache: 'pip' cache-dependency-path: | setup.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1648354..7ddf111 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: strategy: matrix: - python-version: ['3.9', '3.10'] + python-version: ['3.10', '3.11', '3.12', '3.13'] package-root-dir: ['./', './tensorboard_plugin'] steps: diff --git a/README.md b/README.md index 30b88cd..dac12da 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ The pip package includes: * [**Tensorflow Data Validation (TFDV)**](https://github.com/tensorflow/data-validation) - analyze the distribution of your dataset * [**Tensorflow Model Analysis (TFMA)**](https://github.com/tensorflow/model-analysis) - analyze model performance * **Fairness Indicators** - an addition to TFMA that adds fairness metrics and easy performance comparison across slices -* **The What-If Tool (WIT)**](https://github.com/PAIR-code/what-if-tool - an interactive visual interface designed to probe your models better +* [**The What-If Tool (WIT)**](https://github.com/PAIR-code/what-if-tool) - an interactive visual interface designed to probe your models better ### Nightly Packages @@ -85,7 +85,8 @@ other *untested* combinations may also work. |fairness-indicators | tensorflow | tensorflow-data-validation | tensorflow-model-analysis | |-------------------------------------------------------------------------------------------|--------------------|----------------------------|---------------------------| -|[GitHub master](https://github.com/tensorflow/fairness-indicators/blob/master/RELEASE.md) | nightly (1.x/2.x) | 1.17.0 | 0.48.0 | +|[GitHub master](https://github.com/tensorflow/fairness-indicators/blob/master/RELEASE.md) | nightly (2.x) | 1.21.0 | 0.52.0 | +|[v0.52.0](https://github.com/tensorflow/fairness-indicators/blob/v0.52.0/RELEASE.md) | 2.21 | 1.21.0 | 0.52.0 | |[v0.48.0](https://github.com/tensorflow/fairness-indicators/blob/v0.48.0/RELEASE.md) | 2.17 | 1.17.0 | 0.48.0 | |[v0.47.0](https://github.com/tensorflow/fairness-indicators/blob/v0.47.0/RELEASE.md) | 2.16 | 1.16.1 | 0.47.1 | |[v0.46.0](https://github.com/tensorflow/fairness-indicators/blob/v0.44.0/RELEASE.md) | 2.15 | 1.15.1 | 0.46.0 | diff --git a/RELEASE.md b/RELEASE.md index ca4f448..b725cd6 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -10,6 +10,29 @@ ## Deprecations +# Version 0.52.0 + +## Major Features and Improvements + +* N/A + +## Bug Fixes and Other Changes + +* Depends on `tensorflow>=2.21,<2.22`. +* Depends on `tensorflow-data-validation>=1.21.0,<1.22.0`. +* Depends on `tensorflow-model-analysis>=0.52.0,<0.53.0`. +* Depends on `protobuf>=6.0.0,<7.0.0`. +* Added conditional NumPy dependency (`numpy>=1.23.5,<2.0.0` for Python < 3.13 and `numpy>=2.1.0` for Python >= 3.13). +* Removed Python 3.9 support and added support for Python 3.10, 3.11, 3.12, and 3.13. + +## Breaking Changes + +* N/A + +## Deprecations + +* N/A + # Version 0.48.0 ## Major Features and Improvements diff --git a/fairness_indicators/example_model_test.py b/fairness_indicators/example_model_test.py index cbc3a8a..582ad7e 100644 --- a/fairness_indicators/example_model_test.py +++ b/fairness_indicators/example_model_test.py @@ -28,6 +28,7 @@ import tensorflow_model_analysis as tfma from google.protobuf import text_format from tensorflow import keras +from tensorflow_model_analysis.proto import config_pb2 as tfma_config from fairness_indicators import example_model @@ -113,7 +114,7 @@ def test_example_model(self): } } """, - tfma.EvalConfig(), + tfma_config.EvalConfig(), ) validate_tf_file_path = self._write_tf_records(data) diff --git a/fairness_indicators/tutorial_utils/util.py b/fairness_indicators/tutorial_utils/util.py index c7d3fd1..a06f38b 100644 --- a/fairness_indicators/tutorial_utils/util.py +++ b/fairness_indicators/tutorial_utils/util.py @@ -22,6 +22,7 @@ import tensorflow as tf import tensorflow_model_analysis as tfma from google.protobuf import text_format +from tensorflow_model_analysis.proto import config_pb2 as tfma_config TEXT_FEATURE = "comment_text" LABEL = "toxicity" @@ -219,7 +220,7 @@ def get_eval_results( slice_selection, "true" if compute_confidence_intervals else "false", ), - tfma.EvalConfig(), + tfma_config.EvalConfig(), ) eval_shared_model = tfma.default_eval_shared_model( diff --git a/fairness_indicators/tutorial_utils/util_test.py b/fairness_indicators/tutorial_utils/util_test.py index 36666c6..1a8f71e 100644 --- a/fairness_indicators/tutorial_utils/util_test.py +++ b/fairness_indicators/tutorial_utils/util_test.py @@ -21,8 +21,8 @@ import pandas as pd import tensorflow as tf -import tensorflow_model_analysis as tfma from google.protobuf import text_format +from tensorflow_model_analysis.proto import config_pb2 as tfma_config from fairness_indicators.tutorial_utils import util @@ -329,7 +329,7 @@ def test_get_eval_results_called_correclty( disabled_outputs{values: "analysis"} } """, - tfma.EvalConfig(), + tfma_config.EvalConfig(), ) mock_run_model_analysis.assert_called_once_with( diff --git a/fairness_indicators/version.py b/fairness_indicators/version.py index 0f30712..9f16838 100644 --- a/fairness_indicators/version.py +++ b/fairness_indicators/version.py @@ -14,4 +14,4 @@ """Contains the version string of Fairness Indicators.""" # Note that setup.py uses this version. -__version__ = "0.49.0.dev" +__version__ = "0.53.0.dev" diff --git a/pyproject.toml b/pyproject.toml index a862155..9f98d56 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,3 +113,4 @@ ignore = [ addopts = "--import-mode=importlib" testpaths = ["fairness_indicators"] python_files = ["*_test.py"] +pythonpath = ["."] diff --git a/setup.py b/setup.py index d01b6b1..27a0120 100644 --- a/setup.py +++ b/setup.py @@ -20,8 +20,8 @@ import setuptools -if sys.version_info >= (3, 11): - sys.exit("Sorry, Python >= 3.11 is not supported") +if sys.version_info >= (3, 14): + sys.exit("Sorry, Python >= 3.14 is not supported") def select_constraint(default, nightly=None, git_master=None): @@ -38,12 +38,14 @@ def select_constraint(default, nightly=None, git_master=None): REQUIRED_PACKAGES = [ - "tensorflow>=2.17,<2.18", + "tensorflow>=2.21,<2.22", "tensorflow-hub>=0.16.1,<1.0.0", - "tensorflow-data-validation>=1.17.0,<2.0.0", - "tensorflow-model-analysis>=0.48.0,<0.49.0", + "tensorflow-data-validation>=1.21.0,<1.22.0", + "tensorflow-model-analysis>=0.52.0,<0.53.0", "witwidget>=1.4.4,<2", - "protobuf>=4.21.6,<6.0.0", + "protobuf>=6.0.0,<7.0.0", + "numpy>=1.23.5,<2.0.0; python_version < '3.13'", + "numpy>=2.1.0; python_version >= '3.13'", ] TEST_PACKAGES = [ @@ -73,7 +75,7 @@ def select_constraint(default, nightly=None, git_master=None): package_data={ "fairness_indicators": ["documentation/*"], }, - python_requires=">=3.9,<4", + python_requires=">=3.10,<4", install_requires=REQUIRED_PACKAGES, tests_require=REQUIRED_PACKAGES, extras_require={"docs": DOCS_PACKAGES, "test": TEST_PACKAGES, "dev": "pre-commit"}, @@ -86,7 +88,10 @@ def select_constraint(default, nightly=None, git_master=None): "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Mathematics", diff --git a/tensorboard_plugin/README.md b/tensorboard_plugin/README.md index d18ce7f..ee0fffe 100644 --- a/tensorboard_plugin/README.md +++ b/tensorboard_plugin/README.md @@ -99,9 +99,10 @@ The following table shows the package versions that are compatible with each other. This is determined by our testing framework, but other *untested* combinations may also work. -|tensorboard-pluginn | tensorflow | tensorflow-model-analysis | +|tensorboard-plugin | tensorflow | tensorflow-model-analysis | |-------------------------------------------------------------------------------------------------------------|---------------|---------------------------| -|[GitHub master](https://github.com/tensorflow/fairness-indicators/blob/master/tensorboard_plugin/README.md) | nightly (2.x) | 0.48.0 | +|[GitHub master](https://github.com/tensorflow/fairness-indicators/blob/master/tensorboard_plugin/README.md) | nightly (2.x) | 0.52.0 | +|[v0.52.0](https://github.com/tensorflow/fairness-indicators/blob/v0.52.0/tensorboard_plugin/README.md) | 2.21.0 | 0.52.0 | |[v0.48.0](https://github.com/tensorflow/fairness-indicators/blob/v0.48.0/tensorboard_plugin/README.md) | 2.17.1 | 0.48.0 | |[v0.47.0](https://github.com/tensorflow/fairness-indicators/blob/v0.47.0/tensorboard_plugin/README.md) | 2.16.2 | 0.47.1 | |[v0.46.0](https://github.com/tensorflow/fairness-indicators/blob/v0.46.0/tensorboard_plugin/README.md) | 2.15.0 | 0.46.0 | diff --git a/tensorboard_plugin/pytest.ini b/tensorboard_plugin/pytest.ini index 61d2b34..a02cf33 100644 --- a/tensorboard_plugin/pytest.ini +++ b/tensorboard_plugin/pytest.ini @@ -2,3 +2,4 @@ addopts = "--import-mode=importlib" testpaths = "tensorboard_plugin_fairness_indicators" python_files = "*_test.py" +pythonpath = . diff --git a/tensorboard_plugin/setup.py b/tensorboard_plugin/setup.py index b19ef09..f61c847 100644 --- a/tensorboard_plugin/setup.py +++ b/tensorboard_plugin/setup.py @@ -19,8 +19,8 @@ from setuptools import find_packages, setup -if sys.version_info >= (3, 11): - sys.exit("Sorry, Python >= 3.11 is not supported") +if sys.version_info >= (3, 14): + sys.exit("Sorry, Python >= 3.14 is not supported") def select_constraint(default, nightly=None, git_master=None): @@ -37,12 +37,14 @@ def select_constraint(default, nightly=None, git_master=None): REQUIRED_PACKAGES = [ - "protobuf>=4.21.6,<6.0.0", - "tensorboard>=2.17.0,<2.18.0", - "tensorflow>=2.17,<2.18", - "tf-keras>=2.17,<2.18", - "tensorflow-model-analysis>=0.48,<0.49", + "protobuf>=6.0.0,<7.0.0", + "tensorboard>=2.21.0,<2.22.0", + "tensorflow>=2.21,<2.22", + "tf-keras>=2.21,<2.22", + "tensorflow-model-analysis>=0.52,<0.53", "werkzeug<2", + "numpy>=1.23.5,<2.0.0; python_version < '3.13'", + "numpy>=2.1.0; python_version >= '3.13'", ] TEST_PACKAGES = [ @@ -76,7 +78,7 @@ def select_constraint(default, nightly=None, git_master=None): "fairness_indicators = tensorboard_plugin_fairness_indicators.plugin:FairnessIndicatorsPlugin", ], }, - python_requires=">=3.9,<4", + python_requires=">=3.10,<4", install_requires=REQUIRED_PACKAGES, tests_require=REQUIRED_PACKAGES, extras_require={ @@ -90,7 +92,10 @@ def select_constraint(default, nightly=None, git_master=None): "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Mathematics", diff --git a/tensorboard_plugin/tensorboard_plugin_fairness_indicators/RELEASE.md b/tensorboard_plugin/tensorboard_plugin_fairness_indicators/RELEASE.md index c47cc78..6d53fa3 100644 --- a/tensorboard_plugin/tensorboard_plugin_fairness_indicators/RELEASE.md +++ b/tensorboard_plugin/tensorboard_plugin_fairness_indicators/RELEASE.md @@ -10,6 +10,29 @@ ## Deprecations +# Version 0.52.0 + +## Major Features and Improvements + +* N/A + +## Bug Fixes and Other Changes + +* Support `tensorflow>=2.21,<2.22` and `tf-keras>=2.21,<2.22`. +* Depends on `tensorboard>=2.21.0,<2.22.0`. +* Depends on `tensorflow-model-analysis>=0.52.0,<0.53.0`. +* Depends on `protobuf>=6.0.0,<7.0.0`. +* Added conditional NumPy dependency (`numpy>=1.23.5,<2.0.0` for Python < 3.13 and `numpy>=2.1.0` for Python >= 3.13). +* Removed Python 3.9 support and added support for Python 3.10, 3.11, 3.12, and 3.13. + +## Breaking Changes + +* N/A + +## Deprecations + +* N/A + # Version 0.48.0 ## Major Features and Improvements diff --git a/tensorboard_plugin/tensorboard_plugin_fairness_indicators/plugin_test.py b/tensorboard_plugin/tensorboard_plugin_fairness_indicators/plugin_test.py index d993580..ff5656c 100644 --- a/tensorboard_plugin/tensorboard_plugin_fairness_indicators/plugin_test.py +++ b/tensorboard_plugin/tensorboard_plugin_fairness_indicators/plugin_test.py @@ -30,6 +30,7 @@ plugin_event_multiplexer as event_multiplexer, ) from tensorboard.plugins import base_plugin +from tensorflow_model_analysis.proto import config_pb2 as tfma_config from tensorflow_model_analysis.utils import example_keras_model from werkzeug import test as werkzeug_test from werkzeug import wrappers @@ -116,7 +117,7 @@ def _make_eval_config(self): } } """, - tfma.EvalConfig(), + tfma_config.EvalConfig(), ) def testRoutes(self): diff --git a/tensorboard_plugin/tensorboard_plugin_fairness_indicators/version.py b/tensorboard_plugin/tensorboard_plugin_fairness_indicators/version.py index dde7818..0c8a741 100644 --- a/tensorboard_plugin/tensorboard_plugin_fairness_indicators/version.py +++ b/tensorboard_plugin/tensorboard_plugin_fairness_indicators/version.py @@ -15,4 +15,4 @@ """Contains the version string of Fairness Indicators Tensorboard Plugin.""" # Note that setup.py uses this version. -__version__ = "0.49.0.dev" +__version__ = "0.53.0.dev"