Skip to content

Commit

Permalink
Merge pull request #45 from csdms/mcflugen/use-argparse
Browse files Browse the repository at this point in the history
Use argparse instead of click
  • Loading branch information
mcflugen authored Jan 9, 2024
2 parents 3447c93 + fd5c3b3 commit bc4d8a4
Show file tree
Hide file tree
Showing 23 changed files with 279 additions and 530 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,6 @@ jobs:

debug: true

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wntrblm/[email protected]
with:
python-versions: "3.12"
- name: Lint
run: nox --non-interactive --error-on-missing-interpreter --session "lint"


coveralls_finish:
needs: build-and-test
runs-on: ubuntu-latest
Expand Down
106 changes: 4 additions & 102 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,105 +1,7 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.egg-info/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
.coverage
.nox/
__pycache__/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.nox
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
38 changes: 15 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ repos:
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py39-plus]
args: [--py310-plus]

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

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Expand All @@ -66,24 +66,14 @@ repos:
- id: forbid-new-submodules
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/regebro/pyroma
rev: "4.2"
hooks:
- id: pyroma
args: ["-d", "--min=10", "."]
additional_dependencies:
- numpy
- cython

- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
args: ["--ignore=.nox,build", "--no-build-isolation"]
additional_dependencies:
- numpy
- cython
- id: name-tests-test
- id: file-contents-sorter
files: |
(?x)^(
.*requirements(-\w+)?.(in|txt)|
requirements/.*\.txt|
.gitignore
)
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
Expand All @@ -99,4 +89,6 @@ repos:
rev: v1.8.0
hooks:
- id: mypy
language_version: python3.12
additional_dependencies: [types-all]
files: src/.*\.py$
9 changes: 0 additions & 9 deletions MANIFEST.in

This file was deleted.

56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# BMI for Python

Python bindings for the CSDMS [Basic Model Interface](https://bmi.readthedocs.io).

![[Python][pypi-link]][python-badge]
![[DOI][doi-link]][doi-badge]
![[Build Status][build-link]][build-badge]
![[PyPI][pypi-link]][pypi-badge]
![[Build Status][anaconda-link]][anaconda-badge]

[anaconda-badge]: https://anaconda.org/conda-forge/bmipy/badges/version.svg
[anaconda-link]: https://anaconda.org/conda-forge/bmipy
[build-badge]: https://github.com/csdms/bmi-python/actions/workflows/test.yml/badge.svg
[build-link]: https://github.com/csdms/bmi-python/actions/workflows/test.yml
[doi-badge]: https://zenodo.org/badge/179283861.svg
[doi-link]: https://zenodo.org/badge/latestdoi/179283861
[pypi-badge]: https://badge.fury.io/py/bmipy.svg
[pypi-link]: https://pypi.org/project/bmipy/
[python-badge]: https://img.shields.io/pypi/pyversions/bmipy.svg

## Install

Install *bmipy* with *pip*,

```bash
pip install bmipy
```

If you're using Anaconda, you can also install *bmipy*
with conda from the *conda-forge* channel,

```bash
conda install bmipy -c conda-forge
```

To build and install *bmipy* from source,

```bash
pip install git+https://github.com/csdms/bmi-python.git
```

## Usage

```python
from bmipy import Bmi


class MyBmi(Bmi):

def initialize(self, config_file):
# Your implementation goes here
```

A complete sample implementation is given in the
<https://github.com/csdms/bmi-example-python>
repository.
65 changes: 0 additions & 65 deletions README.rst

This file was deleted.

2 changes: 2 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import os
import pathlib
import shutil
Expand Down
Loading

0 comments on commit bc4d8a4

Please sign in to comment.