Skip to content

Commit 92ac70e

Browse files
committed
Initial setup
1 parent ea15e6c commit 92ac70e

10 files changed

Lines changed: 322 additions & 135 deletions

File tree

.github/workflows/release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_artifacts:
7+
name: Build wheel on ubuntu-latest
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
submodules: true
16+
fetch-depth: 0
17+
18+
- uses: actions/setup-python@v5.2.0
19+
name: Install Python
20+
with:
21+
python-version: "3.11"
22+
23+
- name: Install PyBuild
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install hatch
27+
- name: Build wheel and sdist
28+
run: hatch build
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: releases
32+
path: dist
33+
34+
test_dist_pypi:
35+
needs: [build_artifacts]
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/download-artifact@v4
39+
with:
40+
name: releases
41+
path: dist
42+
43+
- name: test
44+
run: |
45+
ls
46+
ls dist
47+
48+
upload_pypi:
49+
needs: [build_artifacts]
50+
runs-on: ubuntu-latest
51+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
52+
steps:
53+
- uses: actions/download-artifact@v4
54+
with:
55+
name: releases
56+
path: dist
57+
- uses: pypa/gh-action-pypi-publish@v1.12.4
58+
with:
59+
user: __token__
60+
password: ${{ secrets.pypi_password }}
61+
# To test: repository_url: https://test.pypi.org/legacy/

