Skip to content
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

Add a devcontainer #637

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Add a devcontainer #637

wants to merge 15 commits into from

Conversation

gwincr11
Copy link
Contributor

Add a devcontainer for easy codespace startup. It will start the container with a preconfigured python environment and all needed dev tooling to start workin on the project.

cc @craiglpeters

Add a devcontainer for easy codespace startup. It will start the container
 with a preconfigured python environment and all needed dev tooling to start working
 on the project.
Copy link

@el-mapache el-mapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on, love to see a streamlined dev setup! I left a few minor grammatical nits, things that seemed unclear to me as a first-time reader.

CONTRIBUTING.md Outdated

## Updating Javascript packages.

This project uses lerna to manage the multiple packages inside the packages folder. If you run npm command at the root it will run the command for each subpackage. This is good for working across packages, however more commonly we want to work with an individual package. To do this change directories into the package you wish to alter, then npm will run only for that package.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably say "npm commands" here, or "an npm command"

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
jupyter nbextension enable --py nbdime --sys-prefix

jupyter labextension link ./packages/nbdime --no-build
jupyter labextension install ./packages/labextension
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vidartf This codespace now includes Jupyter Lab, this will allow people starting up the codespace to have a pre-install Jupyter Lab to develop against.

However I am not sure the best way to link the local version of nbdime to the JupyterLab server.

This works, but I am not sure how to get changes to show up, I need to rebuild the docker container every time which is not great.

Is there some sort of script I could put together to automatically update Jupyter Lab? Thanks..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to use this command

jupyter labextension develop --overwrite .

But it was not working as I would expect. I wonder if there is some prereq I am not aware of that the cookie cutter does?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jupyter labextension develop . --overwrite is correct, but not sufficient on its own. If you change some code in the nbdime package, you would then need to

  • build the nbdime code (npm run build in packages/nbdime)
  • build typescript code of tha labextension, and then bundle it into the prebuilt extension (both covered by command npm run build:dev in packages/labextension)

To have it build automatically (and quicker), you can set up watchers:

  • npm run watch in packages/nbdime
  • npm run watch in packages/labextension
  • jupyter labextension watch ? This one currently doesn't work for me, so might be worth asking lab devs about if there is a good watch command..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool thanks. I will dig into this

.devcontainer/scripts/setup.sh Outdated Show resolved Hide resolved
scripts/rebuild-lab.sh Outdated Show resolved Hide resolved
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't run these shell script tasks on Windows :( If you could write those shell scripts as npm commands, that would be much more platform independent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could run them in linux on a codespace 😅, not a windows fan my self. I will move them.

@@ -0,0 +1,86 @@
{
"tasks": [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I would prefer not to include IDE specific files in a repo. Especially since that means that whoever maintains that repo will then have to maintain all the config files for those IDEs, even if they don't use it themselves. Making these tasks into "convenience" npm commands, and documenting them would be a better alternative.

@gwincr11
Copy link
Contributor Author

@vidartf I have made some updates to this to make it more codespaces centric. Wanna kick the tires and see what you think?

@gwincr11
Copy link
Contributor Author

I am just going to simplify this and go for docs for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants