Skip to content

Commit 334f3de

Browse files
authored
Merge pull request #48 from MAAP-Project/add-devcontainer-configuration
initial config for dev container - requires manual pip install
2 parents ec937f0 + cd25034 commit 334f3de

File tree

7 files changed

+135
-43
lines changed

7 files changed

+135
-43
lines changed

.devcontainer/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM mcr.microsoft.com/devcontainers/miniconda:0-3
2+
3+
# Copy environment.yml (if found) to a temp location so we update the environment. Also
4+
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
5+
USER root
6+
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
7+
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
8+
&& rm -rf /tmp/conda-tmp
9+
10+
USER vscode
11+
12+
# WORKDIR /tmp/stac_ipyleaflet
13+
# COPY . .
14+
# RUN /opt/conda/bin/pip install -e .
15+
16+
17+
# [Optional] Uncomment to install a different version of Python than the default
18+
# RUN conda install -y python=3.6 \
19+
# && pip install --no-cache-dir pipx \
20+
# && pipx reinstall-all
21+
22+
# [Optional] Uncomment this section to install additional OS packages.
23+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
24+
# && apt-get -y install --no-install-recommends <your-package-list-here>
25+
26+

.devcontainer/devcontainer.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/miniconda
3+
{
4+
"name": "Miniconda (Python 3)",
5+
"build": {
6+
"context": "..",
7+
"dockerfile": "Dockerfile"
8+
},
9+
"features": {
10+
"ghcr.io/devcontainers/features/node:1": {}
11+
}
12+
13+
// Features to add to the dev container. More info: https://containers.dev/features.
14+
// "features": {},
15+
16+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
17+
// "forwardPorts": [],
18+
19+
// Use 'postCreateCommand' to run commands after the container is created.
20+
//"postCreateCommand": "pip install -e ."
21+
//"postCreateCommand": "conda init bash"
22+
23+
// Configure tool-specific properties.
24+
// "customizations": {},
25+
26+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
27+
// "remoteUser": "root"
28+
}

.devcontainer/noop.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
This file is copied into the container along with environment.yml* from the
2+
parent folder. This is done to prevent the Dockerfile COPY instruction from
3+
failing if no environment.yml is found.

