Skip to content

Commit

Permalink
New release "0.3.1"
Browse files Browse the repository at this point in the history
Shifted compilation backend to pyinstaller for automatic release process

Fix for colormaps module to work with latest version of matplotlib

Included versioneer for managing app version

Fix for crash while including frameon parameter with latest version of matplotlib
  • Loading branch information
wxguy committed Jan 31, 2023
1 parent 6fe79f5 commit 697c084
Show file tree
Hide file tree
Showing 18 changed files with 4,490 additions and 1,555 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wrfplot/_version.py export-subst
4 changes: 2 additions & 2 deletions .github/workflows/release-github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: |
conda env create -f environment.yml
conda activate wrfplot
python build_exe.py
python build_exe.py pyinstaller
if: matrix.os == 'windows-latest'
- name: Upload Windows Executable
uses: actions/upload-artifact@v3
Expand All @@ -52,7 +52,7 @@ jobs:
conda env create -f environment.yml
conda activate wrfplot
export CC=gcc-7
python build_exe.py
python build_exe.py pyinstaller
if: matrix.os == 'ubuntu-20.04'
- name: Upload Linux Executable
uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ share/python-wheels/
.installed.cfg
*.egg
MANIFEST
installer.iss

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
10 changes: 9 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
History
=======

v0.1.0 (2022-09-07)
v0.3.1 (2023-01-31)
------------------------
* Shifted compilation backend to pyinstaller for automatic release process
* Fix for colormaps module to work with latest version of matplotlib
* Included versioneer for managing app version
* Fix for crash while including frameon parameter with latest version of matplotlib
* Refer the Documentation at https://wrfplot.readthedocs.io/

v0.2.7 (2022-09-07)
------------------------
* Cartopy no more would download shapefile from internet
* Fixed bug that caused plotting of upper atmospheric data to fail
Expand Down
21 changes: 17 additions & 4 deletions build_exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import psutil
import shutil
from shutil import which
from wrfplot._version import __version__
from wrfplot import __version__
from wrfplot.utils import quote

# Define variables that would be used at later stage
Expand Down Expand Up @@ -55,6 +55,7 @@
geos_dll_files = conda_prefix + "\\Lib\\Library\\bin\\geos*.dll"
geos_trgt_dir = os.path.join("shapely", "DLLs", "\\")
compiler = "--mingw64"
nutika_exe_name = 'wrfplot.exe' # os.path.join(output_dir, 'wrfplot.dist', 'wrfplot.exe')

elif platform.system() == "Linux":
output_dir = os.path.join(project_root, 'build', 'linux')
Expand All @@ -64,6 +65,7 @@
geos_dll_files = conda_prefix + "/lib/libgeos\*so.\*"
geos_trgt_dir = "shapely/.libs/"
compiler = ""
nutika_exe_name = 'wrfplot' #os.path.join(output_dir, 'wrfplot.dist', 'wrfplot')

# Tested on Miniconda Python 3.10.4
# This is the place one need to be carefull. For wrfplot project, netcdf, shapely and pyproj modules were not detected
Expand All @@ -83,6 +85,7 @@
"--show-scons", # Show output of scon module. Required for reporting bugs at GitHub
"--show-modules", # Provide a final summary on included modules
"--include-module=netCDF4.utils",
"--include-module=cftime._strptime",
# Add necessary modules not included by Nutika. You will get import module error after compilation only
"--include-module=colormaps", # Include missing colormaps module
"--include-package-data=pyproj", # Add missing data files of modules that are reported during run time
Expand Down Expand Up @@ -279,6 +282,8 @@ def create_nsis_installer():
if platform.system() == 'Windows':
print("Still work in progress...")
nsis = os.path.join("C:\\", "Program Files (x86)", "NSIS", "makensis.exe")
if not os.path.exists(nsis):
nsis = "makensis.exe"
nsi_installer_path = "installer.nsi"
print("Executing ==>", os.path.join(quote(nsis)) + " " + nsi_installer_path)
# print(os.path.join(quote(nsis)) + " " + nsi_installer_path)
Expand Down Expand Up @@ -315,9 +320,17 @@ def check_linux_exes():
def main():
if platform.system() == "Windows":
print("Creating distribution files under Windows...\n\n")
create_win_exe()
copy_files()
create_nsis_installer()
if compile_module == 'nuitka':
create_win_exe()
copy_files()
create_nsis_installer()
else:
print("Using pyinstaller as backend for creating final executable...")
execute_cmd("pyinstaller --noconfirm --distpath " + output_dir + " wrfplot.spec")
if os.path.exists(os.path.join("build", "windows", "wrfplot", 'wrfplot.exe')):
print("wrfplot.exe successfully created at :", os.path.exists(os.path.join("build", "windows", "wrfplot", 'wrfplot.exe')))
print("Creating setup file using NSIS...")
create_nsis_installer()

