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" 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 new file mode 100644 index 000000000..6661be3e6 --- /dev/null +++ b/.github/workflows/ci_win.yml @@ -0,0 +1,36 @@ +name: Windows CI + +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 + + - 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: pwsh + run: | + 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/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) ------------------ diff --git a/pyproject.toml b/pyproject.toml index 465bfe96a..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_python_implementation != \"PyPy\"", + "python-hglib; platform_system != 'Windows'", + "rpy2; platform_system != 'Windows' and platform_python_implementation != 'PyPy'", ] doc = [ "sphinx", @@ -71,7 +71,6 @@ virtualenv = [ hg = [ "python-hglib", ] - [build-system] requires = [ "wheel", 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) diff --git a/test/test_environment.py b/test/test_environment.py index c48787527..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 @@ -187,7 +188,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 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)