Skip to content

Commit 61ccbb6

Browse files
authored
Use pyproject.toml for project metadata, add citation info (MODFLOW-ORG#11)
1 parent e0ca9e8 commit 61ccbb6

File tree

9 files changed

+176
-168
lines changed

9 files changed

+176
-168
lines changed

.flake8

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,24 @@ exclude =
88
autotest
99
ignore =
1010
# https://flake8.pycqa.org/en/latest/user/error-codes.html
11-
F401, # 'module' imported but unused
11+
# 'module' imported but unused
12+
F401,
1213
# 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
14+
# E1: Indentation
15+
E121, E122, E126, E127, E128,
16+
# E2: Whitespace
17+
E203, E221, E222, E226, E231, E241,
18+
# E4: Import
19+
E402,
20+
# E5: Line length
21+
E501, E502,
22+
# E7: Statement
23+
E722, E741,
24+
# W2: Whitespace warning
25+
W291, W292, W293,
26+
# W3: Blank line warning
27+
W391,
28+
# W5: Line break warning
29+
W503, W504
3530

3631
statistics = True

.github/workflows/ci.yml

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
- name: Checkout repo
2929
uses: actions/checkout@v3
3030

31-
- name: Setup Python 3.8
31+
- name: Setup Python
3232
uses: actions/setup-python@v4
3333
with:
34-
python-version: 3.8
34+
python-version: 3.x
3535

3636
- name: Upgrade pip
3737
run: |
@@ -64,29 +64,26 @@ jobs:
6464
# Standard python fails on Windows without GDAL installation. Using
6565
# standard python here since only linting on linux.
6666
# Use standard bash shell with standard python
67-
- name: Setup Python 3.8
67+
- name: Setup Python
6868
uses: actions/setup-python@v4
6969
with:
70-
python-version: 3.8
71-
cache: 'pip'
72-
cache-dependency-path: setup.cfg
70+
python-version: 3.x
7371

7472
- name: Print python version
7573
run: |
7674
python --version
7775
78-
- name: Install Python dependencies
76+
- name: Install Python packages
7977
run: |
8078
python -m pip install --upgrade pip
81-
pip install .
82-
pip install ".[lint]"
79+
pip install -e .[lint]
8380
8481
- name: Run black
8582
run: |
8683
echo "if black check fails run"
87-
echo " black --line-length 79 ./modflowapi"
84+
echo " black ./modflowapi"
8885
echo "and then commit the changes."
89-
black --check --line-length 79 ./modflowapi
86+
black --check ./modflowapi
9087
9188
- name: Run flake8
9289
run: |
@@ -104,7 +101,7 @@ jobs:
104101
fail-fast: false
105102
matrix:
106103
os: [ ubuntu-latest, macos-latest, windows-latest ]
107-
python-version: [ 3.8, 3.9, "3.10"]
104+
python-version: [ 3.8, 3.9, "3.10", "3.11" ]
108105
defaults:
109106
run:
110107
shell: bash
@@ -119,21 +116,14 @@ jobs:
119116
with:
120117
python-version: ${{ matrix.python-version }}
121118
cache: 'pip'
122-
cache-dependency-path: setup.cfg
119+
cache-dependency-path: pyproject.toml
123120

124121
- name: Install Python dependencies
125-
if: runner.os != 'Windows'
126122
run: |
127123
pip install --upgrade pip
128-
pip install .
129-
pip install ".[test]"
130-
131-
- name: Install Python dependencies Windows
132-
if: runner.os == 'Windows'
133-
run: |
134-
python.exe -m pip install --upgrade pip
135-
python.exe -m pip install .
136-
python.exe -m pip install ".[test]"
124+
pip install git+https://git@github.com/Deltares/xmipy@develop
125+
pip install git+https://git@github.com/MODFLOW-USGS/modflow-devtools@develop
126+
pip install .[test]
137127
138128
- name: Install modflow executables
139129
uses: modflowpy/install-modflow-action@v1
@@ -156,7 +146,7 @@ jobs:
156146
fail-fast: false
157147
matrix:
158148
os: [ ubuntu-latest, macos-latest, windows-latest ]
159-
python-version: [ 3.8, 3.9, "3.10"]
149+
python-version: [ 3.8, 3.9, "3.10", "3.11" ]
160150
defaults:
161151
run:
162152
shell: bash
@@ -171,21 +161,14 @@ jobs:
171161
with:
172162
python-version: ${{ matrix.python-version }}
173163
cache: 'pip'
174-
cache-dependency-path: setup.cfg
164+
cache-dependency-path: pyproject.toml
175165

176166
- name: Install Python dependencies
177-
if: runner.os != 'Windows'
178167
run: |
179168
pip install --upgrade pip
180-
pip install .
181-
pip install ".[test]"
182-
183-
- name: Install Python dependencies Windows
184-
if: runner.os == 'Windows'
185-
run: |
186-
python.exe -m pip install --upgrade pip
187-
python.exe -m pip install .
188-
python.exe -m pip install ".[test]"
169+
pip install git+https://git@github.com/Deltares/xmipy@develop
170+
pip install git+https://git@github.com/MODFLOW-USGS/modflow-devtools@develop
171+
pip install .[test]
189172
190173
- name: Install modflow executables
191174
uses: modflowpy/install-modflow-action@v1
@@ -198,4 +181,4 @@ jobs:
198181
shell: bash -l {0}
199182
run: |
200183
# chmod a+x libmf6*
201-
pytest -n auto -m "mf6 and not extensions"
184+
pytest -n auto -m "mf6 and not extensions"

CITATION.cff

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
cff-version: 1.2.0
2+
message: If you use this software, please cite both the article from preferred-citation
3+
and the software itself.
4+
type: software
5+
title: MODFLOW API
6+
version: 0.0.1
7+
date-released: '2021-05-12'
8+
abstract: An extension to xmipy for the MODFLOW API.
9+
repository-artifact: https://pypi.org/project/modflowapi
10+
repository-code: https://github.com/MODFLOW-USGS/modflowapi
11+
license: CC0-1.0
12+
authors:
13+
- family-names: Hughes
14+
given-names: Joseph D.
15+
alias: jdhughes-usgs
16+
affiliation: U.S. Geological Survey
17+
orcid: https://orcid.org/0000-0003-1311-2354
18+
- family-names: Russcher
19+
given-names: Martijn
20+
alias: mjr-deltares
21+
affiliation: Deltares
22+
orcid: https://orcid.org/0000-0001-8799-6514
23+
- family-names: Langevin
24+
given-names: Christian D.
25+
alias: langevin-usgs
26+
affiliation: U.S. Geological Survey
27+
orcid: https://orcid.org/0000-0001-5610-9759
28+
- family-names: Hofer
29+
given-names: Julian
30+
alias: Hofer-Julian
31+
affiliation: Deltares
32+
- family-names: Larsen
33+
given-names: Joshua D.
34+
alias: jlarsen-usgs
35+
affiliation: U.S. Geological Survey
36+
orcid: https://orcid.org/0000-0002-1218-800X
37+
preferred-citation:
38+
type: article
39+
authors:
40+
- family-names: Hughes
41+
given-names: Joseph D.
42+
orcid: https://orcid.org/0000-0003-1311-2354
43+
- family-names: Russcher
44+
given-names: Martijn J.
45+
orcid: https://orcid.org/0000-0001-8799-6514
46+
- family-names: Langevin
47+
given-names: Christian D.
48+
orcid: https://orcid.org/0000-0001-5610-9759
49+
- family-names: Morway
50+
given-names: Eric D.
51+
orcid: https://orcid.org/0000-0002-8553-6140
52+
- family-names: McDonald
53+
given-names: Richard R.
54+
orcid: https://orcid.org/0000-0002-0703-0638
55+
title: The MODFLOW Application Programming Interface for simulation control and software interoperability
56+
doi: 10.1016/j.envsoft.2021.105257
57+
journal: Environmental Modelling & Software
58+
volume: 138
59+
start: 105257
60+
year: 2022
61+
month: 2

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ and additional functionality specific to the MODFLOW API. Currently it is a join
99
```
1010
pip install modflowapi
1111
```
12+
13+
### Citation
14+
15+
Hughes, Joseph D., Russcher, M. J., Langevin, C. D., Morway, E. D. and McDonald, R. R., 2022, The MODFLOW Application Programming Interface for simulationcontrol and software interoperability: Environmental Modelling & Software, v. 148, p. 105257, [doi:10.1016/j.envsoft.2021.105257](https://doi.org/10.1016/j.envsoft.2021.105257).

etc/requirements.pip.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

guide-to-publish.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
1) If present delete dist folder
44

5-
2) If not done yet, install twine via
5+
2) If not done yet, install build and twine via
66
```
7-
pip install twine
7+
pip install build twine
88
```
9-
3) Update the version number in the setup.py file.
9+
3) Update the version in ``modflowapi/version.py``
1010

