From c8d8ee36499b1365f80508c874748b197ba64e4b Mon Sep 17 00:00:00 2001 From: Nate Parsons <4307001+thehomebrewnerd@users.noreply.github.com> Date: Fri, 23 Feb 2024 11:21:14 -0600 Subject: [PATCH] Update release.yaml to use trusted publisher approach (#269) * update release.yaml * update release notes * update python versions * restrict tensorflow-hub * cleanup * lint fix --- .../entry_point_with_latest_deps.yml | 2 +- .github/workflows/install_test.yml | 2 +- .../workflows/latest_dependency_checker.yml | 4 +-- .github/workflows/optional_primitive_test.yml | 2 +- .github/workflows/release.yaml | 26 ++++++++++++------- .../workflows/unit_tests_with_latest_deps.yml | 8 +++--- nlp_primitives/tests/test_utils.py | 15 ++--------- pyproject.toml | 6 ++--- release_notes.rst | 14 ++++++++++ 9 files changed, 44 insertions(+), 35 deletions(-) diff --git a/.github/workflows/entry_point_with_latest_deps.yml b/.github/workflows/entry_point_with_latest_deps.yml index d417756d..6b8220d1 100644 --- a/.github/workflows/entry_point_with_latest_deps.yml +++ b/.github/workflows/entry_point_with_latest_deps.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ["3.8", "3.9", "3.10"] + python_version: ["3.9", "3.10", "3.11"] featuretools_version: ["Release", "Main"] steps: - name: Set up python ${{ matrix.python_version }} diff --git a/.github/workflows/install_test.yml b/.github/workflows/install_test.yml index df1c81b2..b1a36bb3 100644 --- a/.github/workflows/install_test.yml +++ b/.github/workflows/install_test.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python_version: ["3.8", "3.9", "3.10"] + python_version: ["3.9", "3.10", "3.11"] exclude: - python_version: "3.10" os: macos-latest diff --git a/.github/workflows/latest_dependency_checker.yml b/.github/workflows/latest_dependency_checker.yml index 7cba92b8..c60363c2 100644 --- a/.github/workflows/latest_dependency_checker.yml +++ b/.github/workflows/latest_dependency_checker.yml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - name: Set up Python 3.11 uses: actions/setup-python@v2 with: - python-version: '3.8.x' + python-version: '3.11.x' - name: Install pip and virtualenv run: | python -m pip install --upgrade pip diff --git a/.github/workflows/optional_primitive_test.yml b/.github/workflows/optional_primitive_test.yml index fde0e6c3..a4752b6e 100644 --- a/.github/workflows/optional_primitive_test.yml +++ b/.github/workflows/optional_primitive_test.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ["3.8", "3.9", "3.10"] + python_version: ["3.9", "3.10", "3.11"] featuretools_version: ["Release", "Main"] steps: - name: Set up python ${{ matrix.python_version }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 483e8a46..8ab77313 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,17 +6,23 @@ jobs: pypi: name: PyPI Release runs-on: ubuntu-latest + permissions: + id-token: write steps: - - uses: actions/checkout@v3 - - name: Remove docs before release - run: rm -rf docs/ - - name: PyPI Upload - uses: FeatureLabs/gh-action-pypi-upload@v2 - env: - PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} - PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - TEST_PYPI_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} - TEST_PYPI_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install deps + run: | + python -m pip install --quiet --upgrade pip + python -m pip install --quiet --upgrade build + python -m pip install --quiet --upgrade setuptools + - name: Remove build artifacts and docs + run: | + rm -rf .eggs/ dist/ build/ docs/ + - name: Build distribution + run: python -m build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 - name: Run workflow to create feedstock pull request run: | gh workflow run create_feedstock_pr.yaml --repo "alteryx/nlp_primitives" -f version=${{ github.event.release.tag_name }} diff --git a/.github/workflows/unit_tests_with_latest_deps.yml b/.github/workflows/unit_tests_with_latest_deps.yml index 87fa5fe0..8d68c9e1 100644 --- a/.github/workflows/unit_tests_with_latest_deps.yml +++ b/.github/workflows/unit_tests_with_latest_deps.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python_version: ["3.8", "3.9", "3.10"] + python_version: ["3.9", "3.10", "3.11"] featuretools_version: ["release", "main"] steps: - name: Set up python ${{ matrix.python_version }} @@ -40,15 +40,15 @@ jobs: run: | make installdeps-complete make installdeps-test - - if: ${{ matrix.python_version != 3.8 || matrix.featuretools_version != 'main' }} + - if: ${{ matrix.python_version != 3.9 || matrix.featuretools_version != 'main' }} name: Run unit tests with no code coverage run: | make test - - if: ${{ matrix.python_version == 3.8 && matrix.featuretools_version == 'main' }} + - if: ${{ matrix.python_version == 3.9 && matrix.featuretools_version == 'main' }} name: Run unit tests with code coverage run: | pytest nlp_primitives/ --cov=nlp_primitives/ --cov-config=pyproject.toml --cov-report=xml:coverage.xml - - if: ${{ matrix.python_version == 3.8 && matrix.featuretools_version == 'main' }} + - if: ${{ matrix.python_version == 3.9 && matrix.featuretools_version == 'main' }} name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: diff --git a/nlp_primitives/tests/test_utils.py b/nlp_primitives/tests/test_utils.py index cedbeffe..c5437ab1 100644 --- a/nlp_primitives/tests/test_utils.py +++ b/nlp_primitives/tests/test_utils.py @@ -1,10 +1,4 @@ -# -*- coding: utf-8 -*- -try: - # python 3 - from inspect import signature -except ImportError: - # python 2 - from funcsigs import signature +from inspect import signature import featuretools as ft import pytest @@ -51,12 +45,7 @@ def test_name_in_primitive_list(self): assert PRIMITIVES.name.eq(self.primitive.name).any() def test_arg_init(self): - try: - primitive_ = self.primitive() - except TypeError: - # primitive requires an argument - # ex. CountString needs an input string to search - return + primitive_ = self.primitive() # determine the optional arguments in the __init__ init_params = signature(self.primitive.__init__) for name, parameter in init_params.parameters.items(): diff --git a/pyproject.toml b/pyproject.toml index cbf59df9..35e5f03d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,9 +18,9 @@ classifiers = [ "Topic :: Scientific/Engineering", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", @@ -34,7 +34,7 @@ maintainers = [ ] keywords = ["feature engineering", "data science", "machine learning", "natural language processing"] license = {text = "BSD 3-clause"} -requires-python = ">=3.8,<4" +requires-python = ">=3.9,<4" dependencies = [ "numpy >= 1.17.5", "pandas >= 1.3.0", @@ -67,7 +67,7 @@ complete = [ "tensorflow >= 1.14.0; sys_platform!='darwin' or platform_machine!='arm64'", "tensorflow-metal >= 0.4.0; sys_platform=='darwin' and platform_machine=='arm64'", "tensorflow-macos >= 2.8.0; sys_platform=='darwin' and platform_machine=='arm64'", - "tensorflow_hub >= 0.4.0", + "tensorflow_hub >= 0.4.0, < 0.16.0", ] [project.entry-points."featuretools_plugin"] diff --git a/release_notes.rst b/release_notes.rst index a5f125a8..af811348 100644 --- a/release_notes.rst +++ b/release_notes.rst @@ -2,6 +2,20 @@ Changelog ========= +Future Release +============== + .. warning:: + This release of nlp-primitives will not support Python 3.8 + + * Fixes + * Changes + * Remove support for Python 3.8 and add support for 3.11 (:pr:`269`) + * Testing Changes + * Update ``release.yaml`` to use trusted publisher for PyPI releases (:pr:`269`) + + Thanks to the following people for contributing to this release: + :user:`thehomebrewnerd` + v2.11.0 Apr 13, 2023 ==================== * Fixes