demo.ipynb

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,24 @@
55
"execution_count": 1,
66
"id": "4f7d5321-d82b-4ed4-8136-832f932b30b5",
77
"metadata": {},
8-
"outputs": [],
8+
"outputs": [
9+
{
10+
"ename": "ImportError",
11+
"evalue": "libpoppler.so.126: cannot open shared object file: No such file or directory",
12+
"output_type": "error",
13+
"traceback": [
14+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
15+
"\u001b[0;31mImportError\u001b[0m Traceback (most recent call last)",
16+
"Cell \u001b[0;32mIn[1], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mstac_ipyleaflet\u001b[39;00m\n",
17+
"File \u001b[0;32m/workspaces/stac_ipyleaflet/stac_ipyleaflet/__init__.py:7\u001b[0m\n\u001b[1;32m 4\u001b[0m __email__ \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124maimee@developmentseed.org\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 5\u001b[0m __version__ \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m0.1.0\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m----> 7\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcore\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;241m*\u001b[39m\n",
18+
"File \u001b[0;32m/workspaces/stac_ipyleaflet/stac_ipyleaflet/core.py:15\u001b[0m\n\u001b[1;32m 13\u001b[0m \u001b[38;5;66;03m#from pydantic import BaseModel\u001b[39;00m\n\u001b[1;32m 14\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mshapely\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mgeometry\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Polygon\n\u001b[0;32m---> 15\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mrioxarray\u001b[39;00m\n\u001b[1;32m 16\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mxarray\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mxr\u001b[39;00m\n\u001b[1;32m 17\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mnumpy\u001b[39;00m\n",
19+
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/rioxarray/__init__.py:5\u001b[0m\n\u001b[1;32m 2\u001b[0m __author__ \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\"\"\u001b[39m\u001b[38;5;124mrioxarray Contributors\u001b[39m\u001b[38;5;124m\"\"\"\u001b[39m\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mimportlib\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmetadata\u001b[39;00m\n\u001b[0;32m----> 5\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mrioxarray\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mraster_array\u001b[39;00m \u001b[38;5;66;03m# noqa\u001b[39;00m\n\u001b[1;32m 6\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mrioxarray\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mraster_dataset\u001b[39;00m \u001b[38;5;66;03m# noqa\u001b[39;00m\n\u001b[1;32m 7\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mrioxarray\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_io\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m open_rasterio \u001b[38;5;66;03m# noqa\u001b[39;00m\n",
20+
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/rioxarray/raster_array.py:19\u001b[0m\n\u001b[1;32m 16\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mtyping\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Any, Literal, Optional, Union\n\u001b[1;32m 18\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mnumpy\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mnp\u001b[39;00m\n\u001b[0;32m---> 19\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mrasterio\u001b[39;00m\n\u001b[1;32m 20\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mrasterio\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmask\u001b[39;00m\n\u001b[1;32m 21\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mrasterio\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mwarp\u001b[39;00m\n",
21+
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/rasterio/__init__.py:28\u001b[0m\n\u001b[1;32m 24\u001b[0m os\u001b[38;5;241m.\u001b[39madd_dll_directory(os\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mabspath(p))\n\u001b[1;32m 27\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mrasterio\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_show_versions\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m show_versions\n\u001b[0;32m---> 28\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mrasterio\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_version\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m gdal_version, get_geos_version, get_proj_version\n\u001b[1;32m 29\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mrasterio\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcrs\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m CRS\n\u001b[1;32m 30\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mrasterio\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mdrivers\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m driver_from_extension, is_blacklisted\n",
22+
"\u001b[0;31mImportError\u001b[0m: libpoppler.so.126: cannot open shared object file: No such file or directory"
23+
]
24+
}
25+
],
926
"source": [
1027
"import stac_ipyleaflet"
1128
]
@@ -59,9 +76,9 @@
5976
],
6077
"metadata": {
6178
"kernelspec": {
62-
"display_name": "stac_ipyleaflet",
79+
"display_name": "Python 3 (ipykernel)",
6380
"language": "python",
64-
"name": "stac_ipyleaflet"
81+
"name": "python3"
6582
},
6683
"language_info": {
6784
"codemirror_mode": {
@@ -73,7 +90,7 @@
7390
"name": "python",
7491
"nbconvert_exporter": "python",
7592
"pygments_lexer": "ipython3",
76-
"version": "3.9.15"
93+
"version": "3.10.8"
7794
}
7895
},
7996
"nbformat": 4,

environment.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: stac_ipyleaflet
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- jupyterlab
6+
- pip
7+
- gdal
8+
- rasterio>=1.3

setup.cfg

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
[metadata]
2+
name = stac_ipyleaflet
3+
version=0.1.0
4+
author = Aimee Barciauskas
5+
description=ipyleaflet customized for discovering, visualizing and interacting with STAC and workspace data.
6+
long_description = file: README.md
7+
url = https://github.com/abarciauskas-bgse/stac_ipyleaflet
8+
keywords = stac_ipyleaflet
9+
author_email=aimee@developmentseed.org
10+
license=MIT license
11+
classifiers =
12+
Development Status :: 2 - Pre-Alpha
13+
Intended Audience :: Developers
14+
License :: OSI Approved :: MIT License
15+
Natural Language :: English
16+
Programming Language :: Python :: 3.8
17+
Programming Language :: Python :: 3.9
18+
Programming Language :: Python :: 3.10
19+
120
[bumpversion]
221
current_version = 0.1.0
322
commit = True
@@ -18,3 +37,30 @@ universal = 1
1837
exclude = docs
1938
[tool:pytest]
2039
collect_ignore = ['setup.py']
40+
41+
[options]
42+
packages = find:
43+
include_package_data=True
44+
zip_safe=False
45+
tests_require=[pytest>=3]
46+
install_requires =
47+
ipyleaflet==0.17.2
48+
ipywidgets==8.0.4
49+
ipyevents
50+
matplotlib
51+
pydantic
52+
shapely
53+
rasterio
54+
requests
55+
rio_tiler
56+
rioxarray
57+
xarray
58+
pystac_client==0.6.1
59+
60+
[options.extras_require]
61+
test =
62+
pytest
63+
64+
[options.packages.find]
65+
where = stac_ipyleaflet
66+

setup.py

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,7 @@
22

33
"""The setup script."""
44

5-
from setuptools import setup, find_packages
5+
from setuptools import setup
66

7-
with open('README.rst') as readme_file:
8-
readme = readme_file.read()
9-
10-
with open('HISTORY.rst') as history_file:
11-
history = history_file.read()
12-
13-
requirements = [ ]
14-
15-
test_requirements = ['pytest>=3', ]
16-
17-
setup(
18-
author="Aimee Barciauskas",
19-
author_email='aimee@developmentseed.org',
20-
python_requires='>=3.6',
21-
classifiers=[
22-
'Development Status :: 2 - Pre-Alpha',
23-
'Intended Audience :: Developers',
24-
'License :: OSI Approved :: MIT License',
25-
'Natural Language :: English',
26-
'Programming Language :: Python :: 3',
27-
'Programming Language :: Python :: 3.6',
28-
'Programming Language :: Python :: 3.7',
29-
'Programming Language :: Python :: 3.8',
30-
],
31-
description="ipyleaflet customized for discovering, visualizing and interacting with STAC and workspace data.",
32-
install_requires=requirements,
33-
license="MIT license",
34-
long_description=readme + '\n\n' + history,
35-
include_package_data=True,
36-
keywords='stac_ipyleaflet',
37-
name='stac_ipyleaflet',
38-
packages=find_packages(include=['stac_ipyleaflet', 'stac_ipyleaflet.*']),
39-
test_suite='tests',
40-
tests_require=test_requirements,
41-
url='https://github.com/abarciauskas-bgse/stac_ipyleaflet',
42-
version='0.1.0',
43-
zip_safe=False,
44-
)
7+
if __name__ == "__main__":
8+
setup()

0 commit comments

Comments
 (0)