Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add workflows and pyroj toml #18

Merged
merged 1 commit into from
May 13, 2024
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
50 changes: 50 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

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

permissions:
contents: read

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:

strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
os: ["ubuntu-latest"]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[dev]"

- name: Lint (ruff)
run: |
ruff check
ruff format --check

# - name: Test with pytest
# run: |
# pytest
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:
push:
tags:
- "v*.*.*"

permissions:
contents: read

jobs:
release:
name: release
runs-on: ubuntu-latest
environment: release-env
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install release dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build wheel and source distribution
run: |
python -m build
- name: Publish package
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.2
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
2 changes: 2 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[FORMAT]
max-line-length=120
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# ras-stac
[![CI](https://github.com/fema-ffrd/rashdf/actions/workflows/continuous-integration.yml/badge.svg?branch=main)](https://github.com/fema-ffrd/ras-stac/actions/workflows/continuous-integration.yml)
[![Release](https://github.com/fema-ffrd/ras-stac/actions/workflows/release.yml/badge.svg)](https://github.com/fema-ffrd/ras-stac/actions/workflows/release.yml)
[![PyPI version](https://badge.fury.io/py/ras-stac.svg)](https://badge.fury.io/py/ras-stac)

Utilities for making SpatioTemporal Asset Catalogs of HEC-RAS models

This repository contains code for developing STAC items from HEC-RAS models. Current activities focus on creating items for geometry files `g**.hdf` stored in AWS S3. More to come.
Expand Down
39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[project]
name = "ras-stac"
description = "Create SpatioTemporal Asset Catalog (STAC) objects from HEC-RAS model data."
readme = "README.md"
maintainers = [{ name = "Seth Lawler", email = "[email protected]" }]
keywords = ["hec-ras", "catalog", "STAC"]
license = { text = "MIT" }
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
version = "0.1.0-beta.1"
requires-python = ">=3.9"
dependencies = ["h5py", "geopandas", "s3fs", "boto3", "botocore", "fsspec", "h5py", "mypy", "numpy", "papipyplug",
"python-dotenv", "pyproj", "pystac", "shapely", "rasterio", "rashdf"]

[project.optional-dependencies]
dev = ["pre-commit", "ruff"]

[project.urls]
repository = "https://github.com/fema-ffrd/ras-stac"

# TODO: add tests.
# [tool.pytest.ini_options]
# pythonpath = "src"
# testpaths = "tests"

# TODO: linting for docstrings.
# [tool.ruff.lint]
# select = ["D"]

# [tool.ruff.lint.pydocstyle]
# convention = "numpy"
Loading