Skip to content

Commit

Permalink
adopted abc2 and PySide6
Browse files Browse the repository at this point in the history
  • Loading branch information
giumas committed Feb 17, 2024
1 parent e5771ea commit 1ee2b3a
Show file tree
Hide file tree
Showing 13 changed files with 146 additions and 159 deletions.
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ os:
- osx

env:
- PYTHON_VERSION=3.6
- PYTHON_VERSION=3.7
- PYTHON_VERSION=3.8
- PYTHON_VERSION=3.9

matrix:
fast_finish: true
allow_failures:
- os: osx
- env: PYTHON_VERSION=3.7
- env: PYTHON_VERSION=3.9

install:
- "export DISPLAY=:99.0"
Expand All @@ -35,16 +35,15 @@ install:

- conda create -q -n test-environment python=$PYTHON_VERSION
- source activate test-environment
- pip install PySide2
- pip install PySide6
- conda install numpy matplotlib-base gdal pyproj scipy basemap netCDF4 pillow
- if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then
conda remove --force PyQt Qt sip;
export LD_LIBRARY_PATH=$HOME/miniconda/envs/test-environment/lib:$LD_LIBRARY_PATH;
fi
- pip install coveralls
- pip install https://github.com/hydroffice/hyo2_abc/archive/master.zip
- pip install https://github.com/hydroffice/hyo2_abc2/archive/master.zip
- pip install .
- rm -f $HOME/miniconda/envs/test-environment/qt.conf
- conda list --show-channel-urls

script:
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Credits
Authors
~~~~~~~

OpenBST is written and maintained by:
Kng is written and maintained by:

- `Giuseppe Masetti <mailto:[email protected]>`_

Expand Down
9 changes: 9 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
History
-------

1.3
~~~

2024-02-17

- Added #SSM datagrams.
- Switch to PySide6


0.2
~~~

Expand Down
20 changes: 5 additions & 15 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,19 @@ environment:

matrix:

- PYTHON_VERSION: 3.6
- PYTHON_VERSION: 3.8
PYTHON_ARCH: x64
MINICONDA: C:\Miniconda36-x64

- PYTHON_VERSION: 3.7
PYTHON_ARCH: x64
MINICONDA: C:\Miniconda36-x64

- PYTHON_VERSION: 3.5
- PYTHON_VERSION: 3.9
PYTHON_ARCH: x64
MINICONDA: C:\Miniconda36-x64

matrix:

allow_failures:

- PYTHON_VERSION: 3.7
PYTHON_ARCH: x64
MINICONDA: C:\Miniconda36-x64

- PYTHON_VERSION: 3.5
- PYTHON_VERSION: 3.9
PYTHON_ARCH: x64
MINICONDA: C:\Miniconda36-x64

Expand All @@ -44,15 +36,13 @@ install:
- python --version

- pip install coveralls PyYAML
- pip install PySide2
- pip install PySide6
- conda install numpy matplotlib-base gdal pyproj scipy basemap netCDF4 pillow
- pip install https://github.com/hydroffice/hyo2_abc/archive/master.zip
- pip install https://github.com/hydroffice/hyo2_abc2/archive/master.zip

build: off
build_script:
- pip install .
# - conda remove --force PyQt Qt sip
- del /q %MINICONDA%\envs\test-environment\qt.conf
- conda list --show-channel-urls

test: off
Expand Down
4 changes: 2 additions & 2 deletions examples/sis/ex_sis_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os
import time
from multiprocessing import freeze_support
from hyo2.abc.lib.testing import Testing
from hyo2.abc.lib.logging import set_logging
from hyo2.abc2.lib.testing import Testing
from hyo2.abc2.lib.logging import set_logging
from hyo2.kng.lib.sis import Sis

set_logging(ns_list=['hyo2.kng'])
Expand Down
33 changes: 14 additions & 19 deletions freeze/sis_emu.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,22 @@
#
# To compile, execute the following within the source directory:
#
# python /path/to/pyinstaller.py SIS.spec
# python /path/to/pyinstaller.py sis_emu.spec
#
# The resulting .exe file is placed in the dist/SIS folder.
#
# - It may require to manually copy DLL libraries.
# - Uninstall PyQt and sip
# - For QtWebEngine:
# . copy QtWebEngineProcess.exe in the root
# . copy in PySide2 both "resources" and "translations" folder
#
# Uploading to BitBucket: curl -s -v -u giumas:password -X POST https://api.bitbucket.org/2.0/repositories/hydroffice/hyo_kng/downloads -F files=@SIS.1.1.0.zip
# Uploading to BitBucket: curl -s -v -u giumas:password -X POST https://api.bitbucket.org/2.0/repositories/hydroffice/hyo_kng/downloads -F files=@SISEmu.1.3.0.zip

from datetime import datetime
import os
import sys
from PyInstaller.building.build_main import Analysis, PYZ, EXE, COLLECT, TOC
from PyInstaller.compat import is_darwin, is_win

from hyo2.kng.sis import __version__ as sis_version
from hyo2.kng import __version__ as sis_version

sys.setrecursionlimit(20000)

is_beta = False
if is_beta:
Expand Down Expand Up @@ -100,18 +97,17 @@ share_folder = os.path.join(python_path(), "Library", "share")
output_folder = os.path.join("Library", "share")
pyproj_data = collect_folder_data(input_data_folder=share_folder, relative_output_folder=output_folder)

