Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Commit

Permalink
Need to trigger environment update if git HEAD changes (#15)
Browse files Browse the repository at this point in the history
* Need to trigger environment update if git HEAD changes
Fixes #6

* Apply git only if current repo is project folder
Deactivate conda signal connection when git update is triggered
Correct notInFile algorithm by using Set

* Simplify handling of optional dependencies

* Correct test

* Improve __eq__ for ProjectTemplate

* Update README
  • Loading branch information
fcollonval committed Jun 1, 2020
1 parent 7b13d08 commit 2cadbb1
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 71 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,10 @@ kernel (i.e. only that kernel will be available when the project is opened) (def
#### Git integration
If the [`jupyterlab-git`](https://github.com/jupyterlab/jupyterlab-git) optional extension is installed
when creating a project, it will be initialized as a git repository.
If the [`jupyterlab-git`](https://github.com/jupyterlab/jupyterlab-git) optional extension is installed, the following features/behaviors are to be expected:
- When creating a project, it will be initialized as a git repository and a first commit with all produced files will be carried out.
- When the git HEAD changes (branch changes, pull action,...), the conda environment will be updated if the `environment.yml` file changed.
### Full configuration
Expand Down
4 changes: 3 additions & 1 deletion jupyter_project/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ def get(self):
defaultCondaPackages: str | null,
defaultPath: str | null,
editableInstall: bool,
schema: JSONschema | null
schema: JSONschema | null,
withGit: bool
}
}
"""
Expand Down Expand Up @@ -398,6 +399,7 @@ def setup_handlers(
"schema": (
project_template.schema if len(project_template.schema) else None
),
"withGit": True, # TODO make it configurable
}

handlers.append(
Expand Down
2 changes: 2 additions & 0 deletions jupyter_project/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def __eq__(self, other: "ProjectTemplate") -> bool:
"configuration_filename",
"configuration_schema",
"default_path",
"editable_install",
"filter_kernel",
"folder_name",
"module",
"schema",
Expand Down
1 change: 1 addition & 0 deletions jupyter_project/tests/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def test_get_settings(self):
"description": "Project template description",
"properties": {"count": {"type": "number"}},
},
"withGit": True,
},
}

Expand Down
Loading

0 comments on commit 2cadbb1

Please sign in to comment.