Skip to content

Commit

Permalink
Increment testing for geos, python and numpy versions for 2021 (#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews committed Oct 22, 2021
1 parent 1240cb1 commit afddf3b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/test-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
architecture: [x64]
geos: [3.6.4, 3.7.3, 3.8.1, 3.9.1, main]
geos: [3.6.4, 3.7.3, 3.8.1, 3.9.1, 3.10.0, main]
include:
# 2017
- python: 3.6
Expand All @@ -32,8 +32,12 @@ jobs:
- python: 3.9
geos: 3.9.1
numpy: 1.19.5
# 2021
- python: "3.10"
geos: 3.10.0
numpy: 1.21.3
# dev
- python: 3.9
- python: "3.10"
geos: main
# enable two 32-bit windows builds:
- os: windows-2019
Expand All @@ -43,9 +47,9 @@ jobs:
numpy: 1.13.3
- os: windows-2019
architecture: x86
python: 3.9
geos: 3.9.1
numpy: 1.19.5
python: "3.10"
geos: 3.10.0
numpy: 1.21.3

env:
GEOS_VERSION: ${{ matrix.geos }}
Expand Down Expand Up @@ -138,7 +142,7 @@ jobs:
run: python setup.py build_ext --inplace

- name: Run tests
continue-on-error: ${{ matrix.geos == 'main' }}
continue-on-error: ${{ matrix.geos == 'main' || matrix.geos == '3.10.0' }}
run: pytest pygeos

# Only run doctests on 1 runner (because of typographic differences in doctest results)
Expand Down
13 changes: 10 additions & 3 deletions pygeos/tests/test_misc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import sys
from itertools import chain
from string import ascii_lowercase
from string import ascii_letters, digits
from unittest import mock

import numpy as np
Expand Down Expand Up @@ -33,7 +33,10 @@ def test_geos_version():
actual = pygeos.geos_version_string

# strip any beta / dev qualifiers
actual = actual.lower().rstrip(ascii_lowercase)
if any(c.isalpha() for c in actual):
if actual[-1].isnumeric():
actual = actual.rstrip(digits)
actual = actual.rstrip(ascii_letters)

assert actual == expected

Expand All @@ -53,7 +56,11 @@ def test_geos_capi_version():
actual_geos_api_version,
) = pygeos.geos_capi_version_string.split("-CAPI-")

actual_geos_version = actual_geos_version.lower().rstrip(ascii_lowercase)
if any(c.isalpha() for c in actual_geos_version):
if actual_geos_version[-1].isnumeric():
actual_geos_version = actual_geos_version.rstrip(digits)
actual_geos_version = actual_geos_version.rstrip(ascii_letters)
actual_geos_version = actual_geos_version.rstrip(ascii_letters)

assert (
"{0}-CAPI-{1}".format(actual_geos_version, actual_geos_api_version) == expected
Expand Down

0 comments on commit afddf3b

Please sign in to comment.