.github/workflows/test.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Test
5+
6+
on:
7+
push:
8+
branches: [ main ]
9+
pull_request:
10+
branches: [ main ]
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
test:
19+
name: os=${{ matrix.os }}, py=${{ matrix.python-version }}
20+
21+
strategy:
22+
matrix:
23+
python-version: [3.12']
24+
os: ["ubuntu-latest"]
25+
runs-on: ${{ matrix.os }}
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0 # grab all branches and tags
31+
- name: Set up Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
cache: 'pip'
36+
- name: Install Hatch
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install hatch
40+
- name: Set Up Hatch Env
41+
run: |
42+
hatch env create upstream
43+
hatch env run -e upstream list-env
44+
- name: Run Tests
45+
env:
46+
HYPOTHESIS_PROFILE: ci
47+
run: |
48+
hatch env run --env upstream run-coverage
49+
- name: Upload coverage
50+
uses: codecov/codecov-action@v5
51+
with:
52+
token: ${{ secrets.CODECOV_TOKEN }}
53+
verbose: true # optional (default = false)

.gitignore

Lines changed: 25 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
33
*.py[cod]
4-
*$py.class
54

65
# C extensions
76
*.so
87

98
# Distribution / packaging
109
.Python
10+
env/
11+
.venv/
1112
build/
1213
develop-eggs/
1314
dist/
@@ -19,12 +20,9 @@ lib64/
1920
parts/
2021
sdist/
2122
var/
22-
wheels/
23-
share/python-wheels/
2423
*.egg-info/
2524
.installed.cfg
2625
*.egg
27-
MANIFEST
2826

2927
# PyInstaller
3028
# Usually these files are written by a python script from a template
@@ -38,157 +36,50 @@ pip-delete-this-directory.txt
3836

3937
# Unit test / coverage reports
4038
htmlcov/
41-
.tox/
42-
.nox/
4339
.coverage
4440
.coverage.*
4541
.cache
46-
nosetests.xml
4742
coverage.xml
48-
*.cover
49-
*.py,cover
50-
.hypothesis/
51-
.pytest_cache/
52-
cover/
43+
*,cover
5344

5445
# Translations
5546
*.mo
5647
*.pot
5748

5849
# Django stuff:
5950
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
7051

7152
# Sphinx documentation
7253
docs/_build/
54+
docs/api
55+
docs/data
56+
data
57+
data.zip
7358

7459
# PyBuilder
75-
.pybuilder/
7660
target/
7761

78-
# Jupyter Notebook
79-
.ipynb_checkpoints
80-
81-
# IPython
82-
profile_default/
83-
ipython_config.py
84-
85-
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# UV
98-
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
#uv.lock
102-
103-
# poetry
104-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105-
# This is especially recommended for binary packages to ensure reproducibility, and is more
106-
# commonly ignored for libraries.
107-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108-
#poetry.lock
109-
110-
# pdm
111-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112-
#pdm.lock
113-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114-
# in version control.
115-
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116-
.pdm.toml
117-
.pdm-python
118-
.pdm-build/
119-
120-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121-
__pypackages__/
122-
123-
# Celery stuff
124-
celerybeat-schedule
125-
celerybeat.pid
126-
127-
# SageMath parsed files
128-
*.sage.py
129-
130-
# Environments
131-
.env
132-
.venv
133-
env/
134-
venv/
135-
ENV/
136-
env.bak/
137-
venv.bak/
138-
139-
# Spyder project settings
140-
.spyderproject
141-
.spyproject
142-
143-
# Rope project settings
144-
.ropeproject
62+
# PyCharm
63+
.idea
14564

146-
# mkdocs documentation
147-
/site
65+
# Jupyter
66+
.ipynb_checkpoints/
14867

149-
# mypy
150-
.mypy_cache/
151-
.dmypy.json
152-
dmypy.json
68+
# VCS versioning
69+
src/obspec_utils/_version.py
15370

154-
# Pyre type checker
155-
.pyre/
71+
# emacs
72+
*~
15673

157-
# pytype static type analyzer
158-
.pytype/
74+
# VSCode
75+
.vscode/
15976

160-
# Cython debug symbols
161-
cython_debug/
77+
# test data
78+
data/*
79+
src/fixture/
80+
fixture/
81+
junit.xml
16282

163-
# PyCharm
164-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166-
# and can be added to the global gitignore or merged into this file. For a more nuclear
167-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168-
#.idea/
169-
170-
# Abstra
171-
# Abstra is an AI-powered process automation framework.
172-
# Ignore directories containing user credentials, local state, and settings.
173-
# Learn more at https://abstra.io/docs
174-
.abstra/
175-
176-
# Visual Studio Code
177-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
178-
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
179-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
180-
# you could uncomment the following to ignore the enitre vscode folder
181-
# .vscode/
182-
183-
# Ruff stuff:
184-
.ruff_cache/
185-
186-
# PyPI configuration file
187-
.pypirc
188-
189-
# Cursor
190-
# Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
191-
# exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
192-
# refer to https://docs.cursor.com/context/ignore-files
193-
.cursorignore
194-
.cursorindexingignore
83+
.DS_Store
84+
tests/.hypothesis
85+
.hypothesis/

.pre-commit-config.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
default_stages: [pre-commit, pre-push]
2+
repos:
3+
- repo: https://github.com/astral-sh/ruff-pre-commit
4+
rev: v0.8.6
5+
hooks:
6+
- id: ruff
7+
args: ["--fix", "--show-fixes"]
8+
- id: ruff-format
9+
- repo: https://github.com/codespell-project/codespell
10+
rev: v2.3.0
11+
hooks:
12+
- id: codespell
13+
args: ["-L", "fo,ihs,kake,te", "-S", "fixture"]
14+
15+
- repo: https://github.com/pre-commit/pre-commit-hooks
16+
rev: v5.0.0
17+
hooks:
18+
- id: check-yaml
19+
- id: trailing-whitespace
20+
- repo: https://github.com/pre-commit/mirrors-mypy
21+
rev: v1.14.1
22+
hooks:
23+
- id: mypy
24+
files: src|tests
25+
additional_dependencies:
26+
# Package dependencies
27+
- packaging
28+
- donfig
29+
- numcodecs[crc32c]
30+
- numpy==2.1 # until https://github.com/numpy/numpy/issues/28034 is resolved
31+
- typing_extensions
32+
- universal-pathlib
33+
# Tests
34+
- pytest

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright [2025] [obspec-utils developers]
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Obspec Utils
2+
3+
[![PyPI - Version](https://img.shields.io/pypi/v/obspec-utils.svg)](https://pypi.org/project/obspec-utils)
4+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/obspec-utils.svg)](https://pypi.org/project/obspec-utils)
5+
6+
-----
7+
8+
## Table of Contents
9+
10+
- [Installation](#installation)
11+
- [License](#license)
12+
13+
## Installation
14+
15+
```console
16+
git clone https://github.com/virtual-zarr/obspec-utils.git
17+
cd obspec-utils
18+
hatch env create
19+
```
20+
21+
## License
22+
23+
`obspec-utils` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.

0 commit comments

Comments
 (0)