Skip to content

Commit

Permalink
Release of version 0.8.3
Browse files Browse the repository at this point in the history
Included missing module name
Avoid crash if cmap option is not provided
improvements to build for release
  • Loading branch information
wxguy committed Feb 4, 2023
1 parent 65aea85 commit 839342f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-pip.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine setuptools_scm build
pip install setuptools wheel twine setuptools-git-versioning build
- name: Build Package
run: |
python -m build --sdist
build_s_dist.sh
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1.5
with:
Expand Down
2 changes: 2 additions & 0 deletions _version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated by wrfplot build file. Do not edit it manually...
__version__ = version = '0.8.1.post1+git.65aea851.dirty'
15 changes: 15 additions & 0 deletions build_s_dist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

if [ -d "build" ]; then
echo "Cleaning previousally generated build files..."
rm -rfv build
rm -rfv wrfplot.egg-info
fi

echo "Generating version information..."
echo -e "# Generated by wrfplot build file. Do not edit it manually...\n__version__ = version = '$(setuptools-git-versioning)'" > _version.py

python -m build --sdist

echo "Cleaning build time egg info directory..."
rm -rfv wrfplot.egg-info
2 changes: 1 addition & 1 deletion wrfplot/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Generated by wrfplot build file. Do not edit it manually...
__version__ = version = "0.8.1.post0+git.2b855e8d.dirty"
__version__ = version = "0.8.1.post1+git.65aea851.dirty"
1 change: 1 addition & 0 deletions wrfplot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def get_cmap(self):
"""Get cmap from variable.ini file"""
cmap_name = "None"
if self.cmap is not False:

self.cmap = utils.get_cmap(self.cmap)
return True
else:
Expand Down
9 changes: 6 additions & 3 deletions wrfplot/wrfplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@
warnings.filterwarnings("ignore", module="datetime")

try:
__version__ = version("wrfplot")
except PackageNotFoundError:
import _version
__version__ = _version.__version__

except:
__version__ = version("wrfplot")
# package is not installed
# Get the version from local file
__version__ = _version.__version__
finally:
pass


Expand Down Expand Up @@ -446,6 +448,7 @@ def _praser():
"--cmap",
metavar="<cmap-name>",
type=arguments.validate_cmap,
default=False,
help="Valid colormap name to fill colors. Use '--list-cmaps' option to see list of supported colormaps. Must have minimum 11 colors, else will lead to error.",
)
parser.add_argument(
Expand Down

0 comments on commit 839342f

Please sign in to comment.