Skip to content

Commit

Permalink
Merge pull request #3 from pymt-lab/mdpiper/update-to-meson
Browse files Browse the repository at this point in the history
Update build system for Python >=3.12
  • Loading branch information
mdpiper authored Jan 21, 2025
2 parents 6de729c + cfd788f commit e586f2a
Show file tree
Hide file tree
Showing 36 changed files with 472 additions and 3,045 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Format

on: [push, pull_request]

jobs:
format:
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: psf/black@stable
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint

on: [push, pull_request]

jobs:
lint:
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4

- name: Lint
run: |
pip install flake8
flake8 pymt_gipl examples
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Test

on: [push, pull_request]

jobs:
build-and-test:
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository

runs-on: ${{ matrix.os }}

defaults:
run:
shell: bash -l {0}

strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4

- uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: fbld
environment-file: environment.yml
python-version: ${{ matrix.python-version }}

- name: Show conda installation info
run: |
conda info
conda list
- name: Build and install package
run: |
make install
- name: Test import
working-directory: ${{ github.workspace }}/examples
run: |
python -c 'import pymt_gipl'
python -c 'from pymt.models import GIPL'
# The bmi-tester isn't available for bmi-fortran=1.2
# - name: Test BMI
# run: |
# make test

- name: Run examples
working-directory: ${{ github.workspace }}/examples
run: |
python gipl_bmi_ex.py
python gipl_pymt_ex.py
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

17 changes: 17 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

A record of changes for the *pymt_gipl* package.

## 0.2.0 (unreleased)

- Nothing changed yet.


## 0.1.1 (2020-10-16)

- Use custom cd context instead of scripting package


## 0.1 (2019-08-14)

- GIPL BMI and pymt examples complete
3 changes: 3 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Credits

* Kang Wang <[email protected]>
9 changes: 7 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
include versioneer.py
include pymt_gipl/_version.py
include *.md
include Makefile
include babel.toml
include environment.yml
include meson.build
include examples/*
recursive-include meta *
24 changes: 17 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ BROWSER := python -c "$$BROWSER_PYSCRIPT"
help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean: clean-build clean-compile clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

clean-build: ## remove build artifacts
rm -fr build/
Expand All @@ -38,6 +38,13 @@ clean-build: ## remove build artifacts
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +

clean-compile: ## remove compilation artifacts
find . -name '*.c' -exec rm -f {} +
find . -name '*.mod' -exec rm -f {} +
find . -name '*.o' -exec rm -f {} +
find . -name '*.so' -exec rm -f {} +
rm -fr build/

clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
Expand All @@ -51,14 +58,18 @@ clean-test: ## remove test and coverage artifacts
rm -fr .pytest_cache

lint: ## check style with flake8
flake8 pymt_gipl
flake8 pymt_gipl examples

pretty:
find pymt_gipl -name '*.py' | xargs isort
black setup.py pymt_gipl
black . --check

test: ## run tests quickly with the default Python
bmi-test pymt_gipl.bmi:GIPL -vvv
bmi-test pymt_gipl._bmi:GIPL \
--config-file=${PWD}/examples/gipl_config.cfg \
--root-dir=examples \
--bmi-version="1.2" \
-vvv

test-all: ## run tests on every Python version with tox
tox
Expand All @@ -84,9 +95,8 @@ release: dist ## package and upload a release
twine upload dist/*

dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
python -m build --no-isolation
ls -l dist

install: clean ## install the package to the active Python's site-packages
python setup.py develop
python -m pip install . -v --no-build-isolation
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# pymt_gipl

[![Basic Model Interface](https://img.shields.io/badge/CSDMS-Basic%20Model%20Interface-green.svg)](https://bmi.readthedocs.io/)

[![Test](https://github.com/pymt-lab/pymt_gipl/actions/workflows/test.yml/badge.svg)](https://github.com/pymt-lab/pymt_gipl/actions/workflows/test.yml)

[![Conda Version](https://img.shields.io/conda/vn/conda-forge/pymt_gipl.svg)](https://anaconda.org/conda-forge/pymt_gipl)

PyMT plugin for GIPL

- Free software: MIT license
- Documentation: <https://gipl.readthedocs.io>.

| Component | PyMT
| --------- | ----------------------------
| GIPL | from pymt.models import GIPL

## Installing pymt

Installing pymt from the conda-forge channel
can be achieved by adding conda-forge to your channels with:
```
conda config --add channels conda-forge
```

*Note*: Before installing pymt, you may want to create a
separate environment into which to install it. This can be done with,
```
conda create -n pymt python=3
conda activate pymt
```

Once the conda-forge channel has been enabled,
pymt can be installed with:
```
conda install pymt
```

It is possible to list all of the versions of pymt
available on your platform with:
```
conda search pymt --channel conda-forge
```

## Installing pymt_gipl

Once pymt is installed, the dependencies of
pymt_gipl can be installed with:
```
conda install bmi-fortran=1.2 gipl
```

To install pymt_gipl,
```
conda install pymt_gipl
```
86 changes: 0 additions & 86 deletions README.rst

This file was deleted.

Loading

0 comments on commit e586f2a

Please sign in to comment.