Skip to content

Commit bc4d8a4

Browse files
authored
Merge pull request #45 from csdms/mcflugen/use-argparse
Use argparse instead of click
2 parents 3447c93 + fd5c3b3 commit bc4d8a4

23 files changed

+279
-530
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,6 @@ jobs:
4545

4646
debug: true
4747

48-
lint:
49-
runs-on: ubuntu-latest
50-
steps:
51-
- uses: actions/checkout@v4
52-
- uses: wntrblm/[email protected]
53-
with:
54-
python-versions: "3.12"
55-
- name: Lint
56-
run: nox --non-interactive --error-on-missing-interpreter --session "lint"
57-
58-
5948
coveralls_finish:
6049
needs: build-and-test
6150
runs-on: ubuntu-latest

.gitignore

Lines changed: 4 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,7 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
1+
*.egg-info/
32
*.py[cod]
4-
*$py.class
5-
6-
# C extensions
7-
*.so
8-
9-
# Distribution / packaging
10-
.Python
3+
.coverage
4+
.nox/
5+
__pycache__/
116
build/
12-
develop-eggs/
137
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
*.egg-info/
24-
.installed.cfg
25-
*.egg
26-
MANIFEST
27-
28-
# PyInstaller
29-
# Usually these files are written by a python script from a template
30-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31-
*.manifest
32-
*.spec
33-
34-
# Installer logs
35-
pip-log.txt
36-
pip-delete-this-directory.txt
37-
38-
# Unit test / coverage reports
39-
htmlcov/
40-
.tox/
41-
.coverage
42-
.coverage.*
43-
.cache
44-
nosetests.xml
45-
coverage.xml
46-
*.cover
47-
.hypothesis/
48-
.pytest_cache/
49-
50-
# Translations
51-
*.mo
52-
*.pot
53-
54-
# Django stuff:
55-
*.log
56-
local_settings.py
57-
db.sqlite3
58-
59-
# Flask stuff:
60-
instance/
61-
.webassets-cache
62-
63-
# Scrapy stuff:
64-
.scrapy
65-
66-
# Sphinx documentation
67-
docs/_build/
68-
69-
# PyBuilder
70-
target/
71-
72-
# Jupyter Notebook
73-
.ipynb_checkpoints
74-
75-
# pyenv
76-
.python-version
77-
78-
# celery beat schedule file
79-
celerybeat-schedule
80-
81-
# SageMath parsed files
82-
*.sage.py
83-
84-
# Environments
85-
.env
86-
.nox
87-
.venv
88-
env/
89-
venv/
90-
ENV/
91-
env.bak/
92-
venv.bak/
93-
94-
# Spyder project settings
95-
.spyderproject
96-
.spyproject
97-
98-
# Rope project settings
99-
.ropeproject
100-
101-
# mkdocs documentation
102-
/site
103-
104-
# mypy
105-
.mypy_cache/

.pre-commit-config.yaml

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ repos:
4545
rev: v3.15.0
4646
hooks:
4747
- id: pyupgrade
48-
args: [--py39-plus]
48+
args: [--py310-plus]
4949

50-
- repo: https://github.com/PyCQA/isort
51-
rev: 5.13.2
50+
- repo: https://github.com/asottile/reorder-python-imports
51+
rev: v3.12.0
5252
hooks:
53-
- id: isort
54-
files: \.py$
53+
- id: reorder-python-imports
54+
args: [--py310-plus, --add-import, "from __future__ import annotations"]
5555

5656
- repo: https://github.com/pre-commit/pre-commit-hooks
5757
rev: v4.5.0
@@ -66,24 +66,14 @@ repos:
6666
- id: forbid-new-submodules
6767
- id: mixed-line-ending
6868
- id: trailing-whitespace
69-
70-
- repo: https://github.com/regebro/pyroma
71-
rev: "4.2"
72-
hooks:
73-
- id: pyroma
74-
args: ["-d", "--min=10", "."]
75-
additional_dependencies:
76-
- numpy
77-
- cython
78-
79-
- repo: https://github.com/mgedmin/check-manifest
80-
rev: "0.49"
81-
hooks:
82-
- id: check-manifest
83-
args: ["--ignore=.nox,build", "--no-build-isolation"]
84-
additional_dependencies:
85-
- numpy
86-
- cython
69+
- id: name-tests-test
70+
- id: file-contents-sorter
71+
files: |
72+
(?x)^(
73+
.*requirements(-\w+)?.(in|txt)|
74+
requirements/.*\.txt|
75+
.gitignore
76+
)
8777
8878
- repo: https://github.com/PyCQA/pydocstyle
8979
rev: 6.3.0
@@ -99,4 +89,6 @@ repos:
9989
rev: v1.8.0
10090
hooks:
10191
- id: mypy
92+
language_version: python3.12
10293
additional_dependencies: [types-all]
94+
files: src/.*\.py$

MANIFEST.in

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

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# BMI for Python
2+
3+
Python bindings for the CSDMS [Basic Model Interface](https://bmi.readthedocs.io).
4+
5+
![[Python][pypi-link]][python-badge]
6+
![[DOI][doi-link]][doi-badge]
7+
![[Build Status][build-link]][build-badge]
8+
![[PyPI][pypi-link]][pypi-badge]
9+
![[Build Status][anaconda-link]][anaconda-badge]
10+
11+
[anaconda-badge]: https://anaconda.org/conda-forge/bmipy/badges/version.svg
12+
[anaconda-link]: https://anaconda.org/conda-forge/bmipy
13+
[build-badge]: https://github.com/csdms/bmi-python/actions/workflows/test.yml/badge.svg
14+
[build-link]: https://github.com/csdms/bmi-python/actions/workflows/test.yml
15+
[doi-badge]: https://zenodo.org/badge/179283861.svg
16+
[doi-link]: https://zenodo.org/badge/latestdoi/179283861
17+
[pypi-badge]: https://badge.fury.io/py/bmipy.svg
18+
[pypi-link]: https://pypi.org/project/bmipy/
19+
[python-badge]: https://img.shields.io/pypi/pyversions/bmipy.svg
20+
21+
## Install
22+
23+
Install *bmipy* with *pip*,
24+
25+
```bash
26+
pip install bmipy
27+
```
28+
29+
If you're using Anaconda, you can also install *bmipy*
30+
with conda from the *conda-forge* channel,
31+
32+
```bash
33+
conda install bmipy -c conda-forge
34+
```
35+
36+
To build and install *bmipy* from source,
37+
38+
```bash
39+
pip install git+https://github.com/csdms/bmi-python.git
40+
```
41+
42+
## Usage
43+
44+
```python
45+
from bmipy import Bmi
46+
47+
48+
class MyBmi(Bmi):
49+
50+
def initialize(self, config_file):
51+
# Your implementation goes here
52+
```
53+
54+
A complete sample implementation is given in the
55+
<https://github.com/csdms/bmi-example-python>
56+
repository.

README.rst

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

noxfile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import os
24
import pathlib
35
import shutil

0 commit comments

Comments
 (0)