-
-
Notifications
You must be signed in to change notification settings - Fork 242
Simplify CI, fix mybinder.org build, bump python (and other) versions #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e47f1da
Switch to `mamba-org/setup-micromamba`
jtpio d313fda
Update command
jtpio 4a04bb7
Add mamba
jtpio fc44028
Unpin all versions of packages + remove xeus-cling+friends
yuvipanda 37ca40b
Merge remote-tracking branch 'jtpio/micromamba-action' into remove-xt…
yuvipanda 16fba40
Hackily stop deactivating the environment
yuvipanda bb527a7
Get rid of pyinvoke, don't manage environments ourselves
yuvipanda d0d1e20
Add R + irkernel to environment
yuvipanda ce56295
Add missing `build.py` file
yuvipanda d243a24
Add ruamel.yaml to dependencies
yuvipanda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,84 +13,15 @@ generation user interface of Project Jupyter. | |
The demo requires `mamba`, available as part of [Mambaforge](https://github.com/conda-forge/miniforge) and the package | ||
requirements are described in `environment.yml` | ||
|
||
To install the environment and demofiles, we use [pyinvoke](http://pyinvoke.org). To install pyinvoke with `mamba` call: | ||
```bash | ||
mamba install -c conda-forge invoke packaging pyyaml | ||
``` | ||
|
||
### Create the environment | ||
|
||
To create the conda environment with all the dependencies and jupyterlab extensions for the demo, run: | ||
|
||
```bash | ||
invoke environment # optionally --env-name=my-env-name | ||
``` | ||
|
||
The default environment name is `jupyterlab-demo`. | ||
|
||
To create the environment and remove previous installation, call: | ||
|
||
```bash | ||
invoke environment --clean | ||
``` | ||
|
||
### Activate/deactivate the environment | ||
|
||
To activate the conda environment, run: | ||
|
||
```bash | ||
source activate jupyterlab-demo | ||
``` | ||
|
||
To deactivate the conda environment, run: | ||
|
||
```bash | ||
source deactivate | ||
``` | ||
|
||
### Additional demo files | ||
|
||
The demo includes files from a number of other repositories. To install these files, | ||
run: | ||
|
||
```bash | ||
invoke demofiles | ||
``` | ||
|
||
To remove demofiles and download again all: | ||
``` | ||
invoke demofiles --clean | ||
``` | ||
|
||
### R Language support | ||
|
||
To add R language support, run: | ||
|
||
```bash | ||
invoke r | ||
``` | ||
|
||
### Julia Language support | ||
|
||
To add Julia language support follow the instructions [here](https://github.com/JuliaLang/IJulia.jl#installation). | ||
|
||
|
||
### Uninstalling | ||
|
||
To uninstall the demofiles and enviornment, call: | ||
|
||
``` | ||
invoke clean | ||
``` | ||
TODO: More installation instructions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to keep this TODO in the readme or open an issue instead? |
||
|
||
# Demo guide | ||
|
||
The basic outline of the JupyterLab demo is described in the file `jupyterlab.md`. | ||
|
||
|
||
# External Repositories | ||
|
||
Our `invoke demofiles` clones repos from other authors. The details of these repos are as follows: | ||
Our `build.py` clones repos from other authors. The details of these repos are as follows: | ||
|
||
| Name | Author |License | | ||
|---|---|---| | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#!/usr/bin/env python3 | ||
from pathlib import Path | ||
import subprocess | ||
from ruamel.yaml import YAML | ||
import shutil | ||
import os | ||
|
||
yaml = YAML() | ||
|
||
DEMO_FOLDER = "demofiles" | ||
|
||
def setup_talks(): | ||
""" | ||
Reads yaml file talks.yml and moves files and folders specified in yaml | ||
file to the a folder matching the name of the talk Args: talk_name: name | ||
of talk in talks.yml Note: yaml file is assumed to be a dict of dicts of | ||
lists and dict with the following python format: | ||
{'talk_name': | ||
{'folders': | ||
{'src0': 'dest0', 'src1': 'dest1'] | ||
'files': | ||
['file0', file1'] | ||
'rename': | ||
{'oldname': 'newname'} | ||
} | ||
} | ||
or in yaml format: | ||
talk_name: | ||
folders: | ||
src0: dest0 | ||
src1: dest1 | ||
files: | ||
- file0 | ||
- file1 | ||
rename: | ||
oldname: newname | ||
""" | ||
with open("talks.yml", "r") as stream: | ||
talks = yaml.load(stream) | ||
for talk_name in talks: | ||
Path(talk_name).mkdir(parents=True, exist_ok=True) | ||
|
||
if "files" in talks[talk_name]: | ||
for f in talks[talk_name]["files"]: | ||
copied_path = os.path.join(talk_name, os.path.basename(f)) | ||
shutil.copy(f, copied_path) | ||
assert os.path.isfile(copied_path), f"{f} failed to copy into {talk_name}" | ||
|
||
if "folders" in talks[talk_name]: | ||
for src, dst in talks[talk_name]["folders"].items(): | ||
dst = os.path.join(talk_name, dst) | ||
if not os.path.exists(dst): | ||
shutil.copytree(src, dst) | ||
|
||
if "rename" in talks[talk_name]: | ||
for old_file, new_file in talks[talk_name]["rename"].items(): | ||
moved_file = os.path.join(talk_name, os.path.basename(old_file)) | ||
if os.path.isfile(moved_file): | ||
os.rename(moved_file, os.path.join(talk_name, new_file)) | ||
elif os.path.isfile(old_file): | ||
shutil.copy(old_file, os.path.join(talk_name, new_file)) | ||
|
||
def setup_demofiles(): | ||
print("creating demofolder") | ||
demo_folder = Path("demofiles") | ||
demo_folder.mkdir(parents=True, exist_ok=True) | ||
|
||
# list of repos used in demo | ||
print(f"cloning repos into demo folder {demo_folder}") | ||
reponames = [ | ||
"jakevdp/PythonDataScienceHandbook", | ||
"swissnexSF/Urban-Data-Challenge", | ||
"altair-viz/altair", | ||
"QuantEcon/QuantEcon.notebooks", | ||
"theandygross/TCGA", | ||
"aymericdamien/TensorFlow-Examples", | ||
"bloomberg/bqplot", | ||
] | ||
for repo in reponames: | ||
target_path = demo_folder / Path(repo.split("/")[1]) | ||
if not target_path.is_dir(): | ||
subprocess.check_call([ | ||
"git", "clone", "--depth", "1", | ||
f"https://github.com/{repo}.git" | ||
], cwd=demo_folder) | ||
# This empty file and empty folder are for showing drag and drop in jupyterlab | ||
Path("move_this_file.txt").touch() | ||
Path("move_it_here").mkdir(exist_ok=True) | ||
|
||
def main(): | ||
setup_demofiles() | ||
setup_talks() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to pin it to
>=4.3.5
? Currently it resolves toIf we are giving a demo of jupyterlab, it feels like this one package should probably be pinned as we would not want to receive reports for things already fixed in newer versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krassowski I dug into why it was resolving to this, and it's because that's the base version in repo2docker - last updated in jupyterhub/repo2docker#1369. I agree that we should try to use latest jupyterlab here if possible. If we pin to >=4.3.5, it means that when repo2docker goes to a version above 4.3.5, it'll simply just get pinned to that rather than latest. Do you know if there's a way to specify 'latest' with a conda environment.yml?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krassowski ok, so I've made jupyterhub/repo2docker#1407 which bumps up all versions of things, including lab to 4.3.5. For this PR, my suggestion is that we either find a way to specify 'latest' or let it be unpinned, as once that repo2docker PR lands >=4.3.5 is a no-op
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've checked with a colleague working on conda and it seems there is no way to specify
latest
but if we had an option to customize the CLI invocation we could use--prune
to ignore constraints from currently installed versions.