-
Notifications
You must be signed in to change notification settings - Fork 2
fix menu install location on Linux #16
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
base: main
Are you sure you want to change the base?
Changes from all commits
97b1540
bfcae90
ae1d171
175cb98
d68f0e1
108dd00
2ab1a36
4772808
4838afd
504b5ed
2c22c08
ac5de13
7d66581
27e8037
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
out_path = Path(prefix) / "Menu" | ||
pkg_name = environ["PKG_NAME"] | ||
pkg_version = environ["PKG_VERSION"] | ||
folder_and_category_name = environ["MENU_FOLDER_NAME"] # defined in `meta.yaml` | ||
|
||
if not out_path.is_dir(): | ||
out_path.mkdir(parents=True) | ||
|
@@ -30,6 +31,7 @@ def txt_replace(txt): | |
("#PREFIX#", prefix), | ||
("#PKG_NAME#", pkg_name), | ||
("#PKG_VERSION#", pkg_version), | ||
("#FOLDER_AND_CATEGORY_NAME#", folder_and_category_name), | ||
): | ||
txt = txt.replace(start, end) | ||
return txt | ||
|
@@ -39,14 +41,15 @@ def txt_replace(txt): | |
(out_path / f"{pkg_name}.json").write_text(txt_replace(menu_txt)) | ||
|
||
|
||
for fstem in ("console", "info", "web", "forum", 'jupyter'): | ||
for fstem in ("console", "info", "web", "forum", "jupyter"): | ||
for ext in ("icns", "ico", "png"): | ||
copy2(in_path / f"{fstem}.{ext}", out_path / f"{pkg_name}_{fstem}.{ext}") | ||
|
||
for ext in ("sh", "applescript", "bat"): | ||
for fpath in in_path.glob(f'*.{ext}'): | ||
for fpath in in_path.glob(f"*.{ext}"): | ||
(out_path / f"{pkg_name}_{fpath.name}").write_text( | ||
txt_replace(fpath.read_text())) | ||
txt_replace(fpath.read_text()) | ||
) | ||
Comment on lines
+44
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are linter auto-fixes |
||
|
||
for fname in ("spi_sys_info.py", "spi_mac_folder_icon.png"): | ||
copy2(in_path / fname, out_path / fname) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft-07/schema", | ||
"$id": "https://schemas.conda.io/menuinst-1.schema.json", | ||
"menu_name": "Scientific Python (#PKG_VERSION#)", | ||
"menu_name": "#FOLDER_AND_CATEGORY_NAME#", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use a variable to set both |
||
"menu_items": [{ | ||
"name": "Scientific Python Environment Info", | ||
"description": "Information on the Scientific Python runtime environment", | ||
|
@@ -18,7 +18,7 @@ | |
}, | ||
"linux": { | ||
"Categories": [ | ||
"Science" | ||
"#FOLDER_AND_CATEGORY_NAME#" | ||
] | ||
}, | ||
"osx": { | ||
|
@@ -52,7 +52,7 @@ | |
"{{ MENU_DIR }}/#PKG_NAME#_open_prompt.sh" | ||
], | ||
"Categories": [ | ||
"Science" | ||
"#FOLDER_AND_CATEGORY_NAME#" | ||
], | ||
"terminal": true | ||
}, | ||
|
@@ -92,7 +92,7 @@ | |
"{{ MENU_DIR }}/#PKG_NAME#_open_jupyterlab.sh" | ||
], | ||
"Categories": [ | ||
"Science" | ||
"#FOLDER_AND_CATEGORY_NAME#" | ||
], | ||
"terminal": true | ||
}, | ||
|
@@ -129,7 +129,7 @@ | |
"https://lectures.scientific-python.org" | ||
], | ||
"Categories": [ | ||
"Science" | ||
"#FOLDER_AND_CATEGORY_NAME#" | ||
] | ||
}, | ||
"osx": { | ||
|
@@ -164,7 +164,7 @@ | |
"https://discuss.scientific-python.org" | ||
], | ||
"Categories": [ | ||
"Science" | ||
"#FOLDER_AND_CATEGORY_NAME#" | ||
] | ||
}, | ||
"osx": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,4 @@ echo "Using $(python --version) from $(which python)" | |
echo "This is Scientific Python version #PKG_VERSION#" | ||
workdir="$HOME/Documents/scientific-python" | ||
mkdir -p $workdir | ||
pushd $workdir | ||
pushd $workdir > /dev/null | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this suppresses the display of the |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
|
||
from importlib import import_module | ||
from importlib.metadata import metadata | ||
from os import sep | ||
from os import linesep | ||
from xml.etree import ElementTree | ||
|
||
|
||
|
@@ -149,7 +149,7 @@ def main(): | |
|
||
if len(sys.argv) > 1 and sys.argv[1] == "nohtml": | ||
print() # blank line | ||
print(sep.join(out), file=sys.stdout) | ||
print(linesep.join(out), file=sys.stdout) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was using "/" instead of newline when printing sysinfo to the terminal, oops |
||
return | ||
|
||
# build the output tree | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
conda/menuinst#340 is finally merged!