Skip to content
Open
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ clean:
rm -rf ~/Applications/$(PROJECT_NAME)*; \
rm -f Scientific-Python-*.pkg; \
elif [[ $(MACHINE) == "Linux" ]]; then \
rm -rf $(HOME)/Scientific-Python; \
rm -rf $(HOME)/Scientific-Python-Environment; \
rm -f ./Scientific-Python-*.sh; \
rm -f $(HOME)/.local/share/applications/$(PROJECT_NAME_LOWER)-*.desktop; \
rm -f $(HOME)/.local/share/applications/$(PROJECT_NAME_LOWER)*.desktop; \
rm -f $(HOME)/.local/share/desktop-directories/$(PROJECT_NAME_LOWER).directory; \
elif [[ $(MACHINE) == "Windows" ]]; then \
echo "TODO add command to cleanup icons on Windows"; \
fi
4 changes: 3 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ dependencies:
- constructor >=3.6.0
- conda-libmamba-solver
- conda-standalone >=23.11.0,!=24.11.0
- menuinst
- conda >=23.11.0
- fmt !=10.2.0
- conda-build
- pip:
# ↓ TODO after menuinst release (something >2.3.1), move to normal dependencies list
- git+https://github.com/conda/menuinst.git@3d11307485f8de8b813e2cec6866e2c00aee11da
Comment on lines +13 to +15
Copy link
Member Author

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!

6 changes: 3 additions & 3 deletions recipes/scientific-python/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ specs:
- pip =25.1.1
- wheel =0.45.1
- conda =25.5.0
- mamba =2.1.1
- mamba =2.2.0
- threadpoolctl =3.6.0 # for our sysinfo menu command
# Menus
- sp-installer-menu =0.1.0
Expand All @@ -71,7 +71,7 @@ specs:
- requests =2.32.3
- pooch =1.8.2
# Data science and statistics.
- pandas =2.2.3
- pandas =2.3.0
- polars =1.30.0
- scikit-learn =1.6.1
- statsmodels =0.14.4
Expand Down Expand Up @@ -105,7 +105,7 @@ specs:
- pytest-timeout =2.4.0
- pre-commit =4.2.0
- ruff =0.11.12
- uv =0.7.9
- uv =0.7.11
# Doc building
- numpydoc =1.8.0
# OS-specific
Expand Down
9 changes: 6 additions & 3 deletions sp-installer-menu/make_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The 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)
12 changes: 6 additions & 6 deletions sp-installer-menu/menu/menu.json
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#",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use a variable to set both menu_name and Categories. Until conda/menuinst#343 is fixed, it's necessary that they be the same.

"menu_items": [{
"name": "Scientific Python Environment Info",
"description": "Information on the Scientific Python runtime environment",
Expand All @@ -18,7 +18,7 @@
},
"linux": {
"Categories": [
"Science"
"#FOLDER_AND_CATEGORY_NAME#"
]
},
"osx": {
Expand Down Expand Up @@ -52,7 +52,7 @@
"{{ MENU_DIR }}/#PKG_NAME#_open_prompt.sh"
],
"Categories": [
"Science"
"#FOLDER_AND_CATEGORY_NAME#"
],
"terminal": true
},
Expand Down Expand Up @@ -92,7 +92,7 @@
"{{ MENU_DIR }}/#PKG_NAME#_open_jupyterlab.sh"
],
"Categories": [
"Science"
"#FOLDER_AND_CATEGORY_NAME#"
],
"terminal": true
},
Expand Down Expand Up @@ -129,7 +129,7 @@
"https://lectures.scientific-python.org"
],
"Categories": [
"Science"
"#FOLDER_AND_CATEGORY_NAME#"
]
},
"osx": {
Expand Down Expand Up @@ -164,7 +164,7 @@
"https://discuss.scientific-python.org"
],
"Categories": [
"Science"
"#FOLDER_AND_CATEGORY_NAME#"
]
},
"osx": {
Expand Down
2 changes: 1 addition & 1 deletion sp-installer-menu/menu/open_prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this suppresses the display of the pushd stack when starting up the Scientific Python console

2 changes: 2 additions & 0 deletions sp-installer-menu/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ build:
number: {{ build }}
# skip: true # [not linux]
noarch: python
script_env:
- MENU_FOLDER_NAME=Scientific Python
script:
- pushd {{ RECIPE_DIR }}
- python make_menu.py
Expand Down
Loading