Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions-versions:
patterns:
- "*"
51 changes: 51 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish to PyPI

on: workflow_dispatch

jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v7
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/v')
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/sarkit-processing
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v8
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
77 changes: 77 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Tests

on:
push:
pull_request:
branches: [ "main" ]

jobs:
lint_and_docs:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v7
with:
lfs: false # Save GitHub LFS bandwidth

- name: Setup PDM and Python
uses: pdm-project/setup-pdm@v4
with:
python-version: 3.14
- name: Install dependencies
run: |
pdm lock -G :all
pdm sync --no-default -G test
- name: Lint
run: pdm run nox -s lint


min_env_tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- name: checkout
uses: actions/checkout@v7
with:
lfs: false # Save GitHub LFS bandwidth
- name: Setup PDM and Python
uses: pdm-project/setup-pdm@v4
with:
python-version: 3.12
- name: Install dependencies
run: |
pdm lock -G :all --strategy direct_minimal_versions
pdm sync --no-default -G test
- name: Run tests
run: pdm run nox -s test


current_env_tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]

steps:
- name: checkout
uses: actions/checkout@v7
with:
lfs: false # Save GitHub LFS bandwidth
- name: Setup PDM and Python
uses: pdm-project/setup-pdm@v4
with:
python-version: 3.14
- name: Install dependencies
run: |
pdm lock -G :all
pdm sync --no-default -G test
- name: Run tests
run: pdm run nox -s test
4 changes: 2 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

@nox.session
def format(session):
session.run_install("pdm", "sync", external=True)
session.run_install("pdm", "sync", "-G", "lint", external=True)
session.run("ruff", "check", "--fix")
session.run("ruff", "format")


@nox.session
def lint(session):
session.run_install("pdm", "sync", "-G", "all", external=True)
session.run_install("pdm", "sync", "-G", "lint", external=True)
session.run("ruff", "check")
session.run(
"ruff",
Expand Down
3 changes: 2 additions & 1 deletion sarkit_processing/_geometry_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ def read_coordinates(filename_or_string):
try:
with open(filename_or_string, "r") as file:
contents = file.read()
except (OSError, FileNotFoundError):
except (OSError, FileNotFoundError, ValueError):
# at some point, smart_open[http] on windows was raising a ValueError
pass

return decode_coordinates(contents)
Expand Down
18 changes: 9 additions & 9 deletions tests/test_coords.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_cli(example_sicd, tmp_path):
"skp",
"coords",
"--sicd",
example_sicd,
str(example_sicd),
"--to-cs",
"rowcol",
geojson_str,
Expand All @@ -178,7 +178,7 @@ def test_cli(example_sicd, tmp_path):
"sarkit_processing",
"coords",
"--sicd",
xml_file,
str(xml_file),
"--to-cs",
"rowcol",
"-",
Expand All @@ -199,10 +199,10 @@ def test_cli(example_sicd, tmp_path):
"sarkit_processing",
"coords",
"--sicd",
example_sicd,
str(example_sicd),
"--to-cs",
"rowcol",
geojson_file,
str(geojson_file),
],
capture_output=True,
check=True,
Expand All @@ -225,7 +225,7 @@ def test_cli(example_sicd, tmp_path):
"sarkit_processing",
"coords",
"--sicd",
example_sicd,
str(example_sicd),
"--to-cs",
"xrowycol",
geojson_str,
Expand All @@ -247,7 +247,7 @@ def test_cli(example_sicd, tmp_path):
"sarkit_processing",
"coords",
"--sicd",
example_sicd,
str(example_sicd),
"--from-cs",
"lonlathae",
"--to-cs",
Expand All @@ -272,7 +272,7 @@ def test_cli(example_sicd, tmp_path):
"sarkit_processing",
"coords",
"--sicd",
example_sicd,
str(example_sicd),
"--from-cs",
"ecef",
"--to-cs",
Expand All @@ -297,7 +297,7 @@ def test_cli(example_sicd, tmp_path):
"sarkit_processing",
"coords",
"--sicd",
example_sicd,
str(example_sicd),
"--from-cs",
"lonlathae",
"--to-cs",
Expand All @@ -323,7 +323,7 @@ def test_cli_empty(example_sicd):
"sarkit_processing",
"coords",
"--sicd",
example_sicd,
str(example_sicd),
"--from-cs",
"ecef",
"--to-cs",
Expand Down
Loading