elif platform.system() == "Linux":
# execute_cmd("pyinstaller --noconfirm --distpath " + pyinst_dest_path + " wrfplot.spec")
Expand Down
12 changes: 9 additions & 3 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# conda env create -f environment.yml
# conda env remove -n ENV_NAME
# conda activate wrfplot
# conda env remove -n wrfplot

name: wrfplot
channels:
- conda-forge
Expand All @@ -11,17 +13,21 @@ dependencies:
- conda-forge::netcdf4
- conda-forge::cartopy
- conda-forge::imageio
- conda-forge::nuitka=0.8.4
- conda-forge::nuitka
- conda-forge::ordered-set
- conda-forge::tqdm
- conda-forge::wrapt
- conda-forge::psutil
# - conda-forge::patchelf
- conda-forge::scons
- conda-forge::shapely
- conda-forge::pip
- conda-forge::black # use it only for code formatting. `black /path/to/python/package`
- conda-forge::nsis
- conda-forge::pyinstaller
- conda-forge::versioneer
- pip:
- sphinx
- sphinx_rtd_theme
# - pyinstaller # Not required as of now as nuitka works fine on Linux and Windows


4 changes: 2 additions & 2 deletions installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
; Download and extract to NSIS install directory C:\Program Files(x86)

; Define the path to directory where Nutika put all our application files and directories
!define PY_APP_DIR "build\windows\wrfplot.dist"
!define PY_APP_DIR "build\windows\wrfplot"
!define PRODUCT_NAME "wrfplot"
!define PRODUCT_VERSION "0.1.0"
!define PRODUCT_VERSION "0.3.1"
!define BITNESS "64"
!define ARCH_TAG ".amd64"
!define INSTALLER_NAME "wrfplot-windows-64bit.exe"
Expand Down
18 changes: 14 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"]
#requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"]
requires = ["setuptools>=45", "versioneer[toml]", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "wrfplot/_version.py"
version_scheme = "python-simplified-semver"
#[tool.setuptools_scm]
#write_to = "wrfplot/_version.py"
#version_scheme = "python-simplified-semver"

[tool.versioneer]
VCS = "git"
style = "pep440"
versionfile_source = "wrfplot/_version.py"
versionfile_build = "wrfplot/_version.py"
tag_prefix = ""
parentdir_prefix = "wrfplot-"


[project]
dynamic = ["version",]
Expand Down
13 changes: 13 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# See the docstring in versioneer.py for instructions. Note that you must
# re-run 'versioneer.py setup' after changing this section, and commit the
# resulting files.

[versioneer]
VCS = git
style = pep440
versionfile_source = wrfplot/_version.py
versionfile_build = wrfplot/_version.py
tag_prefix =
parentdir_prefix = wrfplot-

13 changes: 8 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from shutil import rmtree
import glob
from setuptools import find_packages, setup
import versioneer

# Package meta-data.
NAME = 'wrfplot'
Expand Down Expand Up @@ -79,9 +80,11 @@ def my_release_branch_semver_version(version):

setup(
name=NAME,
version=about['__version__'],
use_scm_version=_version,
setup_requires=['setuptools_scm'],
# version=about['__version__'],
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
# use_scm_version=_version,
# setup_requires=['setuptools_scm'],
description=DESCRIPTION,
long_description=long_description,
author=AUTHOR,
Expand Down Expand Up @@ -121,8 +124,8 @@ def my_release_branch_semver_version(version):
'colormaps/colormaps/scientific/*',
'colormaps/colormaps/sciviz/*',
'colormaps/colormaps/tableau/*',
'data/*', 'data/natural_earth/cultural/*',
'data/natural_earth/physical/*', 'data/shape/*']},
'data/*', 'data/shapefiles/natural_earth/cultural/*',
'data/shapefiles/natural_earth/physical/*', 'data/shape/*']},
# package_data={'wrfplot': list_files('wrfplot')},
# $ setup.py publish support.
# cmdclass={ 'upload': UploadCommand,},
Expand Down
Loading

0 comments on commit 697c084

Please sign in to comment.