Skip to content

Commit 9c3824a

Browse files
authored
Merge pull request #1 from jdhughes-usgs/main
feat(modflowapi): base files for modflowapi package
2 parents 9f5a089 + 3cc77da commit 9c3824a

11 files changed

Lines changed: 856 additions & 1 deletion

File tree

.flake8

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[flake8]
2+
exclude =
3+
.git,
4+
__pycache__,
5+
build,
6+
dist,
7+
examples,
8+
autotest
9+
ignore =
10+
# https://flake8.pycqa.org/en/latest/user/error-codes.html
11+
F401, # 'module' imported but unused
12+
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
13+
E121, # continuation line under-indented for hanging indent
14+
E122, # continuation line missing indentation or outdented
15+
E126, # continuation line over-indented for hanging indent
16+
E127, # continuation line over-indented for visual indent
17+
E128, # continuation line under-indented for visual indent
18+
E203, # whitespace before
19+
E221, # multiple spaces before operator
20+
E222, # multiple spaces after operator
21+
E226, # missing whitespace around arithmetic operator
22+
E231, # missing whitespace after ','
23+
E241, # multiple spaces after ','
24+
E402, # module level import not at top of file
25+
E501, # line too long (> 79 characters)
26+
E502, # backslash is redundant between brackets
27+
E722, # do not use bare 'except'
28+
E741, # ambiguous variable name
29+
W291, # trailing whitespace
30+
W292, # no newline at end of file
31+
W293, # blank line contains whitespace
32+
W391, # blank line at end of file
33+
W503, # line break before binary operator
34+
W504 # line break after binary operator
35+
36+
statistics = True

.gitattributes

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set the merge driver for windows files
8+
#
9+
*.bat text eol=crlf
10+
11+
# Denote all files that are truly binary and should not be modified.
12+
*.png binary
13+
*.jpg binary
14+
*.pdf binary
15+
16+
# Do not modify the model data in various directories
17+
examples/data/** binary
18+
examples/groundwater_paper/uspb/** binary

.github/workflows/ci.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: modflowapi continuous integration
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST)
6+
push:
7+
branches:
8+
- master
9+
- develop
10+
- 'release*'
11+
pull_request:
12+
branches: [master, develop]
13+
14+
jobs:
15+
16+
std_setup:
17+
name: standard installation
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
defaults:
22+
run:
23+
shell: bash
24+
25+
steps:
26+
27+
# check out repo
28+
- name: Checkout repo
29+
uses: actions/checkout@v2.3.4
30+
31+
- name: Setup Python 3.8
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: 3.8
35+
36+
- name: Upgrade pip
37+
run: |
38+
python -m pip install --upgrade pip
39+
40+
- name: Base installation
41+
run: |
42+
pip install .
43+
44+
- name: Print version
45+
run: |
46+
python -c "import modflowapi; print(modflowapi.__version__)"
47+
48+
49+
lint:
50+
name: linting
51+
runs-on: ubuntu-latest
52+
strategy:
53+
fail-fast: false
54+
defaults:
55+
run:
56+
shell: bash
57+
58+
if: github.event_name != 'schedule'
59+
steps:
60+
# check out repo
61+
- name: Checkout repo
62+
uses: actions/checkout@v2.3.4
63+
64+
# Standard python fails on windows without GDAL installation. Using
65+
# standard python here since only linting on linux.
66+
# Use standard bash shell with standard python
67+
- name: Setup Python 3.8
68+
uses: actions/setup-python@v2
69+
with:
70+
python-version: 3.8
71+
72+
- name: Print python version
73+
run: |
74+
python --version
75+
76+
- name: Install Python 3.8 packages
77+
run: |
78+
python -m pip install --upgrade pip
79+
pip install -r etc/requirements.pip.txt
80+
81+
- name: Run black
82+
run: |
83+
echo "if black check fails run"
84+
echo " black --line-length 79 ./modflowapi"
85+
echo "and then commit the changes."
86+
black --check --line-length 79 ./modflowapi
87+
88+
- name: Run flake8
89+
run: |
90+
flake8 --count --show-source --exit-zero ./modflowapi
91+
92+
- name: Run pylint
93+
run: |
94+
pylint --jobs=2 --errors-only --exit-zero ./modflowapi
95+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,6 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
# pycharm
132+
.idea/

0 commit comments

Comments
 (0)