Skip to content

micropython/mip/mip: Add an alias for codeberg repos.#1101

Open
agatti wants to merge 1 commit intomicropython:masterfrom
agatti:mip-codeberg
Open

micropython/mip/mip: Add an alias for codeberg repos.#1101
agatti wants to merge 1 commit intomicropython:masterfrom
agatti:mip-codeberg

Conversation

@agatti
Copy link
Contributor

@agatti agatti commented Mar 25, 2026

Summary

This PR introduces an alias to access codeberg repos from within the mip embedded package manager.

Right now packages hosted on codeberg could only be referenced by their full URL, unlike other packages hosted on either GitHub or GitLab. To make access those packages easier, now they can be referenced as "codeberg:org/repo@branch".

This is the micropython-lib counterpart of micropython/micropython#18989.

Testing

The same package mentioned in the other repo's PR (https://codeberg.org/agatti/micropython-package-test) was installed successfully via import mip; mip.install("$URL") on an ESP32C3.

The ESP8266 is not able to access codeberg repos due to a SSL cipher incompatibility (see #400), but there isn't much that can be done for that right now.

Trade-offs and Alternatives

The same remarks about whether adding a new provider or not, mentioned in the micropython PR still apply.

A similar refactoring has been applied to the on-device python code - albeit with a few more aggressive size optimisations, having a final size impact of 48 bytes. Unfortunately codeberg having a different parameter order than the other hosts forces having some named parameters in the string template. A more approachable size reduction could be had by renaming _HOSTS into something shorter. Suggestions for the new name are welcome :)

Generative AI

I did not use generative AI tools when creating this PR.

@agatti agatti force-pushed the mip-codeberg branch 2 times, most recently from 2454ec3 to ae3629a Compare March 25, 2026 08:21
@agatti agatti marked this pull request as draft March 26, 2026 17:36
@agatti
Copy link
Contributor Author

agatti commented Mar 26, 2026

See micropython/micropython#18989 (comment) on why this is marked as draft.

@agatti agatti marked this pull request as ready for review March 26, 2026 17:50
@agatti agatti changed the title micropython/mip/mip/__init__.py: Add an alias for codeberg repos. micropython/mip/mip: Add an alias for codeberg repos. Mar 26, 2026
@agatti agatti requested a review from Josverl March 26, 2026 18:35
@agatti agatti force-pushed the mip-codeberg branch 2 times, most recently from 9e0452c to 85fabcd Compare March 26, 2026 18:46
This commit introduces an alias to access codeberg repos from within the
mip embedded package manager.

Right now packages hosted on codeberg could only be referenced by their
full URL, unlike other packages hosted on either GitHub or GitLab.  To
make access those packages easier, now they can be referenced as
"codeberg:org/repo" when used inside `mip.install`.

Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
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.

1 participant