From 68a4b2e4e46f6664980f0f96d3b9a68ba7198eb7 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 2 May 2023 19:28:24 +0200 Subject: GitHub Actions: do not install six in CI (#37361) * GitHub Actions: do not install six in CI * Remove workflow code that was commented out * Remove any use of "six" from packages --- .github/workflows/audit.yaml | 2 +- .github/workflows/unit_tests.yaml | 8 +-- .github/workflows/valid-style.yml | 2 +- .github/workflows/windows_python.yml | 81 +--------------------- .../builtin.mock/packages/multimethod/package.py | 4 +- .../repos/builtin.mock/packages/raiser/package.py | 2 +- .../repos/builtin/packages/dataspaces/package.py | 5 +- .../repos/builtin/packages/pythia6/package.py | 11 ++- var/spack/repos/builtin/packages/rust/package.py | 8 +-- 9 files changed, 19 insertions(+), 104 deletions(-) diff --git a/.github/workflows/audit.yaml b/.github/workflows/audit.yaml index 062e91b0f7..bdff71220b 100644 --- a/.github/workflows/audit.yaml +++ b/.github/workflows/audit.yaml @@ -25,7 +25,7 @@ jobs: python-version: ${{inputs.python_version}} - name: Install Python packages run: | - pip install --upgrade pip six setuptools pytest coverage[toml] + pip install --upgrade pip setuptools pytest coverage[toml] - name: Package audits (with coverage) if: ${{ inputs.with_coverage == 'true' }} run: | diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 628cab9749..3a37dc7984 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -62,7 +62,7 @@ jobs: cmake bison libbison-dev kcov - name: Install Python packages run: | - pip install --upgrade pip six setuptools pytest pytest-xdist pytest-cov + pip install --upgrade pip setuptools pytest pytest-xdist pytest-cov pip install --upgrade flake8 "isort>=4.3.5" "mypy>=0.900" "click" "black" - name: Setup git configuration run: | @@ -107,7 +107,7 @@ jobs: sudo apt-get install -y coreutils kcov csh zsh tcsh fish dash bash - name: Install Python packages run: | - pip install --upgrade pip six setuptools pytest coverage[toml] pytest-xdist + pip install --upgrade pip setuptools pytest coverage[toml] pytest-xdist - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -163,7 +163,7 @@ jobs: sudo apt-get -y install coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build kcov - name: Install Python packages run: | - pip install --upgrade pip six setuptools pytest coverage[toml] pytest-cov clingo pytest-xdist + pip install --upgrade pip setuptools pytest coverage[toml] pytest-cov clingo pytest-xdist - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -193,7 +193,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install Python packages run: | - pip install --upgrade pip six setuptools + pip install --upgrade pip setuptools pip install --upgrade pytest coverage[toml] pytest-xdist pytest-cov - name: Setup Homebrew packages run: | diff --git a/.github/workflows/valid-style.yml b/.github/workflows/valid-style.yml index 573330bc37..085f7fab60 100644 --- a/.github/workflows/valid-style.yml +++ b/.github/workflows/valid-style.yml @@ -44,7 +44,7 @@ jobs: cache: 'pip' - name: Install Python packages run: | - python3 -m pip install --upgrade pip six setuptools types-six black==23.1.0 mypy isort clingo flake8 + python3 -m pip install --upgrade pip setuptools types-six black==23.1.0 mypy isort clingo flake8 - name: Setup git configuration run: | # Need this for the git tests to succeed. diff --git a/.github/workflows/windows_python.yml b/.github/workflows/windows_python.yml index 92ac3b2f52..33c2d17db5 100644 --- a/.github/workflows/windows_python.yml +++ b/.github/workflows/windows_python.yml @@ -23,7 +23,7 @@ jobs: python-version: 3.9 - name: Install Python packages run: | - python -m pip install --upgrade pip six pywin32 setuptools pytest-cov clingo + python -m pip install --upgrade pip pywin32 setuptools pytest-cov clingo - name: Create local develop run: | ./.github/workflows/setup_git.ps1 @@ -47,7 +47,7 @@ jobs: python-version: 3.9 - name: Install Python packages run: | - python -m pip install --upgrade pip six pywin32 setuptools coverage pytest-cov clingo + python -m pip install --upgrade pip pywin32 setuptools coverage pytest-cov clingo - name: Create local develop run: | ./.github/workflows/setup_git.ps1 @@ -71,85 +71,10 @@ jobs: python-version: 3.9 - name: Install Python packages run: | - python -m pip install --upgrade pip six pywin32 setuptools coverage + python -m pip install --upgrade pip pywin32 setuptools coverage - name: Build Test run: | spack compiler find spack external find cmake spack external find ninja spack -d install abseil-cpp - # TODO: johnwparent - reduce the size of the installer operations - # make-installer: - # runs-on: windows-latest - # steps: - # - name: Disable Windows Symlinks - # run: | - # git config --global core.symlinks false - # shell: - # powershell - # - uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab - # with: - # fetch-depth: 0 - # - uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b - # with: - # python-version: 3.9 - # - name: Install Python packages - # run: | - # python -m pip install --upgrade pip six pywin32 setuptools - # - name: Add Light and Candle to Path - # run: | - # $env:WIX >> $GITHUB_PATH - # - name: Run Installer - # run: | - # ./share/spack/qa/setup_spack_installer.ps1 - # spack make-installer -s . -g SILENT pkg - # echo "installer_root=$((pwd).Path)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - # env: - # ProgressPreference: SilentlyContinue - # - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb - # with: - # name: Windows Spack Installer Bundle - # path: ${{ env.installer_root }}\pkg\Spack.exe - # - uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb - # with: - # name: Windows Spack Installer - # path: ${{ env.installer_root}}\pkg\Spack.msi - # execute-installer: - # needs: make-installer - # runs-on: windows-latest - # defaults: - # run: - # shell: pwsh - # steps: - # - uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b - # with: - # python-version: 3.9 - # - name: Install Python packages - # run: | - # python -m pip install --upgrade pip six pywin32 setuptools - # - name: Setup installer directory - # run: | - # mkdir -p spack_installer - # echo "spack_installer=$((pwd).Path)\spack_installer" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - # - uses: actions/download-artifact@v3 - # with: - # name: Windows Spack Installer Bundle - # path: ${{ env.spack_installer }} - # - name: Execute Bundled Installer - # run: | - # $proc = Start-Process ${{ env.spack_installer }}\spack.exe "/install /quiet" -Passthru - # $handle = $proc.Handle # cache proc.Handle - # $proc.WaitForExit(); - # $LASTEXITCODE - # env: - # ProgressPreference: SilentlyContinue - # - uses: actions/download-artifact@v3 - # with: - # name: Windows Spack Installer - # path: ${{ env.spack_installer }} - # - name: Execute MSI - # run: | - # $proc = Start-Process ${{ env.spack_installer }}\spack.msi "/quiet" -Passthru - # $handle = $proc.Handle # cache proc.Handle - # $proc.WaitForExit(); - # $LASTEXITCODE diff --git a/var/spack/repos/builtin.mock/packages/multimethod/package.py b/var/spack/repos/builtin.mock/packages/multimethod/package.py index d28b44c7fd..2853b87284 100644 --- a/var/spack/repos/builtin.mock/packages/multimethod/package.py +++ b/var/spack/repos/builtin.mock/packages/multimethod/package.py @@ -3,8 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from six import string_types - import spack.platforms from spack.package import * from spack.pkg.builtin.mock.multimethod_base import MultimethodBase @@ -102,7 +100,7 @@ class Multimethod(MultimethodBase): @when("target=" + target.name) def different_by_target(self): - if isinstance(self.spec.architecture.target, string_types): + if isinstance(self.spec.architecture.target, str): return self.spec.architecture.target else: return self.spec.architecture.target.name diff --git a/var/spack/repos/builtin.mock/packages/raiser/package.py b/var/spack/repos/builtin.mock/packages/raiser/package.py index b80f0a579a..b9e68fa11d 100644 --- a/var/spack/repos/builtin.mock/packages/raiser/package.py +++ b/var/spack/repos/builtin.mock/packages/raiser/package.py @@ -3,7 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from six.moves import builtins +import builtins from spack.package import * diff --git a/var/spack/repos/builtin/packages/dataspaces/package.py b/var/spack/repos/builtin/packages/dataspaces/package.py index 91368a2c15..d19e0f30d8 100644 --- a/var/spack/repos/builtin/packages/dataspaces/package.py +++ b/var/spack/repos/builtin/packages/dataspaces/package.py @@ -2,16 +2,13 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - -import six - from spack.package import * def is_string(x): """validate a string""" try: - return isinstance(x, six.string_types) + return isinstance(x, str) except ValueError: return False diff --git a/var/spack/repos/builtin/packages/pythia6/package.py b/var/spack/repos/builtin/packages/pythia6/package.py index 435e86f01c..497f926673 100644 --- a/var/spack/repos/builtin/packages/pythia6/package.py +++ b/var/spack/repos/builtin/packages/pythia6/package.py @@ -2,12 +2,9 @@ # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) - import numbers import os - -from six import iteritems -from six.moves.urllib.parse import urlparse +import urllib.parse from spack.package import * @@ -97,7 +94,7 @@ class Pythia6(CMakePackage): "ttbar.lhe": "db772b69ab4e0300d973b57414523ac8e7fa8535eac49ee52a6b69b1c131983d", } - for example, checksum in iteritems(examples): + for example, checksum in examples.items(): resource( name=example, url="http://pythiasix.hepforge.org/examples/{0}".format(example), @@ -114,8 +111,8 @@ class Pythia6(CMakePackage): "https://pythiasix.hepforge.org/pythia6-announcement.txt": "2a52def41f0c93e32e0db58dbcf072b987ebfbd32e42ccfc1f9382fcf65f1271", } - for docurl, checksum in iteritems(docs): - doc = os.path.basename(urlparse(docurl).path) + for docurl, checksum in docs.items(): + doc = os.path.basename(urllib.parse.urlparse(docurl).path) resource( name=doc, url=docurl, diff --git a/var/spack/repos/builtin/packages/rust/package.py b/var/spack/repos/builtin/packages/rust/package.py index 2fa16ff3bc..aec30c1118 100644 --- a/var/spack/repos/builtin/packages/rust/package.py +++ b/var/spack/repos/builtin/packages/rust/package.py @@ -5,8 +5,6 @@ import re -from six import iteritems - from spack.package import * @@ -197,7 +195,7 @@ class Rust(Package): rust_prerelease_versions = ["beta", "nightly", "master"] for prerelease_version in rust_prerelease_versions: - for rust_target, rust_arch_list in iteritems(rust_archs): + for rust_target, rust_arch_list in rust_archs.items(): for rust_arch in rust_arch_list: # All pre-release builds are built with the latest beta # compiler. @@ -226,8 +224,8 @@ class Rust(Package): # _host_ architecture, not the target architecture, in order to support # cross compiling. I'm not sure Spack provides a way to specify a # distinction in the when clause, though. - for rust_version, rust_targets in iteritems(rust_releases): - for rust_target, rust_sha256 in iteritems(rust_targets): + for rust_version, rust_targets in rust_releases.items(): + for rust_target, rust_sha256 in rust_targets.items(): for rust_arch in rust_archs[rust_target]: resource( name="rust-{version}-{target}".format( -- cgit v1.2.3-60-g2f50