Skip to content

Commit

Permalink
Merge pull request #103 from MODFLOW-USGS/v1.0.0
Browse files Browse the repository at this point in the history
Release 1.0.0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: w-bonelli <[email protected]>
  • Loading branch information
wpbonelli and github-actions[bot] authored Aug 5, 2023
2 parents 9a0fffd + a4c2dc5 commit e92682a
Show file tree
Hide file tree
Showing 20 changed files with 431 additions and 496 deletions.
10 changes: 10 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
### Version 1.0.0

#### New features

* [feat(ostags)](https://github.com/MODFLOW-USGS/modflow-devtools/commit/33ab22a5f7e1c88258038e9881f22c6cd537965c): Add OS tag conversion utilities (#99). Committed by w-bonelli on 2023-08-05.

#### Refactoring

* [refactor](https://github.com/MODFLOW-USGS/modflow-devtools/commit/07bd60fff92a0dab08721c167293344a827d6345): Multiple (#100). Committed by w-bonelli on 2023-08-05.

### Version 0.3.0

#### Refactoring
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Python development tools for MODFLOW 6.

This is a small toolkit for developing MODFLOW 6, FloPy, and related projects. It includes standalone utilities and optional [Pytest](https://github.com/pytest-dev/pytest) extensions.

Standalone utilities include a very minimal GitHub API client, mainly for retrieving release information and downloading assets, and a `ZipFile` subclass that [preserves file permissions](https://stackoverflow.com/questions/39296101/python-zipfile-removes-execute-permissions-from-binaries) (workaround for [Python #15795](https://bugs.python.org/issue15795))
The former include a very minimal GitHub API client for retrieving release information and downloading assets, a `ZipFile` subclass that [preserves file permissions](https://stackoverflow.com/questions/39296101/python-zipfile-removes-execute-permissions-from-binaries) (workaround for [Python #15795](https://bugs.python.org/issue15795)), and other release/distribution-related tools.

Pytest features include:

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

project = "modflow-devtools"
author = "MODFLOW Team"
release = "0.3.0"
release = "1.0.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ The `modflow-devtools` package provides a set of tools for developing and testin
:maxdepth: 2
:caption: Test fixtures

md/cases.md
md/executables.md
md/fixtures.md
md/markers.md
Expand All @@ -30,6 +29,7 @@ The `modflow-devtools` package provides a set of tools for developing and testin
:caption: Miscellaneous

md/download.md
md/ostags.md
md/zip.md


Expand Down
64 changes: 0 additions & 64 deletions docs/md/cases.md

This file was deleted.

9 changes: 5 additions & 4 deletions docs/md/executables.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `Executables` class maps executable names to paths on the filesystem. This i
For example, assuming development binaries live in `bin` relative to the project root (as is currently the convention for `modflow6`), the following `pytest` fixtures could be defined:

```python
from modflow_devtools.executables import build_default_exe_dict, Executables
from modflow_devtools.executables import Executables

@pytest.fixture(scope="session")
def bin_path() -> Path:
Expand All @@ -16,7 +16,10 @@ def bin_path() -> Path:

@pytest.fixture(scope="session")
def targets(bin_path) -> Executables:
return Executables(**build_default_exe_dict(bin_path))
exes = {
# ...map names to paths
}
return Executables(**exes)
```

The `targets` fixture can then be injected into test functions:
Expand All @@ -27,8 +30,6 @@ def test_targets(targets):
assert targets["mf6"] == targets.mf6
```

The `build_default_exe_dict` function is provided to create the default executable mapping used by MODFLOW 6 autotests.

There is also a convenience function for getting a program's version string. The function will automatically strip the program name from the output (assumed delimited with `:`).

```python
Expand Down
45 changes: 45 additions & 0 deletions docs/md/ostags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# OS Tags

MODFLOW 6, Python3, build servers, and other systems may refer to operating systems by different names. Utilities are provided in the `modflow_devtools.ostags` module to convert between

- the output of `platform.system()`
- GitHub Actions `runner.os` tags
- MODFLOW 6 release asset OS tags

Only Linux, Mac and Windows are supported.

## Tag specification

Python3's `platform.system()` returns "Linux", "Darwin", and "Windows", respectively.

GitHub Actions (e.g. `runner.os` context) use "Linux", "macOS" and "Windows".

MODFLOW 6 release asset names end with "linux", "mac" or "win64".

## Getting tags

To get the MODFLOW 6 or GitHub tag for the current OS, use:

- `get_modflow_ostag()`
- `get_github_ostag()`

## Converting tags

Conversion functions are available for each direction:

- `python_to_modflow_ostag(tag)`
- `modflow_to_python_ostag(tag)`
- `modflow_to_github_ostag(tag)`
- `github_to_modflow_ostag(tag)`
- `python_to_github_ostag(tag)`
- `github_to_python_ostag(tag)`

Alternatively:

```python
OSTag.convert(platform.system(), "py2mf")
```

The second argument specifies the mapping in format `<source>2<target>`, where `<source>` and `<target>` may take values `py`, `mf`, or `gh`.

**Note**: source and target must be different.
4 changes: 2 additions & 2 deletions modflow_devtools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__author__ = "Joseph D. Hughes"
__date__ = "Aug 04, 2023"
__version__ = "0.3.0"
__date__ = "Aug 05, 2023"
__version__ = "1.0.0"
__maintainer__ = "Joseph D. Hughes"
__email__ = "[email protected]"
__status__ = "Production"
Expand Down
43 changes: 0 additions & 43 deletions modflow_devtools/case.py

This file was deleted.

Loading

0 comments on commit e92682a

Please sign in to comment.