Skip to content

Conversation

@matthew-brett
Copy link
Contributor

Rename various variables to generalize package name. Not complete, but at least closer.

Make it easier to re-use scripts for another installer.

If we went further down this line, we would likely have to rename
`construct.yaml` to `construct.yaml.tpl` and similarly for files in
`assets`, then fill those Jinja template files from a master variable
`.yaml` file like `config.yaml`.   But perhaps that can wait for another
day.
# These names should correspond to PKG_INSTALLER_ARTIFACT_ID in tools/extract_version.sh
- uses: actions/download-artifact@v4
with:
pattern: ${{ env.PROJECT_NAME }}-Python-*
Copy link
Member

Choose a reason for hiding this comment

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

this line looks off to me, why the trailing -Python- before the *?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

$PERMS mv "$APP_DIR"/Scientific\ Python\ *.app "$SPI_APP_DIR"/
logger -p 'install.info' "ℹ️ Moving root project .app bundles from $APP_DIR to $PKG_APP_DIR."
# Set this to match the names generated from the menu package.
$PERMS mv "${APP_DIR}"/Scientific\ Python\ *.app "$PKG_APP_DIR"/
Copy link
Member

Choose a reason for hiding this comment

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

Just so I'm clear: it isn't possible to remove Scientific\ Python here too? IIUC this is for all the menu items, and there's no guarantee that they'll always have a nice clean prefix that glob-matches all of them... but in our case there is (by design). So in theory we could use a variable here for our installer, but it wouldn't generalize for use cases where the menu items have arbitrary names. Is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's right - because we have the custom names in construct.yaml as you've described, it would work for us, but not for any other names someone chose. We could do all this by templating and filling out the templates in a pre-build step, but perhaps we could leave that for another time.

logger -p 'install.info' "ℹ️ Setting custom folder icon for $SPI_APP_DIR and $SPI_APP_DIR_ROOT to $SPI_ICON_PATH."
for destPath in "$SPI_APP_DIR" "$SPI_APP_DIR_ROOT"; do
logger -p 'install.info' "ℹ️ Setting custom folder icon for $destPath to $SPI_ICON_PATH."
PKG_ICON_PATH="${PREFIX}/Menu/spi_mac_folder_icon.png"
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we should genericize the image names too, to remove the spi_ prefix (maybe in a follow-up PR?)


echo "::group::spi_sys_info"
python -u ${SP_INSTALL_PREFIX}/Menu/spi_sys_info.py nohtml
python -u ${PKG_INSTALL_PREFIX}/Menu/spi_sys_info.py nohtml
Copy link
Member

Choose a reason for hiding this comment

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

ditto here re: spi_ in filenames (not an image, but same logic may apply)

# Now extract the package and check that the _conda binary is
# properly signed as well
pkgutil --expand-full ${SP_INSTALLER_NAME} ./sp-extracted
pkgutil --expand-full ${PKG_INSTALLER_NAME} ./sp-extracted
Copy link
Member

Choose a reason for hiding this comment

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

another sp- here... maybe ./pkg-extracted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, and generalized the name below that.

@drammock drammock merged commit 48ee5c3 into scientific-python:main Jun 3, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants