Skip to content

Commit 0e6aa7d

Browse files
committed
add initial files
0 parents  commit 0e6aa7d

13 files changed

Lines changed: 525 additions & 0 deletions

.copier-answers.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Do not edit - changes here will be overwritten by Copier
2+
_commit: v1
3+
_src_path: gh:pydev-guide/pyrepo-copier
4+
author_email: kevin.yamauchi@gmail.com
5+
author_name: Kevin Yamauchi
6+
git_versioning: true
7+
github_username: kevinyamauchi
8+
minimum_python: 11
9+
mode: customize
10+
module_name: oz_viewer
11+
project_license: BSD-3-Clause
12+
project_name: oz-viewer
13+
project_short_description: A viewer for ome-zarr images.
14+
test_lowest_pinned_dependencies: false
15+
test_pre_release: true
16+
use_mypy: false
17+
use_pre_commit: true
18+
use_ruff: true
19+

.github/ISSUE_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
* oz-viewer version:
2+
* Python version:
3+
* Operating System:
4+
5+
### Description
6+
7+
Describe what you were trying to get done.
8+
Tell us what happened, what went wrong, and what you expected to happen.
9+
10+
### What I Did
11+
12+
```
13+
Paste the command(s) you ran and the output.
14+
If there was a crash, please include the traceback here.
15+
```

.github/TEST_FAIL_TEMPLATE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: "{{ env.TITLE }}"
3+
labels: [bug]
4+
---
5+
The {{ workflow }} workflow failed on {{ date | date("YYYY-MM-DD HH:mm") }} UTC
6+
7+
The most recent failing test was on {{ env.PLATFORM }} py{{ env.PYTHON }}
8+
with commit: {{ sha }}
9+
10+
Full run: https://github.com/{{ repo }}/actions/runs/{{ env.RUN_ID }}
11+
12+
(This post will be updated if another test fails, as long as this issue remains open.)

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: "github-actions"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"
9+
commit-message:
10+
prefix: "ci(dependabot):"

.github/workflows/ci.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: [v*]
7+
pull_request:
8+
workflow_dispatch:
9+
schedule:
10+
# run every week (for --pre release tests)
11+
- cron: "0 0 * * 0"
12+
13+
# cancel in-progress runs that use the same workflow and branch
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
check-manifest:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v5
23+
- run: pipx run check-manifest
24+
25+
test:
26+
name: ${{ matrix.platform }} (${{ matrix.python-version }})
27+
runs-on: ${{ matrix.platform }}
28+
env:
29+
UV_PRERELEASE: ${{ github.event_name == 'schedule' && 'allow' || 'if-necessary-or-explicit' }}
30+
strategy:
31+
fail-fast: false
32+
matrix:
33+
python-version: ["3.11", "3.12", "3.13", "3.14"]
34+
platform: [ubuntu-latest, macos-latest, windows-latest]
35+
36+
steps:
37+
- uses: actions/checkout@v5
38+
39+
- name: 🐍 Set up Python ${{ matrix.python-version }}
40+
uses: astral-sh/setup-uv@v6
41+
with:
42+
python-version: ${{ matrix.python-version }}
43+
enable-cache: true
44+
45+
- name: Install Dependencies
46+
run: uv sync --no-dev --group test
47+
48+
- name: 🧪 Run Tests
49+
run: uv run pytest --cov --cov-report=xml --cov-report=term-missing
50+
51+
# If something goes wrong with --pre tests, we can open an issue in the repo
52+
- name: 📝 Report --pre Failures
53+
if: failure() && github.event_name == 'schedule'
54+
uses: JasonEtco/create-an-issue@v2
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
PLATFORM: ${{ matrix.platform }}
58+
PYTHON: ${{ matrix.python-version }}
59+
RUN_ID: ${{ github.run_id }}
60+
TITLE: "[test-bot] pip install --pre is failing"
61+
with:
62+
filename: .github/TEST_FAIL_TEMPLATE.md
63+
update_existing: true
64+
65+
- name: Coverage
66+
uses: codecov/codecov-action@v5
67+
# with:
68+
# token: ${{ secrets.CODECOV_TOKEN }}
69+
70+
build-and-inspect-package:
71+
name: Build & inspect package.
72+
needs: test
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@v5
76+
with:
77+
fetch-depth: 0
78+
- uses: hynek/build-and-inspect-python-package@v2
79+
80+
upload-to-pypi:
81+
name: Upload package to PyPI
82+
needs: build-and-inspect-package
83+
if: success() && startsWith(github.ref, 'refs/tags/') && github.event_name != 'schedule'
84+
runs-on: ubuntu-latest
85+
permissions:
86+
# IMPORTANT: this permission is mandatory for trusted publishing on PyPi
87+
# see https://docs.pypi.org/trusted-publishers/
88+
id-token: write
89+
# This permission allows writing releases
90+
contents: write
91+
92+
steps:
93+
- name: Download built artifact to dist/
94+
uses: actions/download-artifact@v5
95+
with:
96+
name: Packages
97+
path: dist
98+
- name: 🚢 Publish to PyPI
99+
uses: pypa/gh-action-pypi-publish@release/v1
100+
- uses: softprops/action-gh-release@v2
101+
with:
102+
generate_release_notes: true
103+
files: './dist/*'

