Skip to content

Commit b447f88

Browse files
authored
Merge pull request #16 from drammock/linux-menu
fix menu install location on Linux
2 parents 2ac84d8 + 3c1a92a commit b447f88

8 files changed

Lines changed: 44 additions & 38 deletions

File tree

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ clean:
4848
rm -rf ~/Applications/$(PROJECT_NAME)*; \
4949
rm -f Scientific-Python-*.pkg; \
5050
elif [[ $(MACHINE) == "Linux" ]]; then \
51-
rm -rf $(HOME)/Scientific-Python; \
51+
rm -rf $(HOME)/Scientific-Python-Environment; \
5252
rm -f ./Scientific-Python-*.sh; \
53-
rm -f $(HOME)/.local/share/applications/$(PROJECT_NAME_LOWER)-*.desktop; \
53+
rm -f $(HOME)/.local/share/applications/$(PROJECT_NAME_LOWER)*.desktop; \
54+
rm -f $(HOME)/.local/share/desktop-directories/$(PROJECT_NAME_LOWER).directory; \
5455
elif [[ $(MACHINE) == "Windows" ]]; then \
5556
echo "TODO add command to cleanup icons on Windows"; \
5657
fi

environment.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ channels:
44
- conda-forge
55

66
dependencies:
7-
- constructor >=3.6.0
7+
- conda >=23.11.0
8+
- conda-build
89
- conda-libmamba-solver
910
- conda-standalone >=23.11.0,!=24.11.0
10-
- menuinst
11-
- conda >=23.11.0
11+
- constructor >=3.6.0
1212
- fmt !=10.2.0
13-
- conda-build
13+
- menuinst >=2.4.0

recipes/scientific-python/construct.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,59 +55,59 @@ specs:
5555
# Python
5656
- python =3.13.3 # [not (osx and arm64)]
5757
- python =3.13.2 # [osx and arm64] # allow_outdated
58-
- pip =25.1.1
58+
- pip =25.2
5959
- wheel =0.45.1
60-
- conda =25.5.0
61-
- mamba =2.1.1
60+
- conda =25.5.1
61+
- mamba =2.3.1
6262
- threadpoolctl =3.6.0 # for our sysinfo menu command
6363
# Menus
6464
- sp-installer-menu =0.1.0
6565
# Scientific Python
66-
- scipy =1.15.2
66+
- scipy =1.16.0
6767
- numpy =2.1.3 # allow_outdated, each new version has to wait for numba
6868
- openblas =0.3.28 # allow_outdated, NumPy etc. need to update
6969
- libblas =3.9.0=*openblas
7070
# Web
71-
- requests =2.32.3
71+
- requests =2.32.4
7272
- pooch =1.8.2
7373
# Data science and statistics.
74-
- pandas =2.2.3
75-
- polars =1.30.0
76-
- scikit-learn =1.6.1
77-
- statsmodels =0.14.4
74+
- pandas =2.3.1
75+
- polars =1.31.0
76+
- scikit-learn =1.7.1
77+
- statsmodels =0.14.5
7878
- pingouin =0.5.5 # https://pingouin-stats.org
7979
# Jupyter
8080
- jupyter =1.1.1
81-
- jupyterlab =4.4.3
81+
- jupyterlab =4.4.5
8282
- nbclassic =1.3.1
83-
- ipykernel =6.29.5
83+
- ipykernel =6.30.0
8484
# I/O
8585
- openpyxl =3.1.5
8686
- xlrd =2.0.1
87-
- pyreadstat =1.2.9 # https://github.com/Roche/pyreadstat
87+
- pyreadstat =1.3.0 # https://github.com/Roche/pyreadstat
8888
# Image processing
8989
- scikit-image =0.25.2
90-
- pillow =11.2.1
90+
- pillow =11.3.0
9191
# Symbolic math
9292
- sympy =1.14.0
9393
# Viz
94-
- matplotlib =3.10.3
94+
- matplotlib =3.10.5
9595
- ipympl =0.9.7
9696
- seaborn =0.13.2
97-
- plotly =6.1.2
97+
- plotly =6.2.0
9898
- ipywidgets =8.1.7
9999
- termcolor =3.1.0
100100
# Security
101101
- defusedxml =0.7.1 # https://github.com/tiran/defusedxml
102102
# Development
103-
- cython =3.1.1
104-
- pytest =8.4.0
103+
- cython =3.1.2
104+
- pytest =8.4.1
105105
- pytest-timeout =2.4.0
106106
- pre-commit =4.2.0
107-
- ruff =0.11.12
108-
- uv =0.7.9
107+
- ruff =0.12.7
108+
- uv =0.8.4
109109
# Doc building
110-
- numpydoc =1.8.0
110+
- numpydoc =1.9.0
111111
# OS-specific
112112
- git =2.49.0 # [win]
113113
- make =4.4.1 # [win]

