← Back to issue list

conda plugin: simplify source url/checksum handling

View original Github issue

Metadata

Project
snapcraft
Number
#2804
Type
pull request
State
merged
Author
cjp256
Labels
Created
Updated
Closed

Current evaluation

Merged changes simplifying the conda plugin's URL and checksum handling by replacing dictionaries with a helper function. Fixes mypy type checking errors and improves clarity. Approved and merged after passing CI checks.

Suggested action:

No scores available.

Issue body

Replace _MINICONDA_URL and _MINICONDA_UNKNOWN_URL dictionaries with a helper function using a single format string and dictionary to lookup known checksums. This is motivated by an uprev of mypy which stumbles on the type checking: ``` snapcraft/plugins/conda.py:111: error: Item "None" of "Optional[str]" has no attribute "format" snapcraft/plugins/conda.py:116: error: Value of type "object" is not indexable snapcraft/plugins/conda.py:118: error: Value of type "object" is not indexable ``` This helper was introduced as `_get_miniconda_source()`, and CondaPlugin's method was renamed to `_get_miniconda_script()` to better indicate its behavior. Signed-off-by: Chris Patterson <chris.patterson@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `./runtests.sh static`? - [ ] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged changes simplifying the conda plugin's URL and checksum handling by replacing dictionaries with a helper function. Fixes mypy type checking errors and improves clarity. Approved and merged after passing CI checks.
qwen3.6-35b-a3b-mtp-q6 Merged changes simplifying the conda plugin's source URL and checksum handling. Dictionaries were replaced with a helper function and format string to resolve mypy type errors. Method names were updated for clarity.
qwen3.6-35b-a3b-mtp-q6 Merged refactoring of the conda plugin to replace URL and checksum dictionaries with a centralized helper function. This resolves mypy type checking errors and consolidates source URL lookup logic for improved maintainability.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2608 conda plugin: new plugin snapcraft merged Merged a new conda plugin for snapcraft. Approved by one reviewer, passed CI checks, and added 611 lines across seven files with 92.85% diff coverage.
70%