Skip to content

Commit 17c3fd6

Browse files
author
Leah Wasser
authored
Merge pull request #62 from earthlab/master
update from master
2 parents 94a1fd2 + 214596d commit 17c3fd6

9 files changed

Lines changed: 177 additions & 185 deletions

File tree

.appveyor.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
build: false
2+
3+
matrix:
4+
fast_finish: true # immediately finish build once one of the jobs fails.
5+
6+
environment:
7+
matrix:
8+
- PYTHON: "C:\\myminiconda3"
9+
10+
init:
11+
- "ECHO %PYTHON%"
12+
13+
install:
14+
# If there is a newer build queued for the same PR, cancel this one.
15+
# The AppVeyor 'rollout builds' option is supposed to serve the same
16+
# purpose but it is problematic because it tends to cancel builds pushed
17+
# directly to master instead of just PR builds (or the converse).
18+
# credits: JuliaLang developers.
19+
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
20+
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
21+
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
22+
throw "There are newer queued builds for this pull request, failing early." }
23+
24+
- set URL="https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe"
25+
- curl -fsS -o miniconda3.exe %URL%
26+
- start /wait "" miniconda3.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%PYTHON%
27+
28+
- "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
29+
- call %PYTHON%\Scripts\activate
30+
31+
- conda config --set always_yes yes --set changeps1 no --set show_channel_urls true
32+
- conda update conda
33+
- conda config --add channels conda-forge --force
34+
- conda config --set safety_checks disabled
35+
- conda config --set channel_priority strict
36+
37+
- conda env create --file environment.yml
38+
- activate earth-analytics-python
39+
- conda list
40+
- conda info --all
41+
42+
test_script:
43+
- python -c "import rasterio"
44+
- python -c "import earthpy"

.gitignore

Lines changed: 3 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,4 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
4-
*$py.class
5-
6-
# C extensions
7-
*.so
8-
9-
# Distribution / packaging
10-
.Python
11-
env/
12-
build/
13-
develop-eggs/
14-
dist/
15-
downloads/
16-
eggs/
17-
.eggs/
18-
lib/
19-
lib64/
20-
parts/
21-
sdist/
22-
var/
23-
wheels/
24-
*.egg-info/
25-
.installed.cfg
26-
*.egg
27-
28-
# PyInstaller
29-
# Usually these files are written by a python script from a template
30-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31-
*.manifest
32-
*.spec
33-
34-
# Installer logs
35-
pip-log.txt
36-
pip-delete-this-directory.txt
37-
38-
# Unit test / coverage reports
39-
htmlcov/
40-
.tox/
41-
.coverage
42-
.coverage.*
43-
.cache
44-
nosetests.xml
45-
coverage.xml
46-
*.cover
47-
.hypothesis/
48-
49-
# Translations
50-
*.mo
51-
*.pot
52-
53-
# Django stuff:
54-
*.log
55-
local_settings.py
56-
57-
# Flask stuff:
58-
instance/
59-
.webassets-cache
60-
61-
# Scrapy stuff:
62-
.scrapy
63-
64-
# Sphinx documentation
65-
docs/_build/
66-
67-
# PyBuilder
68-
target/
69-
70-
# Jupyter Notebook
71-
.ipynb_checkpoints
72-
73-
# pyenv
74-
.python-version
75-
76-
# celery beat schedule file
77-
celerybeat-schedule
78-
79-
# SageMath parsed files
80-
*.sage.py
81-
82-
# dotenv
83-
.env
84-
85-
# virtualenv
86-
.venv
87-
venv/
88-
ENV/
89-
90-
# Spyder project settings
91-
.spyderproject
92-
.spyproject
93-
94-
# Rope project settings
95-
.ropeproject
96-
97-
# mkdocs documentation
98-
/site
99-
100-
# mypy
1011
.mypy_cache/
2+
.DS_Store
3+
.nbgrader.log
4+
3.6

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: python
2+
3+
matrix:
4+
include:
5+
- os: linux
6+
- os: osx
7+
language: generic
8+
9+
install:
10+
- chmod +x .travis/install.sh
11+
- ./.travis/install.sh
12+
13+
script:
14+
- source $HOME/miniconda/bin/activate
15+
- export PATH="$HOME/miniconda/bin:$PATH"
16+
- conda activate earth-analytics-python
17+
- python -c "import earthpy"

