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

workflows #5

Merged
merged 9 commits into from
Dec 10, 2023
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
36 changes: 36 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint

on:
pull_request:
push:
branches: [main]

jobs:
Test:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install poetry
run: python -m pip install poetry

- uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'poetry'

- name: Install dependencies
run: poetry install

- name: Check poetry.lock
run: poetry lock --check

# - name: Type-check with Pyright
# run: poetry run pyright .

- name: Lint with ruff
run: poetry run ruff --output-format=github .

- name: Format with ruff
run: poetry run ruff format .
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
release:
types: [created]

jobs:
release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: build release distributions
run: |
# NOTE: put your own distribution build steps here.
python -m build

- name: upload windows dists
uses: actions/upload-artifact@v3
with:
name: release-dists
path: dist/

pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
permissions:
id-token: write

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v3
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test

on: [push]

jobs:
Test:
name: ${{ matrix.os }} / Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [Ubuntu]
python-version: ['3.11', '3.9']
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v4

- name: Install poetry
run: python -m pip install poetry

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'

- name: Install dependencies
run: poetry install

- name: Run pytest
run: poetry run pytest -v --cov --cov-report xml --cov-report term

- name: Upload coverage
uses: codecov/codecov-action@v3
with:
#token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
fail_ci_if_error: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
.DS_Store
.venv
output
__pycache__
__pycache__
dist
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# csmap-py

![](./doc/csmap.png)

module to process CSMap, based on https://www.rinya.maff.go.jp/j/seibi/sagyoudo/attach/pdf/romou-12.pdf

```
Expand Down Expand Up @@ -29,3 +31,7 @@ options:
```sh
poetry run python -m csmap 12ke47_1mdem.tif --chunk_size 2048 --height_scale 200 500
```

## processing image

![](./doc/process.jpeg)
Binary file added doc/csmap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/process.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
759 changes: 103 additions & 656 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ description = ""
authors = ["Kanahiro <mediterranean1769@gmail.com>"]
license = "MIT"
readme = "README.md"
packages = [{include = "csmap_py"}]
packages = [{include = "csmap"}]

[tool.poetry.scripts]
csmap = "csmap.__main__:main"

[tool.poetry.dependencies]
python = "^3.10"
Expand All @@ -15,7 +18,8 @@ rasterio = "^1.3.9"

[tool.poetry.group.dev.dependencies]
ruff = "^0.1.6"
ipykernel = "^6.27.1"
pytest = "^7.4.3"
pytest-cov = "^4.1.0"

[build-system]
requires = ["poetry-core"]
Expand Down
Empty file added tests/__init__.py
Empty file.
Loading