From 179a09c49e8eeacb8d65b53a27bdbf7521e55d96 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 19:48:51 +0100 Subject: [PATCH 01/19] Drop 3.7 from test workflows --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 38ceb699..aee92c36 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] runs-on: ${{ matrix.os }} From 8464f7f873f29626ad51bf0b38c3a84297d533cc Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 19:51:41 +0100 Subject: [PATCH 02/19] Add news entry --- docs/releases/upcoming/339.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 docs/releases/upcoming/339.bugfix.rst diff --git a/docs/releases/upcoming/339.bugfix.rst b/docs/releases/upcoming/339.bugfix.rst new file mode 100644 index 00000000..148e390c --- /dev/null +++ b/docs/releases/upcoming/339.bugfix.rst @@ -0,0 +1 @@ +Drop support for Python 3.7. (#339) From 369a083e7a2a7b1e5aaa899efeefb33b0b18cc3c Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 19:57:57 +0100 Subject: [PATCH 03/19] Avoid running on Apple Silicon - pytables is not installable there --- .github/workflows/test-with-pip.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index aee92c36..9afe0d1b 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -8,7 +8,7 @@ jobs: tests: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-13] python-version: ['3.8', '3.9', '3.10', '3.11'] runs-on: ${{ matrix.os }} From e9559b843da9ebd77b18a31f4f483fb71262d4fb Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:01:03 +0100 Subject: [PATCH 04/19] Restrict version of NumPy, which conflicts with the most recent release of PyTables --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 87faf577..930696b8 100644 --- a/setup.py +++ b/setup.py @@ -313,7 +313,7 @@ def get_long_description(): "importlib-resources>=1.1.0; python_version<'3.9'", ], "h5": [ - "numpy", + "numpy < 2.0", "pandas", "tables", ], @@ -328,5 +328,5 @@ def get_long_description(): packages=find_packages(), platforms=["Windows", "Linux", "Mac OS-X", "Unix", "Solaris"], zip_safe=False, - python_requires=">=3.6", + python_requires=">=3.8", ) From e5a35c97fd18c5117e7060bd4208ff66ac8421e2 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:03:02 +0100 Subject: [PATCH 05/19] Be consistent about numpy versions --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 930696b8..c8ed2455 100644 --- a/setup.py +++ b/setup.py @@ -318,7 +318,7 @@ def get_long_description(): "tables", ], "persistence": [ - "numpy", + "numpy < 2.0", ], "preferences": [ "configobj", From bd1a99dc551be1e255aa60b222f3d461f8ae4d01 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:15:38 +0100 Subject: [PATCH 06/19] Drop support for Python 3.6 in etstool.py --- .github/workflows/test-with-edm.yml | 2 +- etstool.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 61a77ee8..fa2f2e35 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: ['ubuntu-latest', 'windows-latest'] - runtime: ['3.6', '3.8'] + runtime: ['3.8'] runs-on: ${{ matrix.os }} steps: diff --git a/etstool.py b/etstool.py index e8c57265..da5c40ee 100644 --- a/etstool.py +++ b/etstool.py @@ -89,7 +89,7 @@ import click #: Supported Python versions. -SUPPORTED_RUNTIMES = ["3.6", "3.8"] +SUPPORTED_RUNTIMES = ["3.8"] #: Default Python version to use. DEFAULT_RUNTIME = "3.8" @@ -108,7 +108,7 @@ def edm_dependencies(runtime): "configobj", "coverage", "importlib_resources>=1.1.0", - "pytables" if runtime == "3.6" else "tables", + "tables", "pandas", "pyface", "enthought_sphinx_theme", From 81b52ed4f1f006c4bdabcdb92ff03b2436a70414 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:19:59 +0100 Subject: [PATCH 07/19] Experiment: attempt to run tests on EDM Python 3.11 --- .github/workflows/test-with-edm.yml | 4 ++-- etstool.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index fa2f2e35..ef0f8a23 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: ['ubuntu-latest', 'windows-latest'] - runtime: ['3.8'] + runtime: ['3.8', '3.11'] runs-on: ${{ matrix.os }} steps: @@ -25,7 +25,7 @@ jobs: - name: Set up bootstrap Python (3.10) uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.12' cache: 'pip' cache-dependency-path: '.github/workflows/bootstrap-requirements.txt' - name: Install necessary packages to the bootstrap environment diff --git a/etstool.py b/etstool.py index b24f0865..0b2bb98e 100644 --- a/etstool.py +++ b/etstool.py @@ -89,7 +89,7 @@ import click #: Supported Python versions. -SUPPORTED_RUNTIMES = ["3.8"] +SUPPORTED_RUNTIMES = ["3.8", "3.11"] #: Default Python version to use. DEFAULT_RUNTIME = "3.8" From 014be0ab6b6b2b50f9c778651b338396628e2b1a Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:20:30 +0100 Subject: [PATCH 08/19] Add dependabot config --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..5ace4600 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" From 999df0c11c284cbf3f46f52b13a94a0078b18246 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:22:05 +0100 Subject: [PATCH 09/19] Update EDM version in workflows --- .github/workflows/ets-from-source.yml | 4 ++-- .github/workflows/test-with-edm.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ets-from-source.yml b/.github/workflows/ets-from-source.yml index b22b04af..9a7aa33c 100644 --- a/.github/workflows/ets-from-source.yml +++ b/.github/workflows/ets-from-source.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: env: - INSTALL_EDM_VERSION: 3.5.0 + INSTALL_EDM_VERSION: 3.7.0 jobs: @@ -36,7 +36,7 @@ jobs: path: ~/.cache key: ${{ runner.os }}-${{ matrix.runtime }}-${{ hashFiles('etstool.py') }} - name: Setup EDM - uses: enthought/setup-edm-action@v2 + uses: enthought/setup-edm-action@v3 with: edm-version: ${{ env.INSTALL_EDM_VERSION }} - name: Install test environment diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index ef0f8a23..0a47d172 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -7,7 +7,7 @@ name: Test with EDM on: [pull_request, workflow_dispatch] env: - INSTALL_EDM_VERSION: 3.5.0 + INSTALL_EDM_VERSION: 3.7.0 jobs: @@ -36,7 +36,7 @@ jobs: path: ~/.cache key: ${{ runner.os }}-${{ matrix.runtime }}-${{ hashFiles('etstool.py') }} - name: Setup EDM - uses: enthought/setup-edm-action@v2 + uses: enthought/setup-edm-action@v3 with: edm-version: ${{ env.INSTALL_EDM_VERSION }} - name: Install test environment From de8e08b8a1305f73128264ccbd5fa44f515657dd Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:29:17 +0100 Subject: [PATCH 10/19] Use rh8-x8_64 for Python 3.11 --- .github/workflows/test-with-pip.yml | 2 +- etstool.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 9afe0d1b..d51165e6 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-13] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] runs-on: ${{ matrix.os }} diff --git a/etstool.py b/etstool.py index 0b2bb98e..69a72e2c 100644 --- a/etstool.py +++ b/etstool.py @@ -178,7 +178,8 @@ def install(edm, runtime, environment, source): edm_packages = ' '.join(edm_dependencies(runtime)) # edm commands to setup the development environment commands = [ - "{edm} environments create {environment} --force --version={runtime}", + "{edm} environments create {environment} --force --version={runtime} " + "--platform={platform}", "{edm} install -y -e {environment} " + edm_packages, ( "{edm} run -e {environment} -- " @@ -477,10 +478,20 @@ def get_parameters(edm, runtime, environment): if edm is None: edm = locate_edm() + if sys.platform.startswith("win32"): + platform = "win-x86_64" + elif sys.platform.startswith("linux"): + platform = "rh7-x86_64" if runtime == "3.8" else "rh8-x86_64" + elif sys.platform.startswith("darwin"): + platform = "osx-x86_64" + else: + raise click.ClickException(f"platform {sys.platform} not supported") + parameters = { 'edm': edm, 'runtime': runtime, 'environment': environment, + 'platform': platform, } if environment is None: parameters['environment'] = 'apptools-test-{runtime}'.format( From e644db210e4aad11957492a068beca06da54b195 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:32:29 +0100 Subject: [PATCH 11/19] Don't include Sphinx or the Enthought Sphinx Theme on Python 3.11 --- etstool.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/etstool.py b/etstool.py index 69a72e2c..3cee3539 100644 --- a/etstool.py +++ b/etstool.py @@ -101,7 +101,7 @@ def edm_dependencies(runtime): Returns a set of requirement strings. """ - return { + dependencies = { "flake8", "flake8_ets", "traitsui", @@ -111,9 +111,10 @@ def edm_dependencies(runtime): "tables", "pandas", "pyface", - "enthought_sphinx_theme", - "sphinx", } + # The Enthought Sphinx Theme is not yet available for Python 3.11 + if runtime == "3.8": + dependencies.update({"enthought_sphinx_theme", "sphinx"}) # Dependencies we install from source for cron tests From 90231f0b427914aba837e1297e9b53ff3d830e43 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:33:37 +0100 Subject: [PATCH 12/19] Fix missing return --- etstool.py | 1 + 1 file changed, 1 insertion(+) diff --git a/etstool.py b/etstool.py index 3cee3539..35cbdba4 100644 --- a/etstool.py +++ b/etstool.py @@ -115,6 +115,7 @@ def edm_dependencies(runtime): # The Enthought Sphinx Theme is not yet available for Python 3.11 if runtime == "3.8": dependencies.update({"enthought_sphinx_theme", "sphinx"}) + return dependencies # Dependencies we install from source for cron tests From 1bf139b3530869e872cf876cabd490d8767ea11f Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:34:55 +0100 Subject: [PATCH 13/19] Move flake8_ets out of depenencies on 3.11 --- etstool.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/etstool.py b/etstool.py index 35cbdba4..e0cc409b 100644 --- a/etstool.py +++ b/etstool.py @@ -103,7 +103,6 @@ def edm_dependencies(runtime): """ dependencies = { "flake8", - "flake8_ets", "traitsui", "configobj", "coverage", @@ -114,7 +113,7 @@ def edm_dependencies(runtime): } # The Enthought Sphinx Theme is not yet available for Python 3.11 if runtime == "3.8": - dependencies.update({"enthought_sphinx_theme", "sphinx"}) + dependencies.update({"enthought_sphinx_theme", "sphinx", "flake8_ets"}) return dependencies From a760bc9b141367a411a595a98e2f81614853b5e5 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:38:43 +0100 Subject: [PATCH 14/19] Streamline dependency calculation --- etstool.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/etstool.py b/etstool.py index e0cc409b..c4d2c556 100644 --- a/etstool.py +++ b/etstool.py @@ -101,20 +101,25 @@ def edm_dependencies(runtime): Returns a set of requirement strings. """ - dependencies = { - "flake8", - "traitsui", + common_dependencies = { "configobj", "coverage", - "importlib_resources>=1.1.0", - "tables", + "flake8", "pandas", "pyface", + "tables", + "traitsui", + } + runtime_specific_dependencies = { + "3.8": { + "enthought_sphinx_theme", + "flake8_ets", + "importlib_resources", + "sphinx", + }, + "3.11": set(), } - # The Enthought Sphinx Theme is not yet available for Python 3.11 - if runtime == "3.8": - dependencies.update({"enthought_sphinx_theme", "sphinx", "flake8_ets"}) - return dependencies + return common_dependencies | runtime_specific_dependencies[runtime] # Dependencies we install from source for cron tests From aa9ec79f42756ad1d8b98b5dd1d7c2fa37dafb2d Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:39:47 +0100 Subject: [PATCH 15/19] Move flake8 into 3.8-only dependencies --- etstool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/etstool.py b/etstool.py index c4d2c556..df1ccda1 100644 --- a/etstool.py +++ b/etstool.py @@ -104,7 +104,6 @@ def edm_dependencies(runtime): common_dependencies = { "configobj", "coverage", - "flake8", "pandas", "pyface", "tables", @@ -112,7 +111,9 @@ def edm_dependencies(runtime): } runtime_specific_dependencies = { "3.8": { + # Most of these are unavailable on Python 3.11 "enthought_sphinx_theme", + "flake8", "flake8_ets", "importlib_resources", "sphinx", From 69bc8504cd1cdf5847df53178649e0d01d237d2c Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:43:10 +0100 Subject: [PATCH 16/19] Only run style checks on 3.8 --- .github/workflows/test-with-edm.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-with-edm.yml b/.github/workflows/test-with-edm.yml index 0a47d172..1abdccc7 100644 --- a/.github/workflows/test-with-edm.yml +++ b/.github/workflows/test-with-edm.yml @@ -41,8 +41,8 @@ jobs: edm-version: ${{ env.INSTALL_EDM_VERSION }} - name: Install test environment run: python etstool.py install --runtime=${{ matrix.runtime }} - - name: Run style checks (only on Linux) + - name: Run style checks (only on Linux, 3.8) run: python etstool.py flake8 --runtime=${{ matrix.runtime }} - if: startsWith(matrix.os, 'ubuntu') + if: startsWith(matrix.os, 'ubuntu') && matrix.runtime == '3.8' - name: Run tests run: python etstool.py test --runtime=${{ matrix.runtime }} From c7d98c6fbe4a6a6c3b7644f55292a30cf1e1359b Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:48:28 +0100 Subject: [PATCH 17/19] Fixing comments --- etstool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/etstool.py b/etstool.py index df1ccda1..6988d7e7 100644 --- a/etstool.py +++ b/etstool.py @@ -111,12 +111,13 @@ def edm_dependencies(runtime): } runtime_specific_dependencies = { "3.8": { - # Most of these are unavailable on Python 3.11 + # Most of these are currently unavailable on Python 3.11; "enthought_sphinx_theme", "flake8", "flake8_ets", - "importlib_resources", "sphinx", + # importlib_resources is not needed on Python 3.11 + "importlib_resources", }, "3.11": set(), } From 88841ad983e9b0720b7f24a0e1afe50fbbad3bba Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 27 Jun 2024 20:56:19 +0100 Subject: [PATCH 18/19] Go back to Apple Silicon, but don't install pytables there --- .github/workflows/test-with-pip.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index d51165e6..bbddbe54 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -8,7 +8,7 @@ jobs: tests: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-13] + os: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] runs-on: ${{ matrix.os }} @@ -20,9 +20,13 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies and local packages - run: | - python -m pip install .[h5,preferences] + - name: Install dependencies and local packages (not macOS) + run: python -m pip install .[h5,preferences] + if: matrix.os != 'macos-latest' + - name: Install dependencies and local packages (macOS) + run: python -m pip install .[preferences] + # tables currently won't build on Apple Silicon + if: matrix.os == 'macos-latest' - name: Run tests run: | mkdir testdir From b873a4f65cd2d214f5dfc040aeabab82bbb524bc Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Fri, 28 Jun 2024 15:50:19 +0100 Subject: [PATCH 19/19] Add issue references --- .github/workflows/test-with-pip.yml | 3 ++- setup.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index bbddbe54..a2ee444d 100644 --- a/.github/workflows/test-with-pip.yml +++ b/.github/workflows/test-with-pip.yml @@ -25,7 +25,8 @@ jobs: if: matrix.os != 'macos-latest' - name: Install dependencies and local packages (macOS) run: python -m pip install .[preferences] - # tables currently won't build on Apple Silicon + # PyTables currently won't build on Apple Silicon, so exclude the h5 deps + # xref: enthought/apptools/issues/344 if: matrix.os == 'macos-latest' - name: Run tests run: | diff --git a/setup.py b/setup.py index d4b8c5e3..cbd412e3 100644 --- a/setup.py +++ b/setup.py @@ -313,6 +313,8 @@ def get_long_description(): "importlib-resources>=1.1.0; python_version<'3.9'", ], "h5": [ + # PyTables is currently incompatible with NumPy 2.0 + # xref: enthought/apptools#345 "numpy < 2.0", "pandas", "tables",