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

Use argparse instead of click #45

Merged
merged 31 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3d2b2cb
remove the manifest file
mcflugen Jan 5, 2024
6b478df
rename test files to have _test suffix
mcflugen Jan 5, 2024
cf8c686
clean up the gitignore file
mcflugen Jan 5, 2024
b04b083
use python 3.12, drop python 3.9
mcflugen Jan 5, 2024
561bd32
update hooks; add a couple nwe ones
mcflugen Jan 5, 2024
684f7e5
update pyproject.toml and tidy it up
mcflugen Jan 5, 2024
83a1a60
import annotation from the future
mcflugen Jan 5, 2024
3c481e1
add NDArray annotation with data types
mcflugen Jan 5, 2024
886b8fb
remove click; black is optional; add annotations
mcflugen Jan 5, 2024
2f3c966
drop black as a requirement; add some urls
mcflugen Jan 5, 2024
a8ab6cd
remove click, black from pinned requirements
mcflugen Jan 5, 2024
341357b
add optional args argument to main
mcflugen Jan 5, 2024
3101343
rewrite cli tests to not use click
mcflugen Jan 5, 2024
08b7beb
add a main module
mcflugen Jan 5, 2024
284721c
remove a bit of lint
mcflugen Jan 5, 2024
6673629
remove win32 skip
mcflugen Jan 5, 2024
c520d6f
remove non-ascii characters
mcflugen Jan 5, 2024
e746500
remove the lint workflow, use pre-commit.ci instead
mcflugen Jan 5, 2024
aecc18e
remove unnecessary configuration from pyproject.toml
mcflugen Jan 6, 2024
d53fc67
remove old requirements; sort requirements files
mcflugen Jan 6, 2024
d01fb5e
convert readme to markdown
mcflugen Jan 6, 2024
435f5c5
add a few more badges
mcflugen Jan 6, 2024
8af035f
move coverage and zest.releaser config into pyproject.toml
mcflugen Jan 8, 2024
ed7584a
remove setup.py
mcflugen Jan 8, 2024
7d0e591
Merge branch 'master' into mcflugen/use-argparse
mcflugen Jan 8, 2024
2e70439
remove bmipy.cmd bmipy._cmd
mcflugen Jan 8, 2024
400d5e5
instructions to pip-install from github
mcflugen Jan 9, 2024
8a25868
remove silly bmipy test
mcflugen Jan 9, 2024
d34409b
use exec to test if generated bmi works
mcflugen Jan 9, 2024
ade3dad
import some type annotations to the generated bmi
mcflugen Jan 9, 2024
fd5c3b3
fix a flaky test
mcflugen Jan 9, 2024
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
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/nox@2023.04.22
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
Loading