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

Tidy up repository #32

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
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
21 changes: 0 additions & 21 deletions .github/workflows/format.yml

This file was deleted.

44 changes: 26 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,42 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]
fail-fast: false

steps:
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.python-version }}

- name: Show conda installation info
- name: Test
run: |
conda info
conda list
pip install nox
nox -s test

- name: Install requirements
- name: Run bmi-test
run: |
mamba install --file=requirements.txt --file=requirements-testing.txt
pip install model-metadata gimli.units bmi-tester
pip install .
cd examples && bmi-test heat:BmiHeat --config-file=./heat.yaml --root-dir=. -vvv

- name: Build and install package
run: pip install -e .
- name: Coveralls
if: matrix.os == 'ubuntu-latest'
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: py${{ matrix.python-version }}-${{ matrix.os }}

- name: Test
run: |
pytest --cov=heat --cov-report=xml:./coverage.xml -vvv
bmi-test heat:BmiHeat --config-file=./examples/heat.yaml --root-dir=./examples -vvv
debug: true

- name: Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
coveralls_finish:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
debug: true
55 changes: 4 additions & 51 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,54 +1,7 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.egg-info/
*.py[cod]

# C extensions
*.so

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

# 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
.cache
nosetests.xml
coverage.xml

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/
64 changes: 64 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
repos:
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
name: black
description: "Black: The uncompromising Python code formatter"
entry: black
language: python
language_version: python3
minimum_pre_commit_version: 2.9.2
require_serial: true
types_or: [python, pyi]

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-simplify
args: [--max-line-length=88]

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py310-plus]

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-builtin-literals
- id: check-added-large-files
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: forbid-new-submodules
- id: mixed-line-ending
- id: trailing-whitespace
- id: name-tests-test
- id: file-contents-sorter
files: |
(?x)^(
.*requirements(-\w+)?.(in|txt)|
requirements/.*\.txt|
.gitignore
)

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
hooks:
- id: mypy
language_version: python3.12
additional_dependencies: [types-all]
files: heat/.*\.py$
3 changes: 1 addition & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Changelog for bmi-example-python
- Match bmipy (#12)
- Use GitHub Actions for continuous integration (#15)
- Dimensionalize flattened values passed into set_value (#17)
- Update CI (#18)
- Update CI (#18)
- Switch from versioneer to zest.releaser
- Remove obsolete docs directory

Expand All @@ -46,4 +46,3 @@ Changelog for bmi-example-python
------------------

- Initial release

1 change: 0 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

92 changes: 0 additions & 92 deletions Makefile

This file was deleted.

3 changes: 2 additions & 1 deletion heat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Model the diffusion of heat over a 2D plate."""
from ._version import __version__
from .bmi_heat import BmiHeat
from .heat import Heat, solve_2d
from .heat import Heat
from .heat import solve_2d

__all__ = ["__version__", "BmiHeat", "solve_2d", "Heat"]
Loading
Loading