From c3c61651339913f7322d55dd86c16645924096e5 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 17:18:28 +0000 Subject: [PATCH 01/14] CI: Try windows on github again --- .github/workflows/ci_win.yml | 48 ++++++++++++++++++++++++++++++++++++ pyproject.toml | 3 +-- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci_win.yml diff --git a/.github/workflows/ci_win.yml b/.github/workflows/ci_win.yml new file mode 100644 index 000000000..5bcd88884 --- /dev/null +++ b/.github/workflows/ci_win.yml @@ -0,0 +1,48 @@ +name: CI Windows + +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: test + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["windows-latest"] + python-version: ["3.7"] + timeout-minutes: 30 + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # We need Python 3.7 to always be installed, so tests with + # multiple environments can run. + - name: Set up Python 3.7 + uses: actions/setup-python@v4 + with: + python-version: 3.7 + + - name: Set up Python version ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: pyproject.toml + + - name: Setup a browser for more tests + uses: browser-actions/setup-chrome@latest + + - name: Install dependencies + run: python -m pip install ".[test,hg]" + + - name: Install asv + run: pip install . + + - name: Run tests + run: python -m pytest -v --timeout=300 --webdriver=ChromeHeadless --durations=100 test diff --git a/pyproject.toml b/pyproject.toml index 465bfe96a..1ef57432e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ test = [ "selenium", "pytest-rerunfailures", "python-hglib", - "rpy2; platform_python_implementation != \"PyPy\"", + "rpy2"; platform_system!='Windows' and platform_python_implementation != 'PyPy'" ] doc = [ "sphinx", @@ -71,7 +71,6 @@ virtualenv = [ hg = [ "python-hglib", ] - [build-system] requires = [ "wheel", From 188ba342cf2028c378dcdc2aa7337600e6e65bc8 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 17:37:34 +0000 Subject: [PATCH 02/14] Rework operating system checks --- .github/workflows/ci_win.yml | 2 +- pyproject.toml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_win.yml b/.github/workflows/ci_win.yml index 5bcd88884..055200e0a 100644 --- a/.github/workflows/ci_win.yml +++ b/.github/workflows/ci_win.yml @@ -45,4 +45,4 @@ jobs: run: pip install . - name: Run tests - run: python -m pytest -v --timeout=300 --webdriver=ChromeHeadless --durations=100 test + run: python -m pytest -v --timeout=300 --webdriver=ChromeHeadless --durations=100 test -x diff --git a/pyproject.toml b/pyproject.toml index 1ef57432e..1bee8a80e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "asv-runner>=v0.0.9", "json5", "tabulate", - "colorama; os_name == 'nt'", + "colorama; platform_system == 'Windows'", "pyyaml; platform_python_implementation != \"PyPy\"", "pympler; platform_python_implementation != \"PyPy\"", ] @@ -53,8 +53,8 @@ test = [ "feedparser", "selenium", "pytest-rerunfailures", - "python-hglib", - "rpy2"; platform_system!='Windows' and platform_python_implementation != 'PyPy'" + "python-hglib; platform_system != 'Windows'", + "rpy2; platform_system != 'Windows' and platform_python_implementation != 'PyPy'", ] doc = [ "sphinx", From a9041be02427c26974d314dfe281d9f85a7591db Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 18:09:26 +0000 Subject: [PATCH 03/14] TST: Skip hglib tests on WIN --- test/test_compare.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test_compare.py b/test/test_compare.py index 76a56533a..1bd89cf69 100644 --- a/test/test_compare.py +++ b/test/test_compare.py @@ -16,6 +16,7 @@ except ImportError: hglib = None +from .tools import WIN MACHINE_FILE = abspath(join(dirname(__file__), 'asv-machine.json')) @@ -200,7 +201,8 @@ def test_compare(capsys, tmpdir, example_results): @pytest.mark.parametrize("dvcs_type", [ "git", - pytest.param("hg", marks=pytest.mark.skipif(hglib is None, reason="needs hglib")) + pytest.param("hg", marks=pytest.mark.skipif(hglib is None or WIN, + reason="needs hglib")) ]) def test_compare_name_lookup(dvcs_type, capsys, tmpdir, example_results): tmpdir = str(tmpdir) From d15255ff3c172b84b60b65badd014bbb8e3cc5c7 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 18:10:55 +0000 Subject: [PATCH 04/14] CI: Try reworking windows approach --- .github/workflows/ci_win.yml | 57 ++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci_win.yml b/.github/workflows/ci_win.yml index 055200e0a..eae7c1d3b 100644 --- a/.github/workflows/ci_win.yml +++ b/.github/workflows/ci_win.yml @@ -21,28 +21,47 @@ jobs: with: fetch-depth: 0 - # We need Python 3.7 to always be installed, so tests with - # multiple environments can run. - - name: Set up Python 3.7 - uses: actions/setup-python@v4 + - name: Setup Micromamba ${{ matrix.python-version }} + uses: mamba-org/setup-micromamba@v1 with: - python-version: 3.7 + environment-name: TEST + init-shell: bash + create-args: >- + python=${{ matrix.python-version }} + --channel conda-forge - - name: Set up Python version ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - cache: pip - cache-dependency-path: pyproject.toml + # - name: Setup a browser for more tests + # uses: browser-actions/setup-chrome@latest + + - name: Install and test + shell: bash -l {0} + run: | + micromamba install mamba + micromamba run -n TEST python -m pip install ".[test]" + micromamba run -n python -m pytest -v -l --timeout=300 --durations=100 test --environment-type=mamba -x + + # # We need Python 3.7 to always be installed, so tests with + # # multiple environments can run. + # - name: Set up Python 3.7 + # uses: actions/setup-python@v4 + # with: + # python-version: 3.7 + + # - name: Set up Python version ${{ matrix.python-version }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python-version }} + # cache: pip + # cache-dependency-path: pyproject.toml - - name: Setup a browser for more tests - uses: browser-actions/setup-chrome@latest + # - name: Setup a browser for more tests + # uses: browser-actions/setup-chrome@latest - - name: Install dependencies - run: python -m pip install ".[test,hg]" + # - name: Install dependencies + # run: python -m pip install ".[test,hg]" - - name: Install asv - run: pip install . + # - name: Install asv + # run: pip install . - - name: Run tests - run: python -m pytest -v --timeout=300 --webdriver=ChromeHeadless --durations=100 test -x + # - name: Run tests + # run: python -m pytest -v --timeout=300 --webdriver=ChromeHeadless --durations=100 test -x From 75d5669fdc7d154e149c9469a5e6bb54bbd76e2f Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 18:25:39 +0000 Subject: [PATCH 05/14] CI: Switch to virtualenv --- .github/workflows/ci_win.yml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci_win.yml b/.github/workflows/ci_win.yml index eae7c1d3b..31c0a9cf1 100644 --- a/.github/workflows/ci_win.yml +++ b/.github/workflows/ci_win.yml @@ -21,24 +21,31 @@ jobs: with: fetch-depth: 0 - - name: Setup Micromamba ${{ matrix.python-version }} - uses: mamba-org/setup-micromamba@v1 - with: - environment-name: TEST - init-shell: bash - create-args: >- - python=${{ matrix.python-version }} - --channel conda-forge + # - name: Setup Micromamba ${{ matrix.python-version }} + # uses: mamba-org/setup-micromamba@v1 + # with: + # environment-name: TEST + # init-shell: bash + # create-args: >- + # python=${{ matrix.python-version }} + # --channel conda-forge # - name: Setup a browser for more tests # uses: browser-actions/setup-chrome@latest + - name: Set up Python version ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: pip + cache-dependency-path: pyproject.toml + - name: Install and test shell: bash -l {0} run: | - micromamba install mamba - micromamba run -n TEST python -m pip install ".[test]" - micromamba run -n python -m pytest -v -l --timeout=300 --durations=100 test --environment-type=mamba -x + python -m pip install .[test] + python -m pip install packaging virtualenv + python -m pytest -v -l --timeout=300 --durations=100 test --environment-type=virtualenv -x # # We need Python 3.7 to always be installed, so tests with # # multiple environments can run. From 16c1a189233c71a754f43db0a43ad9d4e1c80555 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 18:52:29 +0000 Subject: [PATCH 06/14] CI: Enable browser tests on windows again --- .github/workflows/ci_win.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_win.yml b/.github/workflows/ci_win.yml index 31c0a9cf1..6a687d84e 100644 --- a/.github/workflows/ci_win.yml +++ b/.github/workflows/ci_win.yml @@ -30,8 +30,8 @@ jobs: # python=${{ matrix.python-version }} # --channel conda-forge - # - name: Setup a browser for more tests - # uses: browser-actions/setup-chrome@latest + - name: Setup a browser for more tests + uses: browser-actions/setup-chrome@latest - name: Set up Python version ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -45,7 +45,10 @@ jobs: run: | python -m pip install .[test] python -m pip install packaging virtualenv - python -m pytest -v -l --timeout=300 --durations=100 test --environment-type=virtualenv -x + python -m pytest -v -l -x --timeout=300 \ + --durations=100 test \ + --webdriver=ChromeHeadless \ + --environment-type=virtualenv # # We need Python 3.7 to always be installed, so tests with # # multiple environments can run. From acf34ce27789e44fa6fe321ac3a38dc7f9253dc3 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 19:19:32 +0000 Subject: [PATCH 07/14] CI: Cleanup and enable 3.10 on windows too --- .github/workflows/ci.yml | 2 +- .github/workflows/ci_win.yml | 39 ++---------------------------------- 2 files changed, 3 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d27bbd87f..951cb1b73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI +name: Linux CI on: [push, pull_request] diff --git a/.github/workflows/ci_win.yml b/.github/workflows/ci_win.yml index 6a687d84e..f67e323e8 100644 --- a/.github/workflows/ci_win.yml +++ b/.github/workflows/ci_win.yml @@ -1,4 +1,4 @@ -name: CI Windows +name: Windows CI on: [push, pull_request] @@ -14,22 +14,13 @@ jobs: fail-fast: false matrix: os: ["windows-latest"] - python-version: ["3.7"] + python-version: ["3.7", "3.10"] timeout-minutes: 30 steps: - uses: actions/checkout@v3 with: fetch-depth: 0 - # - name: Setup Micromamba ${{ matrix.python-version }} - # uses: mamba-org/setup-micromamba@v1 - # with: - # environment-name: TEST - # init-shell: bash - # create-args: >- - # python=${{ matrix.python-version }} - # --channel conda-forge - - name: Setup a browser for more tests uses: browser-actions/setup-chrome@latest @@ -49,29 +40,3 @@ jobs: --durations=100 test \ --webdriver=ChromeHeadless \ --environment-type=virtualenv - - # # We need Python 3.7 to always be installed, so tests with - # # multiple environments can run. - # - name: Set up Python 3.7 - # uses: actions/setup-python@v4 - # with: - # python-version: 3.7 - - # - name: Set up Python version ${{ matrix.python-version }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python-version }} - # cache: pip - # cache-dependency-path: pyproject.toml - - # - name: Setup a browser for more tests - # uses: browser-actions/setup-chrome@latest - - # - name: Install dependencies - # run: python -m pip install ".[test,hg]" - - # - name: Install asv - # run: pip install . - - # - name: Run tests - # run: python -m pytest -v --timeout=300 --webdriver=ChromeHeadless --durations=100 test -x From c699713b30dd7c286c5339670186eda0787baf3a Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 19:24:14 +0000 Subject: [PATCH 08/14] MAINT: Remove appveyor [skip ci] --- .appveyor.yml | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index d05cf26df..000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,47 +0,0 @@ -# AppVeyor.com is a Continuous Integration service to build and run tests under -# Windows - -environment: - global: - CONDA_PATH: "C:\\Miniconda3-x64" - matrix: - - PYTHON_VERSION: "3.7" - platform: x64 - -cache: - - '%LOCALAPPDATA%\pip\Cache' - -install: - # Append webdriver paths - - "SET PATH=%PATH%;C:\\Tools\\WebDriver;C:\\Program Files (x86)\\Mozilla Firefox" - - # Clear tmpdir (sometimes left behind by appveyor?) - - rmdir /s /q %APPVEYOR_BUILD_FOLDER%\\tmp & exit /b 0 - - # Setup conda environment - - "%CONDA_PATH%\\Scripts\\activate.bat" - - # Install the build and runtime dependencies of the project. - - conda update conda -y - - conda install -q --yes python=%PYTHON_VERSION% conda pip pytest pytest-xdist pytest-timeout filelock selenium conda-build bzip2 pympler rpy2 - - python -m pip install -U pip - - python -m pip install pytest-rerunfailures json5 pympler tabulate colorama virtualenv - - # Check that we have the expected version of Python - - python --version - -build_script: - # In-place build - - python -m pip install . - - dir asv - -test_script: - - python -m pytest -l --basetemp=%APPVEYOR_BUILD_FOLDER%\\tmp -v --environment-type=conda --webdriver=ChromeHeadless --timeout=300 --durations=100 test - -after_build: - # Clear up pip cache - - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete - - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete - - C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete - # Show size of cache - - C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache" From 915071e489ef3963eb0bf397453fbf1c6c3a65bd Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 19:25:36 +0000 Subject: [PATCH 09/14] DOC: Add an entry for the CI --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index 4001b48de..1201e27ec 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -18,6 +18,7 @@ Other Changes and Additions ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - ``asv`` timestamps via ``datetime`` are now Python 3.12 compatible (#1331) - ``asv`` now provides ``asv[virtualenv]`` as an installable target +- ``asv`` now uses Github Actions exclusively for Windows and Linux 0.6.0 (2023-08-20) ------------------ From e0c76e38ce3fbb84f3c0084af037a69b23f2ef04 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 19:37:18 +0000 Subject: [PATCH 10/14] TST: Tag tests which need two versions --- test/test_environment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_environment.py b/test/test_environment.py index c48787527..6408bf7b4 100644 --- a/test/test_environment.py +++ b/test/test_environment.py @@ -187,7 +187,8 @@ def test_matrix_expand_include(): with pytest.raises(util.UserError): list(environment.iter_matrix(conf.environment_type, conf.pythons, conf)) -@pytest.mark.skipif((not HAS_CONDA), reason="Requires conda and conda-build") +@pytest.mark.skipif(not (HAS_PYTHON_VER2 or HAS_CONDA), + reason="Requires two usable Python versions") def test_matrix_expand_include_detect_env_type(): conf = config.Config() conf.environment_type = None From 2af9e120975f0fb546072cfbce64c065efb7fdef Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 19:56:29 +0000 Subject: [PATCH 11/14] CI: Browser tests are flaky on windows --- .github/workflows/ci_win.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_win.yml b/.github/workflows/ci_win.yml index f67e323e8..0d36337f8 100644 --- a/.github/workflows/ci_win.yml +++ b/.github/workflows/ci_win.yml @@ -21,8 +21,8 @@ jobs: with: fetch-depth: 0 - - name: Setup a browser for more tests - uses: browser-actions/setup-chrome@latest + # - name: Setup a browser for more tests + # uses: browser-actions/setup-chrome@latest - name: Set up Python version ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -38,5 +38,5 @@ jobs: python -m pip install packaging virtualenv python -m pytest -v -l -x --timeout=300 \ --durations=100 test \ - --webdriver=ChromeHeadless \ + # --webdriver=ChromeHeadless \ --environment-type=virtualenv From bdbb8c1682e9d23327cf71f92627bb95de0d4012 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Thu, 24 Aug 2023 20:15:25 +0000 Subject: [PATCH 12/14] TST: More conda related skips --- .github/workflows/ci_win.yml | 4 ---- test/test_environment.py | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci_win.yml b/.github/workflows/ci_win.yml index 0d36337f8..1bfcb155d 100644 --- a/.github/workflows/ci_win.yml +++ b/.github/workflows/ci_win.yml @@ -21,9 +21,6 @@ jobs: with: fetch-depth: 0 - # - name: Setup a browser for more tests - # uses: browser-actions/setup-chrome@latest - - name: Set up Python version ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -38,5 +35,4 @@ jobs: python -m pip install packaging virtualenv python -m pytest -v -l -x --timeout=300 \ --durations=100 test \ - # --webdriver=ChromeHeadless \ --environment-type=virtualenv diff --git a/test/test_environment.py b/test/test_environment.py index 6408bf7b4..f37133aac 100644 --- a/test/test_environment.py +++ b/test/test_environment.py @@ -45,7 +45,8 @@ def test_matrix_environments(tmpdir, dummy_packages): assert output.startswith(str(env._requirements['asv_dummy_test_package_2'])) -@pytest.mark.skipif((not HAS_CONDA), reason="Requires conda and conda-build") +@pytest.mark.skipif((not HAS_CONDA), + reason="Requires conda and conda-build") def test_large_environment_matrix(tmpdir): # As seen in issue #169, conda can't handle using really long # directory names in its environment. This creates an environment From 15b1d43765338f6bf952400bb4eda5b47cfdebe9 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Fri, 25 Aug 2023 17:44:20 +0000 Subject: [PATCH 13/14] CI: Sync GHA with Appveyor configuration --- .github/workflows/ci_win.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_win.yml b/.github/workflows/ci_win.yml index 1bfcb155d..ec20f9365 100644 --- a/.github/workflows/ci_win.yml +++ b/.github/workflows/ci_win.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: ["windows-latest"] - python-version: ["3.7", "3.10"] + python-version: ["3.7"] # "3.10" needs work timeout-minutes: 30 steps: - uses: actions/checkout@v3 From 137c22858294590a6be6faca3dfc72d3f9ccbcf5 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 10 Sep 2023 18:58:10 +0000 Subject: [PATCH 14/14] CI: Try windows GHA again --- .github/workflows/ci_win.yml | 12 +++++------- test/test_workflow.py | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci_win.yml b/.github/workflows/ci_win.yml index ec20f9365..6661be3e6 100644 --- a/.github/workflows/ci_win.yml +++ b/.github/workflows/ci_win.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: ["windows-latest"] - python-version: ["3.7"] # "3.10" needs work + python-version: ["3.7"] timeout-minutes: 30 steps: - uses: actions/checkout@v3 @@ -29,10 +29,8 @@ jobs: cache-dependency-path: pyproject.toml - name: Install and test - shell: bash -l {0} + shell: pwsh run: | - python -m pip install .[test] - python -m pip install packaging virtualenv - python -m pytest -v -l -x --timeout=300 \ - --durations=100 test \ - --environment-type=virtualenv + python.exe -m pip install .[test] + python.exe -m pip install packaging virtualenv + python.exe -m pytest -v -l -x --timeout=300 --durations=100 test --environment-type=virtualenv diff --git a/test/test_workflow.py b/test/test_workflow.py index 07252d8eb..0ebe92596 100644 --- a/test/test_workflow.py +++ b/test/test_workflow.py @@ -71,7 +71,7 @@ def basic_conf(tmpdir, dummy_packages): return generate_basic_conf(tmpdir) -@pytest.mark.flaky_pypy +@pytest.mark.skipif(tools.HAS_PYPY or (os.name == 'nt'), reason="Flaky on pypy and windows") def test_run_publish(capfd, basic_conf): tmpdir, local, conf, machine_file = basic_conf tmpdir = util.long_path(tmpdir)