.travis/install.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
4+
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O ~/miniconda.sh
5+
else
6+
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
7+
fi
8+
9+
bash ~/miniconda.sh -b -p $HOME/miniconda
10+
export PATH="$HOME/miniconda/bin:$PATH"
11+
echo "conda activate base" >> ~/.bashrc
12+
source $HOME/miniconda/bin/activate
13+
conda config --set always_yes yes --set show_channel_urls true --set changeps1 no
14+
conda update -q conda
15+
conda config --add channels conda-forge
16+
conda info -a
17+
conda init bash
18+
conda env create -f environment.yml

Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
FROM jupyter/scipy-notebook
1+
FROM jupyter/minimal-notebook
22

3-
MAINTAINER Max Joseph <maxwell.b.joseph@colorado.edu>
3+
MAINTAINER Leah Wasser <leah.wasser@colorado.edu>
44

55
COPY environment.yml environment.yml
66

7-
RUN conda env update -n root -f environment.yml
7+
RUN conda env update --name base --file environment.yml \
8+
&& conda info --envs \
9+
&& conda list \
10+
&& rm environment.yml
811

9-
RUN conda info --envs
10-
11-
RUN conda list
12+
ENV PROJ_LIB $CONDA_DIR/share/proj
1213

14+
# Test imports
1315
RUN python -c "import rasterio"
14-
15-
RUN rm environment.yml
16+
RUN python -c "import earthpy"

README.md

Lines changed: 38 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,62 @@
11
# earth-analytics-environment
2-
Welcome to the Earth Analytics Environment Repository! Here you will find a conda envt that can be installed on your computer using a `.yaml` file. You will also find a docker image that can be used to actually run the environment in a containerized environment.
3-
42