pyside2_data = collect_pkg_data('PySide2')
abc_data = collect_pkg_data('hyo2.abc')
abc2_data = collect_pkg_data('hyo2.abc2')
kng_data = collect_pkg_data('hyo2.kng')

icon_file = os.path.join('freeze', 'SIS.ico')
icon_file = os.path.normpath(os.path.join(os.getcwd(), 'freeze', 'sis_emu.ico'))
if is_darwin:
icon_file = os.path.join('freeze', 'SIS.icns')
icon_file = os.path.normpath(os.path.join(os.getcwd(), 'freeze', 'sis_emu.icns'))

a = Analysis(['SIS.py'],
a = Analysis(['sis_emu.py'],
pathex=[],
hiddenimports=["PIL", "typing", "cftime._cftime", "PySide2.QtPrintSupport"],
excludes=["IPython", "PyQt4", "PyQt5", "pandas", "sphinx", "sphinx_rtd_theme",
hiddenimports=["PIL", "typing", "cftime._cftime", "pkg_resources"],
excludes=["IPython", "PyQt4", "PyQt5", "PySide2", "pandas", "sphinx", "sphinx_rtd_theme",
"OpenGL_accelerate", "FixTk", "tcl", "tk", "_tkinter", "tkinter", "Tkinter",
"wx"],
hookspath=None,
Expand All @@ -121,7 +117,7 @@ pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=True,
name='SIS.%s%s' % (sis_version, beta),
name='SISEmu',
debug=False,
strip=None,
upx=True,
Expand All @@ -132,9 +128,8 @@ coll = COLLECT(exe,
a.zipfiles,
a.datas,
pyproj_data,
pyside2_data,
abc_data,
abc2_data,
kng_data,
strip=None,
upx=True,
name='SIS.%s%s' % (sis_version, beta))
name='SISEmu.%s%s' % (sis_version, beta))
42 changes: 18 additions & 24 deletions hyo2/kng/__init__.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
import logging
import os

from hyo2.abc.lib.lib_info import LibInfo
from hyo2.abc2.lib.package.pkg_info import PkgInfo

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

name = "Kng"
__version__ = "1.3.0"
__author__ = "[email protected]"
__license__ = "LGPLv3 license"
__copyright__ = "Copyright 2024 University of New Hampshire, Center for Coastal and Ocean Mapping."

lib_info = LibInfo()

lib_info.lib_name = name
lib_info.lib_version = __version__
lib_info.lib_author = "Giuseppe Masetti(UNH,JHC-CCOM)"
lib_info.lib_author_email = "[email protected]"

lib_info.lib_license = "LGPLv3"
lib_info.lib_license_url = "https://www.hydroffice.org/license/"

lib_info.lib_path = os.path.abspath(os.path.dirname(__file__))

lib_info.lib_url = "https://www.hydroffice.org/sis_emu/"
lib_info.lib_manual_url = "https://www.hydroffice.org/manuals/kng/index.html"
lib_info.lib_support_email = "[email protected]"
lib_info.lib_latest_url = "https://www.hydroffice.org/latest/sis_emu.txt"

lib_info.lib_dep_dict = {
"hyo2.abc": "hyo2.abc",
"PySide2": "PySide2"
}
pkg_info = PkgInfo(
name=name,
version=__version__,
author="Giuseppe Masetti",
author_email="[email protected]",
lic="LGPLv3",
lic_url="https://www.hydroffice.org/license/",
path=os.path.abspath(os.path.dirname(__file__)),
url="https://www.hydroffice.org/sis_emu/",
manual_url="https://www.hydroffice.org/manuals/kng/index.html",
support_email="[email protected]",
latest_url="https://www.hydroffice.org/latest/sis_emu.txt",
deps_dict={
"hyo2.abc2": "hyo2.abc2",
"PySide6": "PySide6"
}
)
35 changes: 11 additions & 24 deletions hyo2/kng/app/sis_emu/__init__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,12 @@
import os
from hyo2.abc.app.app_info import AppInfo
from hyo2.kng import name, __version__

app_info = AppInfo()

app_info.app_name = name
app_info.app_version = __version__
app_info.app_author = "Giuseppe Masetti(UNH,JHC-CCOM)"
app_info.app_author_email = "[email protected]"

app_info.app_license = "LGPLv3"
app_info.app_license_url = "https://www.hydroffice.org/license/"

app_info.app_path = os.path.abspath(os.path.dirname(__file__))

app_info.app_url = "https://www.hydroffice.org/sis_emu/"
app_info.app_manual_url = "https://www.hydroffice.org/manuals/kng/index.html"
app_info.app_support_email = "[email protected]"
app_info.app_latest_url = "https://www.hydroffice.org/latest/sis_emu.txt"

app_info.app_media_path = os.path.join(app_info.app_path, "media")
app_info.app_main_window_object_name = "MainWindow"
app_info.app_license_path = os.path.join(app_info.app_media_path, "LICENSE")
app_info.app_icon_path = os.path.join(app_info.app_media_path, "app_icon.png")
from hyo2.kng import pkg_info

app_path = os.path.abspath(os.path.dirname(__file__))
app_media_path = os.path.join(app_path, "media")
app_info = pkg_info.app_info(
app_name="SISEmu",
app_path=app_path,
app_media_path=app_media_path,
app_license_path=os.path.join(app_media_path, "LICENSE"),
app_icon_path=os.path.join(app_media_path, "app_icon.png")
)
Loading

0 comments on commit 1ee2b3a

Please sign in to comment.