简体   繁体   中英

Getting AppVeyor to allow failures with Python

I've been messing around with AppVeyor to try and get it setup with my GitHub project. My AppVeyor builds can be located here .

Since I'm using Python, and there are so many versions, I want to be able to allow 3.2, 3.3 and 3.4 to fail. I can do it fine with Travis-CI, by typing:

python:
    - "2.7"
    - "3.2" # End of life.
    - "3.3"
    - "3.4"
    - "3.5"
    - "3.6"
    - "nightly"

matrix:
  allow_failures:
    - python: "3.2"
    - python: "3.3"
    - python: "3.4"
    - python: "nightly"

In AppVeyor however, I have done the following:

environment:
  matrix:
      # 32-bit Python.
    - PYTHON: "C:\\Python27"
      PYTHON_VERSION: "2.7.x"
      PYTHON_ARCH: "32"
    - PYTHON: "C:\\Python32"
      PYTHON_VERSION: "3.2.x"
      PYTHON_ARCH: "32"
    - PYTHON: "C:\\Python33"
      PYTHON_VERSION: "3.3.x"
      PYTHON_ARCH: "32"
    - PYTHON: "C:\\Python34"
      PYTHON_VERSION: "3.4.x"
      PYTHON_ARCH: "32"
    - PYTHON: "C:\\Python35"
      PYTHON_VERISON: "3.5.x"
      PYTHON_ARCH: "32"
    - PYTHON: "C:\\Python36"
      PYTHON_VERISON: "3.6.x"
      PYTHON_ARCH: "32"

      # 64-bit Python.
    - PYTHON: "C:\\Python27-x64"
      PYTHON_VERSION: "2.7.x"
      PYTHON_ARCH: "64"
    - PYTHON: "C:\\Python32-x64"
      PYTHON_VERSION: "3.2.x"
      PYTHON_ARCH: "64"
    - PYTHON: "C:\\Python33-x64"
      PYTHON_VERSION: "3.3.x"
      PYTHON_ARCH: "64"
    - PYTHON: "C:\\Python34-x64"
      PYTHON_VERSION: "3.4.x"
      PYTHON_ARCH: "64"
    - PYTHON: "C:\\Python35-x64"
      PYTHON_VERISON: "3.5.x"
      PYTHON_ARCH: "64"
    - PYTHON: "C:\\Python36-x64"
      PYTHON_VERISON: "3.6.x"
      PYTHON_ARCH: "64"

matrix:
    allow_failures:
        - platform: x86
          PYTHON: "C:\\Python32"
          PYTHON_VERSION: "3.2.x"
        - platform: x86
          PYTHON: "C:\\Python33"
          PYTHON_VERSION: "3.3.x"
        - platform: x86
          PYTHON: "C:\\Python34"
          PYTHON_VERSION: "3.4.x"
        - platform: x64
          PYTHON: "C:\\Python32-x64"
          PYTHON_VERSION: "3.2.x"
        - platform: x64
          PYTHON: "C:\\Python33-x64"
          PYTHON_VERSION: "3.3.x"
        - platform: x64
          PYTHON: "C:\\Python34-x64"
          PYTHON_VERSION: "3.4.x"

As you can see below with my most recent build, it is still failing to detect the allowance of failures with 3.3 x64 bit.

AppVeyor故障的图像。

Now I've looked up how to correctly format my allow-failures and can't find anything for Python. The one I DID find however, was off of a GitHub project, buried away in comments, and so I just assumed to follow this format:

#matrix:
#  allow_failures:
#    - platform: x86
#      PYTHON: "C:\\Python27"
#      PYTHON_VERSION: "2.7"

So my question is, how can I get AppVeyor to allow me to fail certain Python builds for both the x86 and x64 bit architectures?

Allow failures for some specific matrix configuration does not mean that job for this configuration will be always green. This means that even if this job failed it will not affect status of the whole build.

platform makes sense mostly for Visual Studio solutions/projects, for your case something like this should work OK:

matrix:
    allow_failures:
      - PYTHON: "C:\\Python32"
        PYTHON_VERSION: "3.2.x"
        PYTHON_ARCH: "32"
      - PYTHON: "C:\\Python33"
        PYTHON_VERSION: "3.3.x"
        PYTHON_ARCH: "32"
      - PYTHON: "C:\\Python34"
        PYTHON_VERSION: "3.4.x"
        PYTHON_ARCH: "32"
      - PYTHON: "C:\\Python32-x64"
        PYTHON_VERSION: "3.2.x"
        PYTHON_ARCH: "64"
      - PYTHON: "C:\\Python33-x64"
        PYTHON_VERSION: "3.3.x"
        PYTHON_ARCH: "64"  
      - PYTHON: "C:\\Python34-x64"
        PYTHON_VERSION: "3.4.x"
        PYTHON_ARCH: "64"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM