From a22686279c6e45729c0ce6dc4aee0df2d280b513 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 7 Jul 2021 02:55:38 -0700 Subject: cvs tests: don't use dateutil at all `dateutil.parser` was an optional dependency for CVS tests. It was failing on macOS beacuse the dateutil types were not being installed, and mypy was failing *even when the CVS tests were skipped*. This seems like it was an oversight on macOS -- `types-dateutil-parser` was not installed there, though it was on Linux unit tests. It takes 6 lines of YAML and some weird test-skipping logic to get `python-dateutil` and `types-python-dateutil` installed in all the tests where we need them, but it only takes 4 lines of code to write the date parser we need for CVS, so I just did that instead. Note that CVS date format can vary from system to system, but it seems like it's always pretty similar for the parts we care about. - [x] Replace dateutil.parser with a simpler date regex - [x] Lose the dependency on `dateutil.parser` --- .github/workflows/unit_tests.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to '.github') diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index a4790fc25e..7c8971a048 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -39,7 +39,7 @@ jobs: python-version: 3.9 - name: Install Python packages run: | - pip install --upgrade pip six setuptools flake8 isort>=4.3.5 mypy>=0.800 black types-six types-python-dateutil + pip install --upgrade pip six setuptools flake8 isort>=4.3.5 mypy>=0.800 black types-six - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -62,7 +62,7 @@ jobs: sudo apt-get install -y coreutils ninja-build graphviz - name: Install Python packages run: | - pip install --upgrade pip six setuptools python-dateutil + pip install --upgrade pip six setuptools pip install --upgrade -r lib/spack/docs/requirements.txt - name: Build documentation run: | @@ -137,7 +137,7 @@ jobs: sudo apt-get -y install zlib1g-dev libdw-dev libiberty-dev - name: Install Python packages run: | - pip install --upgrade pip python-dateutil six setuptools codecov coverage + pip install --upgrade pip six setuptools codecov coverage - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -205,7 +205,7 @@ jobs: sudo apt-get -y install zlib1g-dev libdw-dev libiberty-dev - name: Install Python packages run: | - pip install --upgrade pip six setuptools codecov coverage python-dateutil + pip install --upgrade pip six setuptools codecov coverage - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -326,7 +326,7 @@ jobs: make -C ${KCOV_ROOT}/build && sudo make -C ${KCOV_ROOT}/build install - name: Install Python packages run: | - pip install --upgrade pip six setuptools codecov coverage clingo python-dateutil + pip install --upgrade pip six setuptools codecov coverage clingo - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -371,7 +371,6 @@ jobs: pip install --upgrade pip six setuptools pip install --upgrade codecov coverage pip install --upgrade flake8 isort>=4.3.5 pep8-naming mypy>=0.800 - pip install --upgrade python-dateutil - name: Setup Homebrew packages run: | brew install dash fish gcc gnupg2 kcov -- cgit v1.2.3-70-g09d2