sp-installer-menu/make_menu.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
out_path = Path(prefix) / "Menu"
1717
pkg_name = environ["PKG_NAME"]
1818
pkg_version = environ["PKG_VERSION"]
19+
folder_and_category_name = environ["MENU_FOLDER_NAME"] # defined in `meta.yaml`
1920

2021
if not out_path.is_dir():
2122
out_path.mkdir(parents=True)
@@ -30,6 +31,7 @@ def txt_replace(txt):
3031
("#PREFIX#", prefix),
3132
("#PKG_NAME#", pkg_name),
3233
("#PKG_VERSION#", pkg_version),
34+
("#FOLDER_AND_CATEGORY_NAME#", folder_and_category_name),
3335
):
3436
txt = txt.replace(start, end)
3537
return txt
@@ -39,14 +41,15 @@ def txt_replace(txt):
3941
(out_path / f"{pkg_name}.json").write_text(txt_replace(menu_txt))
4042

4143

42-
for fstem in ("console", "info", "web", "forum", 'jupyter'):
44+
for fstem in ("console", "info", "web", "forum", "jupyter"):
4345
for ext in ("icns", "ico", "png"):
4446
copy2(in_path / f"{fstem}.{ext}", out_path / f"{pkg_name}_{fstem}.{ext}")
4547

4648
for ext in ("sh", "applescript", "bat"):
47-
for fpath in in_path.glob(f'*.{ext}'):
49+
for fpath in in_path.glob(f"*.{ext}"):
4850
(out_path / f"{pkg_name}_{fpath.name}").write_text(
49-
txt_replace(fpath.read_text()))
51+
txt_replace(fpath.read_text())
52+
)
5053

5154
for fname in ("spi_sys_info.py", "spi_mac_folder_icon.png"):
5255
copy2(in_path / fname, out_path / fname)

sp-installer-menu/menu/menu.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json-schema.org/draft-07/schema",
33
"$id": "https://schemas.conda.io/menuinst-1.schema.json",
4-
"menu_name": "Scientific Python (#PKG_VERSION#)",
4+
"menu_name": "#FOLDER_AND_CATEGORY_NAME#",
55
"menu_items": [{
66
"name": "Scientific Python Environment Info",
77
"description": "Information on the Scientific Python runtime environment",
@@ -18,7 +18,7 @@
1818
},
1919
"linux": {
2020
"Categories": [
21-
"Science"
21+
"#FOLDER_AND_CATEGORY_NAME#"
2222
]
2323
},
2424
"osx": {
@@ -52,7 +52,7 @@
5252
"{{ MENU_DIR }}/#PKG_NAME#_open_prompt.sh"
5353
],
5454
"Categories": [
55-
"Science"
55+
"#FOLDER_AND_CATEGORY_NAME#"
5656
],
5757
"terminal": true
5858
},
@@ -92,7 +92,7 @@
9292
"{{ MENU_DIR }}/#PKG_NAME#_open_jupyterlab.sh"
9393
],
9494
"Categories": [
95-
"Science"
95+
"#FOLDER_AND_CATEGORY_NAME#"
9696
],
9797
"terminal": true
9898
},
@@ -129,7 +129,7 @@
129129
"https://lectures.scientific-python.org"
130130
],
131131
"Categories": [
132-
"Science"
132+
"#FOLDER_AND_CATEGORY_NAME#"
133133
]
134134
},
135135
"osx": {
@@ -164,7 +164,7 @@
164164
"https://discuss.scientific-python.org"
165165
],
166166
"Categories": [
167-
"Science"
167+
"#FOLDER_AND_CATEGORY_NAME#"
168168
]
169169
},
170170
"osx": {

sp-installer-menu/menu/open_prompt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ echo "Using $(python --version) from $(which python)"
1212
echo "This is Scientific Python version #PKG_VERSION#"
1313
workdir="$HOME/Documents/scientific-python"
1414
mkdir -p $workdir
15-
pushd $workdir
15+
pushd $workdir > /dev/null

sp-installer-menu/menu/spi_sys_info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from importlib import import_module
1515
from importlib.metadata import metadata
16-
from os import sep
16+
from os import linesep
1717
from xml.etree import ElementTree
1818

1919

@@ -149,7 +149,7 @@ def main():
149149

150150
if len(sys.argv) > 1 and sys.argv[1] == "nohtml":
151151
print() # blank line
152-
print(sep.join(out), file=sys.stdout)
152+
print(linesep.join(out), file=sys.stdout)
153153
return
154154

155155
# build the output tree

sp-installer-menu/meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ build:
1111
number: {{ build }}
1212
# skip: true # [not linux]
1313
noarch: python
14+
script_env:
15+
- MENU_FOLDER_NAME=Scientific Python
1416
script:
1517
- pushd {{ RECIPE_DIR }}
1618
- python make_menu.py

0 commit comments

Comments
 (0)