-
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.
Merge pull request #11 from fractal-analytics-platform/updates
Updates
- Loading branch information
Showing
5 changed files
with
121 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
_site/ | ||
__pycache__ | ||
.sass-cache/ | ||
.jekyll-cache/ | ||
.jekyll-metadata | ||
|
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,78 @@ | ||
INSTALL_INSTRUCTIONS_TITLE_1 = "## How to add this task to a Fractal instance\n" | ||
INSTALL_INSTRUCTIONS_TITLE_2 = "## How to install this task in a Python environment\n" | ||
|
||
|
||
def _get_default_template_pypi() -> str: | ||
lines = [ | ||
INSTALL_INSTRUCTIONS_TITLE_1, | ||
"Trigger a _PyPI_ task collection with package `__PROJECT_NAME__` and package version `__VERSION__`.", | ||
"", | ||
INSTALL_INSTRUCTIONS_TITLE_2, | ||
"```", | ||
'pip install "__PROJECT_NAME__==__VERSION__"', | ||
"```", | ||
] | ||
template = "\n".join(lines) + "\n" | ||
return template | ||
|
||
|
||
def _get_default_template_pypi_with_extra(extra: str) -> str: | ||
lines = [ | ||
INSTALL_INSTRUCTIONS_TITLE_1, | ||
f"Trigger a _PyPI_ task collection for package `__PROJECT_NAME__`, package version `__VERSION__` and package extras {extra}.", | ||
"", | ||
INSTALL_INSTRUCTIONS_TITLE_2, | ||
"```", | ||
f'pip install "__PROJECT_NAME__[{extra}]==__VERSION__"', | ||
"```", | ||
] | ||
template = "\n".join(lines) + "\n" | ||
return template | ||
|
||
|
||
def _get_default_template_wheel_url() -> str: | ||
lines = [ | ||
INSTALL_INSTRUCTIONS_TITLE_1, | ||
"1. Download the wheel file from [this link](__WHEEL_URL__),", | ||
"2. Trigger a _local_ task collection by uploading the wheel file.", | ||
"", | ||
INSTALL_INSTRUCTIONS_TITLE_2, | ||
"1. Download the wheel file from [this link](__WHEEL_URL__)", | ||
"2. `pip install __WHEEL_NAME__`", | ||
] | ||
template = "\n".join(lines) + "\n" | ||
return template | ||
|
||
|
||
def _get_default_template_wheel_url_with_extra(extra: str) -> str: | ||
lines = [ | ||
INSTALL_INSTRUCTIONS_TITLE_1, | ||
"1. Download the wheel file from [this link](__WHEEL_URL__),", | ||
f"2. Trigger a _local_ task collection by uploading the wheel file, with package extras {extra}.", | ||
"", | ||
INSTALL_INSTRUCTIONS_TITLE_2, | ||
"1. Download the wheel file from [this link](__WHEEL_URL__)", | ||
f"2. `pip install \"__WHEEL_NAME__[{extra}]\"`", | ||
] | ||
template = "\n".join(lines) + "\n" | ||
return template | ||
|
||
|
||
def get_pypi_install_instructions(*, project_name: str, version: str) -> str: | ||
instructions = _get_default_template_pypi() | ||
if project_name == "fractal-tasks-core": | ||
instructions = _get_default_template_pypi_with_extra(extra="fractal-tasks") | ||
instructions = instructions.replace("__PROJECT_NAME__", project_name) | ||
instructions = instructions.replace("__VERSION__", version) | ||
print(instructions) | ||
return instructions | ||
|
||
|
||
def get_github_install_instructions(*, wheel_name: str, wheel_url: str) -> str: | ||
instructions = _get_default_template_wheel_url() | ||
if wheel_name.startswith("scmultiplex"): | ||
instructions = _get_default_template_wheel_url_with_extra(extra="fractal-tasks") | ||
instructions = instructions.replace("__WHEEL_NAME__", wheel_name) | ||
instructions = instructions.replace("__WHEEL_URL__", wheel_url) | ||
print(instructions) | ||
return instructions |
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,11 +1,7 @@ | ||
https://pypi.org/project/fractal-tasks-core/ | ||
https://pypi.org/project/fractal-tasks-core | ||
https://pypi.org/project/fractal-faim-ipa | ||
https://pypi.org/project/fractal-lif-converters | ||
https://pypi.org/project/operetta-compose | ||
https://github.com/fractal-analytics-platform/fractal-helper-tasks | ||
https://github.com/fmi-basel/gliberal-scMultipleX | ||
|
||
# https://github.com/Apricot-Therapeutics/APx_fractal_task_collection | ||
# https://github.com/fractal-analytics-platform/fractal-plantseg-tasks | ||
# https://github.com/m-albert/fractal-ome-zarr-hcs-stitching/archive | ||
# https://github.com/fractal-analytics-platform/fractal-ilastik-tasksC/archive/refs/tags/0.1.1.zip | ||
https://github.com/m-albert/fractal-ome-zarr-hcs-stitching |