Skip to content

Commit 4dcaead

Browse files
author
Joseph Hamman
committed
initial commit with code
1 parent b806c49 commit 4dcaead

File tree

15 files changed

+399
-1
lines changed

15 files changed

+399
-1
lines changed

.coveragerc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[report]
2+
omit =
3+
tests/*.py
4+
setup.py
5+
test.py
6+
exclude_lines =
7+
pragma: no cover

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
# Check for updates to GitHub Actions every weekday
11+
interval: "daily"

.github/workflows/main.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: "*"
6+
pull_request:
7+
branches: main
8+
schedule:
9+
- cron: "0 0 * * *"
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/[email protected]
16+
- uses: actions/[email protected]
17+
- uses: pre-commit/[email protected]
18+
19+
test:
20+
name: ${{ matrix.python-version }}-build
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
python-version: [3.8, 3.9]
25+
steps:
26+
- uses: actions/[email protected]
27+
- name: Setup Python
28+
uses: actions/[email protected]
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
architecture: x64
32+
- uses: actions/[email protected]
33+
with:
34+
path: ~/.cache/pip
35+
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }}
36+
restore-keys: |
37+
${{ runner.os }}-pip-
38+
- run: |
39+
python -m pip install -r dev-requirements.txt
40+
python -m pip install --no-deps -e .
41+
python -m pip list
42+
- name: Running Tests
43+
run: |
44+
python -m pytest --cov=./ --cov-report=xml --verbose
45+
- name: Upload coverage to Codecov
46+
uses: codecov/[email protected]
47+
if: ${{ matrix.python-version }} == 3.9
48+
with:
49+
file: ./coverage.xml
50+
fail_ci_if_error: false
51+
52+
test-upstream:
53+
name: ${{ matrix.python-version }}-dev-build
54+
runs-on: ubuntu-latest
55+
strategy:
56+
matrix:
57+
python-version: [3.9]
58+
steps:
59+
- uses: actions/[email protected]
60+
- name: Setup Python
61+
uses: actions/[email protected]
62+
with:
63+
python-version: ${{ matrix.python-version }}
64+
architecture: x64
65+
- uses: actions/[email protected]
66+
with:
67+
path: ~/.cache/pip
68+
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev-requirements.txt') }}
69+
restore-keys: |
70+
${{ runner.os }}-pip-
71+
- run: |
72+
python -m pip install -r dev-requirements.txt
73+
python -m pip install --no-deps --upgrade \
74+
git+https://github.com/pydata/xarray
75+
python -m pip install --no-deps -e .
76+
python -m pip list
77+
- name: Running Tests
78+
run: |
79+
python -m pytest --verbose

.github/workflows/pypipublish.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/[email protected]
12+
- name: Set up Python
13+
uses: actions/[email protected]
14+
with:
15+
python-version: "3.x"
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
python -m pip install setuptools setuptools-scm wheel twine
20+
- name: Build and publish
21+
env:
22+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24+
run: |
25+
python setup.py sdist bdist_wheel
26+
twine upload dist/*

.pre-commit-config.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.0.1
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-docstring-first
8+
- id: check-json
9+
- id: check-yaml
10+
- id: double-quote-string-fixer
11+
12+
- repo: https://github.com/ambv/black
13+
rev: 21.6b0
14+
hooks:
15+
- id: black
16+
args: ["--line-length", "100", "--skip-string-normalization"]
17+
18+
- repo: https://gitlab.com/pycqa/flake8
19+
rev: 3.9.2
20+
hooks:
21+
- id: flake8
22+
- repo: https://github.com/asottile/seed-isort-config
23+
rev: v2.2.0
24+
hooks:
25+
- id: seed-isort-config
26+
- repo: https://github.com/pre-commit/mirrors-isort
27+
rev: v5.8.0
28+
hooks:
29+
- id: isort
30+
31+
- repo: https://github.com/pre-commit/mirrors-prettier
32+
rev: v2.2.0
33+
hooks:
34+
- id: prettier
35+
language_version: system

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# xarray-schema
1+
# xarray-schema

codecov.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
codecov:
2+
max_report_age: off
3+
4+
comment: false
5+
6+
coverage:
7+
precision: 2
8+
round: down
9+
status:
10+
project:
11+
default:
12+
threshold: 0%
13+
patch:
14+
default:
15+
threshold: 0%
16+
if_no_uploads: error
17+
if_not_found: success
18+
if_ci_failed: error
19+
only_pulls: false
20+
changes:
21+
default:
22+
threshold: 0%
23+
if_not_found: success

dev-requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pytest
2+
pytest-cov
3+
-r requirements.txt

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
xarray>=0.16

setup.cfg

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[flake8]
2+
exclude = docs
3+
ignore = E203,E266,E501,W503,E722,E402,C901
4+
per-file-ignores =
5+
max-line-length = 100
6+
max-complexity = 18
7+
select = B,C,E,F,W,T4,B9
8+
9+
[isort]
10+
known_first_party=xarray_schema
11+
known_third_party=numpy,pkg_resources,setuptools,xarray
12+
multi_line_output=3
13+
include_trailing_comma=True
14+
force_grid_wrap=0
15+
combine_as_imports=True
16+
line_length=100
17+
skip=
18+
docs/source/conf.py
19+
setup.py
20+
21+
[tool:pytest]
22+
log_cli = True
23+
log_level = INFO

0 commit comments

Comments
 (0)