Skip to content

Commit 2393fc3

Browse files
committed
Last 0.1.5b4 commit
2 parents 10ec3bc + 73ad534 commit 2393fc3

17 files changed

+8898
-277
lines changed

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2019 R.S. Weigel
1+
Copyright 2019, 2020 R.S. Weigel
22

33
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
44

Makefile

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# Default Python version to use for tests
2-
PYTHON=python3.6
2+
PYTHON=python3.8
33
PYTHON_VER=$(subst python,,$(PYTHON))
44

55
# Python versions to test
66
# TODO: Use tox.
7-
PYTHONVERS=python2.7 python3.5 python3.6 python3.7 python3.8
7+
PYTHONVERS=python3.8 python3.7 python3.6 python3.5 python2.7
88

99
# VERSION is updated in "make version-update" step and derived
1010
# from CHANGES.txt. Do not edit.
1111
VERSION=0.1.5b4
1212
SHELL:= /bin/bash
1313

14+
LONG_TESTS=false
15+
1416
# Select this to have anaconda installed for you.
1517
CONDA=./anaconda3
1618
# CONDA=/opt/anaconda3
@@ -95,13 +97,15 @@ else
9597
make $(CONDA)/envs/$(PYTHON) PYTHON=$(PYTHON)
9698
endif
9799

98-
$(CONDA)/envs/$(PYTHON): /tmp/$(CONDA_PKG)
100+
$(CONDA)/envs/$(PYTHON): ./anaconda3
99101
$(CONDA_ACTIVATE); \
100102
$(CONDA)/bin/conda create -y --name $(PYTHON) python=$(PYTHON_VER)
101103

104+
./anaconda3: /tmp/$(CONDA_PKG)
105+
bash /tmp/$(CONDA_PKG) -b -p $(CONDA)
106+
102107
/tmp/$(CONDA_PKG):
103108
curl https://repo.anaconda.com/miniconda/$(CONDA_PKG) > /tmp/$(CONDA_PKG)
104-
bash /tmp/$(CONDA_PKG) -b -p $(CONDA)
105109

106110
pythonw=$(PYTHON)
107111

@@ -118,28 +122,34 @@ ifeq ($(UNAME_S),Darwin)
118122
pythonw=$(subst bin/$(PYTHON),bin/pythonw,$(a))
119123
endif
120124

121-
# 'python setup.py develop' creates symlinks in system package directory.
122125
repository-test-data:
123126
@make clean
124127

125128
make condaenv PYTHON=$(PYTHON)
126129

127-
#https://stackoverflow.com/questions/30306099/pip-install-editable-vs-python-setup-py-develop
130+
# https://stackoverflow.com/questions/30306099/pip-install-editable-vs-python-setup-py-develop
128131
$(CONDA_ACTIVATE) $(PYTHON); pip install pytest deepdiff; pip install --editable .
129-
#$(CONDA_ACTIVATE) $(PYTHON); $(PYTHON) setup.py develop | grep "Best"
132+
# 'python setup.py develop' creates symlinks in system package directory.
133+
# $(CONDA_ACTIVATE) $(PYTHON); $(PYTHON) setup.py develop | grep "Best"
130134

131-
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) -m pytest -v -m 'not long' hapiclient/test/test_hapi.py
135+
ifeq (LONG_TESTS,true)
132136
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) -m pytest -v -m 'long' hapiclient/test/test_hapi.py
137+
else
138+
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) -m pytest -v -m 'short' hapiclient/test/test_hapi.py
139+
endif
140+
141+
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) -m pytest -v hapiclient/test/test_chunking.py
133142
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) -m pytest -v hapiclient/test/test_hapitime2datetime.py
143+
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) -m pytest -v hapiclient/test/test_hapitime_reformat.py
134144

135145
# These require visual inspection.
136146
repository-test-plots:
137147
@make clean
138148
make condaenv PYTHON=$(PYTHON)
139149
$(CONDA_ACTIVATE) $(PYTHON); $(PYTHON) setup.py develop | grep "Best"
140-
# Run using pythonw instead of python only so plot windows always work
141-
# for programs called from command line. This is needed for
142-
# OS-X, Python 3.5, and matplotlib instaled from pip.
150+
# Run using pythonw instead of python only so plot windows always work
151+
# for programs called from command line. This is needed for
152+
# OS-X, Python 3.5, and matplotlib instaled from pip.
143153
$(CONDA_ACTIVATE) $(PYTHON); $(pythonw) hapi_demo.py
144154

145155
repository-test-plots-other:
@@ -228,7 +238,7 @@ version-tag:
228238
# Install package in local directory (symlinks made to local dir)
229239
install-local:
230240
# python setup.py -e .
231-
source ~/.bashrc; $(CONDA_ACTIVATE) $(PYTHON); pip install --editable .
241+
$(CONDA_ACTIVATE) $(PYTHON); pip install --editable .
232242

233243
install:
234244
pip install 'hapiclient==$(VERSION)' --index-url $(URL)/simple

hapiclient/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
except:
2222
print('Problem importing Matplotlib. hapiplot function will not work.')
2323

24+
from hapiclient.util import HAPIError
25+
2426
# Allow "from hapiclient import autoplot"
2527
from hapiclient.autoplot.autoplot import autoplot
2628

0 commit comments

Comments
 (0)