-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't export outside annotations (#1729)
* Add option to omit outside annotations * update changelog * Fix mot format and test * Fix outside in mot * fix repo problem * t * Update CHANGELOG.md Co-authored-by: Nikita Manovich <[email protected]>
- Loading branch information
1 parent
18f6b2f
commit fc2fb61
Showing
6 changed files
with
69 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 |
---|---|---|
|
@@ -104,7 +104,7 @@ class GitWrapper: | |
def __init__(self, config=None): | ||
self.repo = None | ||
|
||
if config is not None and osp.isdir(config.project_dir): | ||
if config is not None and config.project_dir: | ||
self.init(config.project_dir) | ||
|
||
@staticmethod | ||
|
@@ -116,8 +116,12 @@ def spawn(cls, path): | |
spawn = not osp.isdir(cls._git_dir(path)) | ||
repo = git.Repo.init(path=path) | ||
if spawn: | ||
author = git.Actor("Nobody", "[email protected]") | ||
repo.index.commit('Initial commit', author=author) | ||
repo.config_writer().set_value("user", "name", "User") \ | ||
.set_value("user", "email", "[email protected]") \ | ||
.release() | ||
# gitpython does not support init, use git directly | ||
repo.git.init() | ||
repo.git.commit('-m', 'Initial commit', '--allow-empty') | ||
return repo | ||
|
||
def init(self, path): | ||
|
@@ -377,9 +381,10 @@ def categories(self): | |
def get(self, item_id, subset=None, path=None): | ||
if path: | ||
raise KeyError("Requested dataset item path is not found") | ||
if subset is None: | ||
subset = '' | ||
return self._subsets[subset].items[item_id] | ||
item_id = str(item_id) | ||
subset = subset or '' | ||
subset = self._subsets[subset] | ||
return subset.items[item_id] | ||
|
||
def put(self, item, item_id=None, subset=None, path=None): | ||
if path: | ||
|
@@ -567,7 +572,7 @@ def get(self, item_id, subset=None, path=None): | |
rest_path = path[1:] | ||
return self._sources[source].get( | ||
item_id=item_id, subset=subset, path=rest_path) | ||
return self._subsets[subset].items[item_id] | ||
return super().get(item_id, subset) | ||
|
||
def put(self, item, item_id=None, subset=None, path=None): | ||
if path is None: | ||
|
@@ -754,9 +759,10 @@ def save(self, save_dir=None): | |
|
||
@staticmethod | ||
def generate(save_dir, config=None): | ||
config = Config(config) | ||
config.project_dir = save_dir | ||
project = Project(config) | ||
project.save(save_dir) | ||
project.config.project_dir = save_dir | ||
return project | ||
|
||
@staticmethod | ||
|