Skip to content

Commit

Permalink
Specifically run tests on macos-13 and macos-14 (#1386)
Browse files Browse the repository at this point in the history
* Specifically run tests on macos-13 and macos-14

* Specifically run tests on macos-13 and macos-14

* Update tests.yml

* Update tests.yml

* Update tests.yml

* Update tests.yml

* Update tests.yml

* Update tests.yml

* Use env.CONDA to find directories

And update a test

* Update 3 more tests, TileDB requires crs

* Use CRS literals

* TileDB doesn't support vsimem

* Add some debugging

* Type out the paths

* -lgdal

* Add back macos-14

* Add back macos-14
  • Loading branch information
sgillies committed Apr 29, 2024
1 parent 20dcad5 commit 6cd36a1
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 29 deletions.
50 changes: 27 additions & 23 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ main, 'maint-*' ]
paths:
- '.github/workflows/tests.yaml'
- '.github/workflows/tests.yml'
- 'requirements*.txt'
- 'setup.py'
- 'setup.cfg'
Expand All @@ -15,7 +15,7 @@ on:
pull_request:
branches: [ main, 'maint-*' ]
paths:
- '.github/workflows/tests.yaml'
- '.github/workflows/tests.yml'
- 'requirements*.txt'
- 'setup.py'
- 'setup.cfg'
Expand Down Expand Up @@ -92,61 +92,65 @@ jobs:
fail-fast: true
matrix:
include:
- os: macos-latest
- os: macos-13
python-version: '3.11'
- os: macos-14
python-version: '3.11'
- os: windows-latest
python-version: '3.11'
steps:
- uses: actions/checkout@v4.1.3
- uses: actions/checkout@v4

- name: Conda Setup
uses: s-weigand/setup-conda@v1
uses: conda-incubator/setup-miniconda@v3
with:
conda-channels: conda-forge
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
auto-update-conda: true
use-only-tar-bz2: false

- name: Install Env (OSX)
if: matrix.os == 'macos-latest'
shell: bash
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
shell: bash -l {0}
run: |
conda config --prepend channels conda-forge
conda config --set channel_priority strict
conda create -n test python=${{ matrix.python-version }} libgdal geos=3.10.3 cython=3
source activate test
conda create -n test python=${{ matrix.python-version }} libgdal geos=3.11 cython=3
conda activate test
python -m pip install -e . || python -m pip install -e .
python -m pip install -r requirements-dev.txt
- name: Install Env (Windows)
if: matrix.os == 'windows-latest'
shell: bash
shell: bash -l {0}
run: |
conda config --prepend channels conda-forge
conda config --set channel_priority strict
conda create -n test python=${{ matrix.python-version }} libgdal geos=3.10.3 cython=3
source activate test
GDAL_VERSION="3.5" python setup.py build_ext -I"C:\\Miniconda\\envs\\test\\Library\\include" -lgdal_i -L"C:\\Miniconda\\envs\\test\\Library\\lib" install
conda create -n test python=${{ matrix.python-version }} libgdal geos=3.11 cython=3
conda activate test
GDAL_VERSION="3.7" python setup.py build_ext -I"/c/Users/runneradmin/miniconda3/envs/test/Library/include" -lgdal -L"/c/Users/runneradmin/miniconda3/envs/test/Library/lib" install
python -m pip install -r requirements-dev.txt
- name: Check and Log Environment
shell: bash
shell: bash -l {0}
run: |
source activate test
conda activate test
python -V
conda info
conda list
- name: Test with Coverage (Windows)
if: matrix.os == 'windows-latest'
shell: bash
shell: bash -l {0}
run: |
source activate test
conda activate test
pytest -v -m "not wheel" -rxXs --cov fiona --cov-report term-missing
- name: Test with Coverage (OSX)
if: matrix.os == 'macos-latest'
shell: bash
if: matrix.os == 'macos-13'
shell: bash -l {0}
run: |
source activate test
conda activate test
python -m pytest -v -m "not wheel" -rxXs --cov fiona --cov-report term-missing
- uses: codecov/codecov-action@v3
2 changes: 1 addition & 1 deletion tests/test_bounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def calc_bounds(records):
ys.append(r.geometry["coordinates"][1])
return min(xs), max(xs), min(ys), max(ys)

with fiona.open(path, "w", driver=driver, schema=schema) as c:
with fiona.open(path, "w", crs="OGC:CRS84", driver=driver, schema=schema) as c:
c.writerecords(records1)

try:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_memoryfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def test_mapinfo_raises():
for driver in supported_drivers
if _driver_supports_mode(driver, "w")
and supports_vsi(driver)
and driver not in {"MapInfo File"}
and driver not in {"MapInfo File", "TileDB"}
],
)
def test_write_memoryfile_drivers(driver, testdata_generator):
Expand All @@ -226,7 +226,7 @@ def test_write_memoryfile_drivers(driver, testdata_generator):
schema, crs, records1, _, _ = testdata_generator(driver, range1, [])

with MemoryFile() as memfile:
with memfile.open(driver=driver, schema=schema) as c:
with memfile.open(driver=driver, crs="OGC:CRS84", schema=schema) as c:
c.writerecords(records1)

with memfile.open(driver=driver) as c:
Expand Down Expand Up @@ -267,7 +267,7 @@ def test_multiple_layer_memoryfile(testdata_generator):
for driver in supported_drivers
if _driver_supports_mode(driver, "a")
and supports_vsi(driver)
and driver not in {"MapInfo File"}
and driver not in {"MapInfo File", "TileDB"}
],
)
def test_append_memoryfile_drivers(driver, testdata_generator):
Expand All @@ -277,7 +277,7 @@ def test_append_memoryfile_drivers(driver, testdata_generator):
schema, crs, records1, records2, _ = testdata_generator(driver, range1, range2)

with MemoryFile() as memfile:
with memfile.open(driver=driver, schema=schema) as c:
with memfile.open(driver=driver, crs="OGC:CRS84", schema=schema) as c:
c.writerecords(records1)

with memfile.open(mode='a', driver=driver, schema=schema) as c:
Expand Down
4 changes: 3 additions & 1 deletion tests/test_slice.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def get_records(driver, range):
tmpdir = tempfile.mkdtemp()
path = os.path.join(tmpdir, get_temp_filename(driver))

with fiona.open(path, "w", driver=driver, schema=schema, **create_kwargs) as c:
with fiona.open(
path, "w", driver=driver, crs="OGC:CRS84", schema=schema, **create_kwargs
) as c:
c.writerecords(records)
yield path
shutil.rmtree(tmpdir)
Expand Down

0 comments on commit 6cd36a1

Please sign in to comment.