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

feat(modflowapi): base files for modflowapi package #1

Merged
merged 1 commit into from
May 11, 2021
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 .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[flake8]
exclude =
.git,
__pycache__,
build,
dist,
examples,
autotest
ignore =
# https://flake8.pycqa.org/en/latest/user/error-codes.html
F401, # 'module' imported but unused
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
E121, # continuation line under-indented for hanging indent
E122, # continuation line missing indentation or outdented
E126, # continuation line over-indented for hanging indent
E127, # continuation line over-indented for visual indent
E128, # continuation line under-indented for visual indent
E203, # whitespace before
E221, # multiple spaces before operator
E222, # multiple spaces after operator
E226, # missing whitespace around arithmetic operator
E231, # missing whitespace after ','
E241, # multiple spaces after ','
E402, # module level import not at top of file
E501, # line too long (> 79 characters)
E502, # backslash is redundant between brackets
E722, # do not use bare 'except'
E741, # ambiguous variable name
W291, # trailing whitespace
W292, # no newline at end of file
W293, # blank line contains whitespace
W391, # blank line at end of file
W503, # line break before binary operator
W504 # line break after binary operator

statistics = True
18 changes: 18 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set the merge driver for windows files
#
*.bat text eol=crlf

# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.pdf binary

# Do not modify the model data in various directories
examples/data/** binary
examples/groundwater_paper/uspb/** binary
95 changes: 95 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: modflowapi continuous integration

on:
schedule:
- cron: '0 8 * * *' # run at 8 AM UTC (12 am PST)
push:
branches:
- master
- develop
- 'release*'
pull_request:
branches: [master, develop]

jobs:

std_setup:
name: standard installation
runs-on: ubuntu-latest
strategy:
fail-fast: false
defaults:
run:
shell: bash

steps:

# check out repo
- name: Checkout repo
uses: actions/checkout@v2.3.4

- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Upgrade pip
run: |
python -m pip install --upgrade pip

- name: Base installation
run: |
pip install .

- name: Print version
run: |
python -c "import modflowapi; print(modflowapi.__version__)"


lint:
name: linting
runs-on: ubuntu-latest
strategy:
fail-fast: false
defaults:
run:
shell: bash

if: github.event_name != 'schedule'
steps:
# check out repo
- name: Checkout repo
uses: actions/checkout@v2.3.4

# Standard python fails on windows without GDAL installation. Using
# standard python here since only linting on linux.
# Use standard bash shell with standard python
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Print python version
run: |
python --version

- name: Install Python 3.8 packages
run: |
python -m pip install --upgrade pip
pip install -r etc/requirements.pip.txt

- name: Run black
run: |
echo "if black check fails run"
echo " black --line-length 79 ./modflowapi"
echo "and then commit the changes."
black --check --line-length 79 ./modflowapi

- name: Run flake8
run: |
flake8 --count --show-source --exit-zero ./modflowapi

- name: Run pylint
run: |
pylint --jobs=2 --errors-only --exit-zero ./modflowapi

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# pycharm
.idea/
Loading