3+
[![Build Status](https://travis-ci.com/earthlab/earth-analytics-python-env.svg?branch=master)](https://travis-ci.com/earthlab/earth-analytics-python-env)
4+
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/38a49nccgpl1metv?svg=true)](https://ci.appveyor.com/project/mbjoseph/earth-analytics-python-env)
55
[![DOI](https://zenodo.org/badge/132847711.svg)](https://zenodo.org/badge/latestdoi/132847711)
6-
76
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/earthlab/earth-analytics-binder/master)
7+
[![](https://images.microbadger.com/badges/image/earthlab/earth-analytics-python-env.svg)](https://microbadger.com/images/earthlab/earth-analytics-python-env "EA-Environment Docker Stats")
8+
![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/earthlab/earth-analytics-python-env?style=plastic)
9+
10+
Welcome to the Earth Analytics `Python` Environment Repository! Here you will find a conda environment that can be installed on your computer using a `.yaml` file. You will also find a docker image that can be used to actually run the environment in a containerized environment.
11+
812

913
## Contributors:
1014

11-
* Leah A. Wasser
12-
* Tim Head
13-
* Chris Holdgraf
14-
* Max Joseph
15+
* Leah A. Wasser (@lwasser)
16+
* Filipe fernandes (@ocefpaf)
17+
* Tim Head (@betatim)
18+
* Chris Holdgraf (@choldgraf)
19+
* Max Joseph (@mbjoseph)
1520
* Martha Morrissey
1621

1722
## Getting started with the Conda Environment
1823

1924
### 1. Install the Earth Lab Conda Environment on your Local Computer.
2025

21-
To begin, install git and conda for Python 3.x (we suggest 3.6).
26+
To begin, install `git` and `conda` for Python 3.x (we suggest 3.6).
2227

2328
Installing git: https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
2429

25-
Installing conda: https://www.anaconda.com/
26-
27-
We recommend installing geo-related dependencies with `conda-forge`. We
28-
have created a custom yaml list with all of the dependencies that you will
29-
need to run the lessons in this course. Follow
30-
these steps below to get your environment ready.
30+
Installing miniconda: https://docs.conda.io/en/latest/miniconda.html
3131

3232
About Conda Environments: https://conda.io/docs/user-guide/tasks/manage-environments.html
3333

34-
An environment for conda has been created specifically for this course. To load it, run:
34+
### Tutorial On Setup
35+
If you want a more detailed tutorial on setting up this environment using miniconda,
36+
please visit our learning portal: https://www.earthdatascience.org/workshops/setup-earth-analytics-python/
37+
38+
We recommend installing everything using the with `conda-forge` channel.
39+
40+
### Quick Start: Setup Your Environment
41+
42+
The tutorial above will provide you with more detailed setup instructions.
43+
But here are the cliff notes:
44+
45+
To begin, install the environment using:
3546

3647
`conda env create -f environment.yml`
3748

38-
* Note that it takes a bit of time to run this setup
39-
* Also note that for the code above to work, you need to be in the directory where the `environment.yml` file lives (ex: cd earth-analytics-python-env).
49+
This will take a bit of time to run.
50+
51+
* Also note that for the code above to work, you need to be in the directory where the `environment.yml` file lives so CD to that directory first
52+
53+
`$ cd earth-analytics-python-env`
54+
55+
56+
### Update Your EA Environment from the YAML File
57+
58+
You can update your environment at any time using:
4059

41-
To update this environment from a yaml file use:
4260
`conda env update -f environment.yml`
4361

4462
To manage your conda environments, use the following commands:
@@ -51,20 +69,6 @@ To manage your conda environments, use the following commands:
5169
[Conda 4.6 and later versions (all operating systems):](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
5270
```
5371
conda activate earth-analytics-python
54-
```
55-
56-
[Conda versions prior to 4.6:](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
57-
58-
On Mac or Linux:
59-
60-
```
61-
source activate earth-analytics-python
62-
```
63-
64-
On Windows:
65-
66-
```
67-
activate earth-analytics-python
6872
```
6973

7074
The environment name is `earth-analytics-python` as
@@ -74,8 +78,6 @@ defined in the `environment.yml` file.
7478

7579
[![Docker Automated build](https://img.shields.io/docker/automated/earthlab/earth-analytics-python-env.svg)](https://hub.docker.com/r/earthlab/earth-analytics-python-env/)
7680

77-
[![Docker Build Status](https://img.shields.io/docker/build/earthlab/earth-analytics-python-env.svg)](https://hub.docker.com/r/earthlab/earth-analytics-python-env/)
78-
7981
To run a docker container you need to do the following:
8082

8183
1. [Install docker](https://docs.docker.com/install/) and make sure it is running.
@@ -108,19 +110,6 @@ into your browser to run jupyter with the earth analytics environment installed!
108110
If you wish to update the earth analytics environment, do the following.
109111

110112
1. make a **PR** with changes to master
111-
2. **think** about your changes - don't do silly things or break things :)
112-
3. **merge** the PR into the master branch
113-
4. Check & wait till [Dockerhub](https://hub.docker.com/r/earthlab/earth-analytics-python-env/tags/) has built the image for the merging of the **PR** you can see builds in progress, [here](https://hub.docker.com/r/earthlab/earth-analytics-python-env/builds/)
114-
5. Finally, once the build is complete you can then you can update hub-ops repo with the newly tagged image.
115-
116-
## Important Notes
117-
If the update the `earthpy` package, you must specify the commit number that you
118-
wish to build `earthpy` against. This will ensure that the docker image
119-
automagically rebuilds using the latest version of `earthpy`
120-
121-
like this: `- git+https://github.com/earthlab/earthpy.git@283683affac9e46b1690c7913ebd2621c82ba43a`
122-
123-
This PR should kick off a rebuild of the docker image. But that docker image will
124-
not be usable until it's built off of the master branch.
113+
1. An code admin will **merge** the PR into the master branch
114+
1. Check & wait till [Dockerhub](https://hub.docker.com/r/earthlab/earth-analytics-python-env/tags/) has built the image for the merging of the **PR** you can see builds in progress, [here](https://hub.docker.com/r/earthlab/earth-analytics-python-env/builds/)
125115

126-
NOTE 2: The DockerHub build actually takes forever and ever. So it's best to check out the build status rather than assuming it's built.

0 commit comments

Comments
 (0)