Skip to content

GEOPY-2769: optional environment parameter for pixi envs#163

Open
RomFloreani wants to merge 1 commit intomainfrom
GEOPY-2769
Open

GEOPY-2769: optional environment parameter for pixi envs#163
RomFloreani wants to merge 1 commit intomainfrom
GEOPY-2769

Conversation

@RomFloreani
Copy link
Copy Markdown
Contributor

@RomFloreani RomFloreani commented Apr 17, 2026

GEOPY-2769: add an environment optional parameter for pixi envs

see it in action, fixing GEOPY-QA worklfows at https://github.com/MiraGeoscience/geopy-qa/pull/21

Copilot AI review requested due to automatic review settings April 17, 2026 15:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an optional Pixi environment override to the reusable Python workflows to unblock downstream testing (GEOPY-QA) by allowing callers to select a specific Pixi environment name instead of always deriving it from the Python version.

Changes:

  • Added a new pixi-environment workflow input to the reusable static analysis and pytest workflows.
  • Updated Pixi setup usage to pass the optional environment name through to the Pixi setup action (and bumped the referenced action version).
  • Extended the composite Pixi setup action to prefer an explicit environment name when provided.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/reusable-python-static_analysis.yml Adds pixi-environment input and forwards it into Pixi environment setup.
.github/workflows/reusable-python-pytest.yml Adds pixi-environment input and forwards it into Pixi environment setup for matrix runs.
.github/actions/reusable-python-setup_pixi/action.yml Adds environment input and updates env-name selection logic to prefer it over derived name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

description: >
Pixi environment name to install. When provided, takes precedence over
the name derived from python-version (py<version-without-dots>).
required: false
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

New environment input is missing a type: field, while the other inputs in this action define types. For consistency across composite actions in this repo (and within this file), add type: string to inputs.environment.

Suggested change
required: false
required: false
type: string

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: declare type

Comment on lines +38 to +39
else
pixi_env="py${PYTHON_VERSION//./}"
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

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

If both inputs.environment and inputs.python-version are empty, this logic will produce pixi_env="py", which is very likely an invalid environment name and will fail later in a harder-to-diagnose way. Consider adding an explicit guard that exits with a clear error when neither value is provided.

Suggested change
else
pixi_env="py${PYTHON_VERSION//./}"
elif [ -n "$PYTHON_VERSION" ]; then
pixi_env="py${PYTHON_VERSION//./}"
else
echo "::error::Either 'environment' or 'python-version' must be provided."
exit 1

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: guard against values being both empty

(problem was existing before you changes, but Copilot has a point)

@sebhmg sebhmg changed the title GEOPY-2769: Adding an environment optional parameter to fix testing issue in GEOPY-QA GEOPY-2769: optional environment parameter for pixi envs Apr 17, 2026
Copy link
Copy Markdown
Contributor

@sebhmg sebhmg left a comment

Choose a reason for hiding this comment

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

Please see some suggestions on safety checks and naming

description: Python version to decide on the pixi environment to install
required: false
type: string
environment:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestions: rename not to confuse with builtin field name by github

environment creates some confusion with builtin environment: See https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/deploy-to-environment

Suggestion: environment-name, as in setup-micromamba (see https://github.com/mamba-org/setup-micromamba?tab=readme-ov-file#create-environment-from-environment-specs)

description: >
Pixi environment name to install. When provided, takes precedence over
the name derived from python-version (py<version-without-dots>).
required: false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: declare type

Comment on lines +38 to +39
else
pixi_env="py${PYTHON_VERSION//./}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: guard against values being both empty

(problem was existing before you changes, but Copilot has a point)

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.

3 participants