Skip to content

Commit ca2add2

Browse files
authored
Merge pull request #57 from ICESat2-SlideRule/reqt
reduce requirements.txt to minimal set needed to run client
2 parents 897f751 + 90b3e22 commit ca2add2

File tree

7 files changed

+44
-23
lines changed

7 files changed

+44
-23
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Tests
22

33
on:
44
push:
5-
branches: "*"
5+
branches: main
66
pull_request:
77
branches: main
88

@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
CONDA_ENV: [3.8, 3.9]
16+
CONDA_ENV: [3.8, 3.9, unpinned]
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v2

ci/environment-3.8.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ channels:
33
- conda-forge
44
dependencies:
55
- python=3.8
6-
- geopandas
7-
- numpy
6+
- geopandas-base
87
- pip
98
- pytest
109
- requests

ci/environment-3.9.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ channels:
33
- conda-forge
44
dependencies:
55
- python=3.9
6-
- geopandas
7-
- numpy
6+
- geopandas-base
87
- pip
98
- pytest
109
- requests

ci/environment-unpinned.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: sliderule-ci
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python
6+
- pip
7+
- pytest

requirements.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
11
requests
2-
setuptools_scm
32
numpy
4-
ipykernel
5-
ipywidgets
6-
ipyleaflet
7-
tk
8-
matplotlib
9-
cartopy
10-
pandas
113
geopandas
12-
h5py
13-
pyproj
14-
scipy
154
shapely

sliderule/io.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,22 @@
2727
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
2828
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929

30+
import sys
3031
import warnings
3132
import datetime
32-
import scipy.io
3333
import geopandas
34-
import h5py
3534
import numpy as np
3635

36+
# imports with warnings if not present
37+
try:
38+
import scipy.io
39+
except ModuleNotFoundError as e:
40+
sys.stderr.write("Warning: missing packages, some functions will throw an exception if called. (%s)\n" % (str(e)))
41+
try:
42+
import h5py
43+
except ModuleNotFoundError as e:
44+
sys.stderr.write("Warning: missing packages, some functions will throw an exception if called. (%s)\n" % (str(e)))
45+
3746
# attributes for ATL06-SR variables
3847
def get_attributes(**kwargs):
3948
# set default keyword arguments

sliderule/ipysliderule.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,34 @@
2828
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929

3030
import os
31+
import sys
3132
import copy
3233
import datetime
33-
import ipywidgets
34-
import ipyleaflet
3534
import numpy as np
3635
from traitlets.utils.bunch import Bunch
37-
import tkinter.filedialog
38-
import IPython.display
3936
import sliderule.io
4037

38+
# imports with warnings if not present
39+
try:
40+
import ipywidgets
41+
except ModuleNotFoundError as e:
42+
sys.stderr.write("Warning: missing packages, some functions will throw an exception if called. (%s)\n" % (str(e)))
43+
try:
44+
import tkinter.filedialog
45+
except ModuleNotFoundError as e:
46+
sys.stderr.write("Warning: missing packages, some functions will throw an exception if called. (%s)\n" % (str(e)))
47+
try:
48+
import IPython.display
49+
except ModuleNotFoundError as e:
50+
sys.stderr.write("Warning: missing packages, some functions will throw an exception if called. (%s)\n" % (str(e)))
51+
52+
# imports that raise error if not present
53+
try:
54+
import ipyleaflet
55+
except ModuleNotFoundError as e:
56+
sys.stderr.write("Error: missing required packages. (%s)\n" % (str(e)))
57+
raise
58+
4159
class widgets:
4260
def __init__(self):
4361
# dropdown menu for setting asset

0 commit comments

Comments
 (0)