.gitignore

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
28+
.DS_Store
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
.hypothesis/
50+
.pytest_cache/
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
local_settings.py
59+
60+
# Flask stuff:
61+
instance/
62+
.webassets-cache
63+
64+
# Scrapy stuff:
65+
.scrapy
66+
67+
# Sphinx documentation
68+
docs/_build/
69+
70+
# PyBuilder
71+
target/
72+
73+
# Jupyter Notebook
74+
.ipynb_checkpoints
75+
76+
# pyenv
77+
.python-version
78+
79+
# celery beat schedule file
80+
celerybeat-schedule
81+
82+
# SageMath parsed files
83+
*.sage.py
84+
85+
# dotenv
86+
.env
87+
88+
# virtualenv
89+
.venv
90+
venv/
91+
ENV/
92+
93+
# Spyder project settings
94+
.spyderproject
95+
.spyproject
96+
97+
# Rope project settings
98+
.ropeproject
99+
100+
# mkdocs documentation
101+
/site
102+
103+
# mypy
104+
.mypy_cache/
105+
106+
# ruff
107+
.ruff_cache/
108+
109+
# IDE settings
110+
.vscode/
111+
.idea/

.pre-commit-config.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# enable pre-commit.ci at https://pre-commit.ci/
2+
# it adds:
3+
# 1. auto fixing pull requests
4+
# 2. auto updating the pre-commit configuration
5+
ci:
6+
autoupdate_schedule: monthly
7+
autofix_commit_msg: "style(pre-commit.ci): auto fixes [...]"
8+
autoupdate_commit_msg: "ci(pre-commit.ci): autoupdate"
9+
10+
repos:
11+
- repo: https://github.com/abravalheri/validate-pyproject
12+
rev: v0.24.1
13+
hooks:
14+
- id: validate-pyproject
15+
16+
- repo: https://github.com/rhysd/actionlint
17+
rev: v1.7.7
18+
hooks:
19+
- id: actionlint
20+
21+
- repo: https://github.com/adhtruong/mirrors-typos
22+
rev: v1.36.2
23+
hooks:
24+
- id: typos
25+
args: [--force-exclude] # omitting --write-changes
26+
27+
- repo: https://github.com/astral-sh/ruff-pre-commit
28+
rev: v0.13.0
29+
hooks:
30+
- id: ruff-check
31+
args: [--fix] # may also add '--unsafe-fixes'
32+
- id: ruff-format

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2023, Kevin Yamauchi
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
3. Neither the name of the copyright holder nor the names of its
16+
contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# oz-viewer
2+
3+
[![License](https://img.shields.io/pypi/l/oz-viewer.svg?color=green)](https://github.com/kevinyamauchi/oz-viewer/raw/main/LICENSE)
4+
[![PyPI](https://img.shields.io/pypi/v/oz-viewer.svg?color=green)](https://pypi.org/project/oz-viewer)
5+
[![Python Version](https://img.shields.io/pypi/pyversions/oz-viewer.svg?color=green)](https://python.org)
6+
[![CI](https://github.com/kevinyamauchi/oz-viewer/actions/workflows/ci.yml/badge.svg)](https://github.com/kevinyamauchi/oz-viewer/actions/workflows/ci.yml)
7+
[![codecov](https://codecov.io/gh/kevinyamauchi/oz-viewer/branch/main/graph/badge.svg)](https://codecov.io/gh/kevinyamauchi/oz-viewer)
8+
9+
A viewer for ome-zarr images.
10+
11+
## Development
12+
13+
The easiest way to get started is to use the [github cli](https://cli.github.com)
14+
and [uv](https://docs.astral.sh/uv/getting-started/installation/):
15+
16+
```sh
17+
gh repo fork kevinyamauchi/oz-viewer --clone
18+
# or just
19+
# gh repo clone kevinyamauchi/oz-viewer
20+
cd oz-viewer
21+
uv sync
22+
```
23+
24+
Run tests:
25+
26+
```sh
27+
uv run pytest
28+
```
29+
30+
Lint files:
31+
32+
```sh
33+
uv run pre-commit run --all-files
34+
```

0 commit comments

Comments
 (0)