Skip to content

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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
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!

40 changes: 20 additions & 20 deletions recipes/scientific-python/construct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,59 +55,59 @@ specs:
# Python
- python =3.13.3 # [not (osx and arm64)]
- python =3.13.2 # [osx and arm64] # allow_outdated
- pip =25.1.1
- pip =25.2
- wheel =0.45.1
- conda =25.5.0
- mamba =2.1.1
- conda =25.5.1
- mamba =2.3.1
- threadpoolctl =3.6.0 # for our sysinfo menu command
# Menus
- sp-installer-menu =0.1.0
# Scientific Python
- scipy =1.15.2
- scipy =1.16.0
- numpy =2.1.3 # allow_outdated, each new version has to wait for numba
- openblas =0.3.28 # allow_outdated, NumPy etc. need to update
- libblas =3.9.0=*openblas
# Web
- requests =2.32.3
- requests =2.32.4
- pooch =1.8.2
# Data science and statistics.
- pandas =2.2.3
- polars =1.30.0
- scikit-learn =1.6.1
- statsmodels =0.14.4
- pandas =2.3.1
- polars =1.31.0
- scikit-learn =1.7.1
- statsmodels =0.14.5
- pingouin =0.5.5 # https://pingouin-stats.org
# Jupyter
- jupyter =1.1.1
- jupyterlab =4.4.3
- jupyterlab =4.4.5
- nbclassic =1.3.1
- ipykernel =6.29.5
- ipykernel =6.30.0
# I/O
- openpyxl =3.1.5
- xlrd =2.0.1
- pyreadstat =1.2.9 # https://github.com/Roche/pyreadstat
- pyreadstat =1.3.0 # https://github.com/Roche/pyreadstat
# Image processing
- scikit-image =0.25.2
- pillow =11.2.1
- pillow =11.3.0
# Symbolic math
- sympy =1.14.0
# Viz
- matplotlib =3.10.3
- matplotlib =3.10.5
- ipympl =0.9.7
- seaborn =0.13.2
- plotly =6.1.2
- plotly =6.2.0
- ipywidgets =8.1.7
- termcolor =3.1.0
# Security
- defusedxml =0.7.1 # https://github.com/tiran/defusedxml
# Development
- cython =3.1.1
- pytest =8.4.0
- cython =3.1.2
- pytest =8.4.1
- pytest-timeout =2.4.0
- pre-commit =4.2.0
- ruff =0.11.12
- uv =0.7.9
- ruff =0.12.7
- uv =0.8.4
# Doc building
- numpydoc =1.8.0
- numpydoc =1.9.0
# OS-specific
- git =2.49.0 # [win]
- make =4.4.1 # [win]
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

4 changes: 2 additions & 2 deletions sp-installer-menu/menu/spi_sys_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)
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 was using "/" instead of newline when printing sysinfo to the terminal, oops

return

# build the output tree
Expand Down
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