Skip to content

Commit

Permalink
Merge pull request #101 from NREL/AddConfigScript
Browse files Browse the repository at this point in the history
Polishing up Install Experience
  • Loading branch information
Myoldmopar authored Apr 6, 2023
2 parents c05fe6c + 3e2b53a commit 5b0d027
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 10 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ source = energyplus_regressions
[report]
omit =
energyplus_regressions/runner.py
energyplus_regressions/configure.py
energyplus_regressions/tk_window.py
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
recursive-include energyplus_regressions *.config
recursive-include energyplus_regressions *.png
recursive-include energyplus_regressions *.ico
recursive-include energyplus_regressions *.icns
3 changes: 2 additions & 1 deletion energyplus_regressions/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VERSION = '2.0.0'
NAME = 'energyplus_regressions'
VERSION = '2.0.2'
10 changes: 10 additions & 0 deletions energyplus_regressions/configure.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from plan_tools.entry_point import EntryPoint


def configure_cli() -> None:
source_dir = "energyplus_regressions"
name = "energyplus_regression_runner"
description = "An EnergyPlus test suite utility"
nice_name = "EnergyPlus Regression Tool"
s = EntryPoint(source_dir, name, nice_name, description, name)
s.run()
Binary file removed energyplus_regressions/ep.png
Binary file not shown.
Binary file added energyplus_regressions/icons/icon.icns
Binary file not shown.
Binary file added energyplus_regressions/icons/icon.ico
Binary file not shown.
Binary file added energyplus_regressions/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 23 additions & 4 deletions energyplus_regressions/tk_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
)
from typing import List, Union

from plan_tools.runtime import fixup_taskbar_icon_on_windows
from pubsub import pub

import energyplus_regressions
from energyplus_regressions import VERSION
from energyplus_regressions.builds.base import KnownBuildTypes, autodetect_build_dir_type, BaseBuildDirectoryStructure
from energyplus_regressions.builds.install import EPlusInstallDirectory
Expand Down Expand Up @@ -140,10 +142,27 @@ def __init__(self):
Frame.__init__(self, self.root)

# add the taskbar icon, but its having issues reading the png on Mac, not sure.
self.icon_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ep.png')
if system() != 'Darwin':
img = PhotoImage(file=self.icon_path)
self.root.iconphoto(False, img)
if system() == 'Darwin':
self.icon_path = Path(__file__).resolve().parent / 'icons' / 'icon.icns'
if self.icon_path.exists():
self.root.iconbitmap(str(self.icon_path))
else:
print(f"Could not set icon for Mac, expecting to find it at {self.icon_path}")
elif system() == 'Windows':
self.icon_path = Path(__file__).resolve().parent / 'icons' / 'icon.png'
img = PhotoImage(file=str(self.icon_path))
if self.icon_path.exists():
self.root.iconphoto(False, img)
else:
print(f"Could not set icon for Windows, expecting to find it at {self.icon_path}")
else: # Linux
self.icon_path = Path(__file__).resolve().parent / 'icons' / 'icon.png'
img = PhotoImage(file=str(self.icon_path))
if self.icon_path.exists():
self.root.iconphoto(False, img)
else:
print(f"Could not set icon for Windows, expecting to find it at {self.icon_path}")
fixup_taskbar_icon_on_windows(energyplus_regressions.NAME)

# high level GUI configuration
self.root.geometry('1000x600')
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ docutils # pinning this because it breaks at 0.18

# for packaging
wheel

# for polishing up the Pip install
PLAN-Tools==0.5
19 changes: 14 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import codecs
import os
from platform import system
from setuptools import setup, find_packages

from energyplus_regressions import VERSION
from energyplus_regressions import NAME, VERSION

this_dir = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(this_dir, 'README.md'), encoding='utf-8') as i_file:
long_description = i_file.read()


install_requires = ['PyPubSub', 'beautifulsoup4', 'PLAN-Tools==0.5']
if system() == 'Windows':
install_requires.append('pypiwin32')

setup(
name='energyplus_regressions',
name=NAME,
version=VERSION,
packages=find_packages(exclude=['test', 'tests', 'test.*']),
url='https://github.com/NREL/EnergyPlusRegressionTool',
Expand All @@ -22,12 +28,15 @@
test_suite='nose.collector',
tests_require=['nose'],
keywords='energyplus',
include_package_data=True,
install_requires=['PyPubSub', 'beautifulsoup4'],
include_package_data=True, # use /MANIFEST.in file for declaring package data
install_requires=install_requires,
entry_points={
'console_scripts': [
'gui_scripts': [
'energyplus_regression_runner=energyplus_regressions.runner:main_gui',
],
'console_scripts': [
'energyplus_regression_configure=energyplus_regressions.configure:configure_cli',
],
},
python_requires='>=3.5',
)

0 comments on commit 5b0d027

Please sign in to comment.