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" 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 61a77ee8..1abdccc7 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: @@ -16,7 +16,7 @@ jobs: strategy: matrix: os: ['ubuntu-latest', 'windows-latest'] - runtime: ['3.6', '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 @@ -36,13 +36,13 @@ 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 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 }} diff --git a/.github/workflows/test-with-pip.yml b/.github/workflows/test-with-pip.yml index 38ceb699..a2ee444d 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', '3.12'] runs-on: ${{ matrix.os }} @@ -20,9 +20,14 @@ 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] + # 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: | mkdir testdir 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) diff --git a/etstool.py b/etstool.py index fd57037c..6988d7e7 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", "3.11"] #: Default Python version to use. DEFAULT_RUNTIME = "3.8" @@ -101,19 +101,27 @@ def edm_dependencies(runtime): Returns a set of requirement strings. """ - return { - "flake8", - "flake8_ets", - "traitsui", + common_dependencies = { "configobj", "coverage", - "importlib_resources>=1.1.0", - "pytables" if runtime == "3.6" else "tables", "pandas", "pyface", - "enthought_sphinx_theme", - "sphinx", + "tables", + "traitsui", } + runtime_specific_dependencies = { + "3.8": { + # Most of these are currently unavailable on Python 3.11; + "enthought_sphinx_theme", + "flake8", + "flake8_ets", + "sphinx", + # importlib_resources is not needed on Python 3.11 + "importlib_resources", + }, + "3.11": set(), + } + return common_dependencies | runtime_specific_dependencies[runtime] # Dependencies we install from source for cron tests @@ -178,7 +186,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 +486,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( diff --git a/setup.py b/setup.py index e0d30d49..cbd412e3 100644 --- a/setup.py +++ b/setup.py @@ -313,12 +313,14 @@ def get_long_description(): "importlib-resources>=1.1.0; python_version<'3.9'", ], "h5": [ - "numpy", + # PyTables is currently incompatible with NumPy 2.0 + # xref: enthought/apptools#345 + "numpy < 2.0", "pandas", "tables", ], "persistence": [ - "numpy", + "numpy < 2.0", ], "preferences": [ "configobj", @@ -328,5 +330,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", )