1111
4) Re-create the wheels:
1212
```
13-
python setup.py sdist bdist_wheel
13+
python -m build
1414
```
1515
5) Re-upload the new files:
1616
```
1717
twine upload dist/*
18-
```
18+
```

pyproject.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
[build-system]
2+
requires = ["setuptools >=61"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "modflowapi"
7+
dynamic = ["version"]
8+
authors = [
9+
{name = "Joseph D. Hughes", email = "jdhughes@usgs.gov"},
10+
{name = "Martijn Russcher", email = "Martijn.Russcher@deltares.nl"},
11+
{name = "Christian D. Langevin", email = "langevin@usgs.gov"},
12+
{name = "Julian Hofer", email = "Julian.Hofer@deltares.nl"},
13+
{name = "Joshua D. Larsen", email = "jlarsen@usgs.gov"},
14+
]
15+
maintainers = [
16+
{name = "Joseph D. Hughes", email = "jdhughes@usgs.gov"},
17+
]
18+
description = "modflowapi is an extension to the xmipy Python package"
19+
readme = "README.md"
20+
keywords = ["MODFLOW", "groundwater", "hydrogeology", "bmi", "xmi"]
21+
license = {text = "CC0"}
22+
classifiers = [
23+
"Intended Audience :: Science/Research",
24+
"License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
25+
"Programming Language :: Python :: 3",
26+
"Programming Language :: Python :: 3 :: Only",
27+
"Programming Language :: Python :: 3.8",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
"Topic :: Scientific/Engineering :: Hydrology",
32+
]
33+
requires-python = ">=3.8"
34+
dependencies = [
35+
"numpy",
36+
"pandas",
37+
"xmipy", # develop branch from github.com/Deltares/xmipy
38+
]
39+
40+
[project.optional-dependencies]
41+
dev = ["modflowapi[test,lint]"]
42+
test = [
43+
"filelock",
44+
"modflow-devtools", # develop branch from github.com/MODFLOW-USGS/modflow-devtools
45+
"pytest",
46+
"pytest-order",
47+
"pytest-xdist",
48+
]
49+
lint = [
50+
"black",
51+
"flake8",
52+
"pylint",
53+
]
54+
55+
[project.urls]
56+
Repository = "https://github.com/MODFLOW-USGS/modflowapi"
57+
Publication = "https://doi.org/10.1016/j.envsoft.2021.105257"
58+
59+
[tool.setuptools.dynamic]
60+
version = {attr = "modflowapi.version.__version__"}
61+
62+
[tool.setuptools.packages.find]
63+
include = ["modflowapi", "modflowapi.*"]
64+
65+
[tool.black]
66+
line-length = 79
67+
target_version = ["py37"]

0 commit comments

Comments
 (0)