-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add name, public_repo, dock_image to JSON description
- Loading branch information
1 parent
8ab3feb
commit bd253d3
Showing
13 changed files
with
267 additions
and
78 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,15 @@ | ||
from setuptools import setup | ||
|
||
setup( | ||
name = 'simple_copy', | ||
version = '1.0.0', | ||
description = 'A ChRIS ds plugin that copies data', | ||
author = 'FNNDSC', | ||
author_email = 'dev@babyMRI.org', | ||
url = 'https://github.com/FNNDSC/chris_plugin/tree/master/examples/pl-copy', | ||
py_modules = ['simple_copy'], | ||
install_requires = ['chris_plugin'], | ||
license = 'MIT', | ||
python_requires = '>=3.10.2', | ||
entry_points = { | ||
'console_scripts': [ | ||
'simple_copy = simple_copy:main' | ||
] | ||
} | ||
name="simple_copy", | ||
version="1.0.0", | ||
description="A ChRIS ds plugin that copies data", | ||
author="FNNDSC", | ||
author_email="dev@babyMRI.org", | ||
url="https://github.com/FNNDSC/chris_plugin/tree/master/examples/pl-copy", | ||
py_modules=["simple_copy"], | ||
install_requires=["chris_plugin"], | ||
license="MIT", | ||
python_requires=">=3.10.2", | ||
entry_points={"console_scripts": ["simple_copy = simple_copy:main"]}, | ||
) |
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 |
---|---|---|
@@ -1,19 +1,15 @@ | ||
from setuptools import setup | ||
|
||
setup( | ||
name = 'git-clone', | ||
version = '1.0.0', | ||
description = 'A ChRIS fs plugin for git clone', | ||
author = 'FNNDSC', | ||
author_email = 'dev@babyMRI.org', | ||
url = 'https://github.com/FNNDSC/chris_plugin/tree/master/examples/pl-git-clone', | ||
py_modules = ['git_clone'], | ||
install_requires = ['chris_plugin'], | ||
license = 'MIT', | ||
python_requires = '>=3.10.2', | ||
entry_points = { | ||
'console_scripts': [ | ||
'git_clone_wrapper = git_clone:main' | ||
] | ||
} | ||
name="git-clone", | ||
version="1.0.0", | ||
description="A ChRIS fs plugin for git clone", | ||
author="FNNDSC", | ||
author_email="dev@babyMRI.org", | ||
url="https://github.com/FNNDSC/chris_plugin/tree/master/examples/pl-git-clone", | ||
py_modules=["git_clone"], | ||
install_requires=["chris_plugin"], | ||
license="MIT", | ||
python_requires=">=3.10.2", | ||
entry_points={"console_scripts": ["git_clone_wrapper = git_clone:main"]}, | ||
) |
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 |
---|---|---|
@@ -1,19 +1,15 @@ | ||
from setuptools import setup | ||
|
||
setup( | ||
name = 'replace', | ||
version = '1.0.0', | ||
description = 'A ChRIS ds plugin that does a find-and-replace in text files.', | ||
author = 'FNNDSC', | ||
author_email = 'dev@babyMRI.org', | ||
url = 'https://github.com/FNNDSC/chris_plugin/tree/master/examples/pl-replace', | ||
py_modules = ['replace'], | ||
install_requires = ['chris_plugin', 'tqdm'], | ||
license = 'MIT', | ||
python_requires = '>=3.10.2', | ||
entry_points = { | ||
'console_scripts': [ | ||
'replace = replace:main' | ||
] | ||
} | ||
name="replace", | ||
version="1.0.0", | ||
description="A ChRIS ds plugin that does a find-and-replace in text files.", | ||
author="FNNDSC", | ||
author_email="dev@babyMRI.org", | ||
url="https://github.com/FNNDSC/chris_plugin/tree/master/examples/pl-replace", | ||
py_modules=["replace"], | ||
install_requires=["chris_plugin", "tqdm"], | ||
license="MIT", | ||
python_requires=">=3.10.2", | ||
entry_points={"console_scripts": ["replace = replace:main"]}, | ||
) |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import sys | ||
|
||
|
||
class InvalidTag(Exception): | ||
pass | ||
|
||
|
||
class ImageTag: | ||
def __init__(self, tag: str, version: str, warnings=True): | ||
if "@" in tag: | ||
raise InvalidTag("Digest tags are not currently supported.") | ||
if len(split_on_colon := tag.split(":", maxsplit=1)) == 2: | ||
before_colon, after_colon = split_on_colon | ||
else: | ||
before_colon = tag | ||
after_colon = "" | ||
|
||
if warnings and version not in after_colon: | ||
_warn( | ||
f"You should specify the image version in the tag, e.g. {before_colon}:{version}" | ||
) | ||
|
||
parts = before_colon.split("/") | ||
if len(parts) == 2: | ||
if warnings: | ||
_warn(f"You should specify the registry, e.g. docker.io/{tag}") | ||
registry = "" | ||
user, name = parts | ||
elif len(parts) == 3: | ||
registry, user, name = parts | ||
else: | ||
raise InvalidTag( | ||
f"{tag} is not a valid OCI image tag: must be in the form <registry>/<repo>/<name>:<version>" | ||
) | ||
|
||
self.full_name = tag | ||
self.registry = registry | ||
self.user = user | ||
self.name = name | ||
self.repo = f"{user}/{name}" | ||
self.tag = after_colon | ||
|
||
|
||
def _warn(msg: str): | ||
print("\033[1;33mWARNING\033[22;39m", end=": ", file=sys.stderr) | ||
print(msg, file=sys.stderr) |
Oops, something went wrong.