Skip to content

Conversation

Micket
Copy link
Contributor

@Micket Micket commented Oct 11, 2025

Adding templates for the common %(version)s.tar.gz and v%(version)s.tar.gz sources.

E.g.

  1. VERSION_TAR_GZ
  2. VVERSION_ZIP

I didn't know a better option but to append an extra V for the second option.

I haven't tested anything yet, throwing it out there to gauge the response first.

@Micket Micket added the feature label Oct 11, 2025
@Micket
Copy link
Contributor Author

Micket commented Oct 11, 2025

ping @Flamefire who i think has explicitly requested this before.

Copy link
Contributor

@Flamefire Flamefire left a comment

Choose a reason for hiding this comment

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

Thanks for that

One alternative to VVERSION_<ext> could be V_VERSION_<ext> which makes it easier to see the "v" while being a single char longer

And maybe we should keep the SOURCE_ suffix at least for discoverability among the other templates

Comment on lines 273 to +274
})
TEMPLATE_CONSTANTS.update({
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to make this 2 operations which might slow down EB startup even further.

Suggested change
})
TEMPLATE_CONSTANTS.update({

Played around with the prior code how to do this with a single update call and dict comprehension (fastest in CPython) but not sure if people find this easier to read ;-)

TEMPLATE_CONSTANTS.update({
    key: value
    for ext in EXTENSIONS
    for key, value in (
        (
            f"SOURCE_{ext.replace('.', '_').upper()}",
            (f"%(name)s-%(version)s.{ext}", f"Source .{ext} bundle"),
        ),
        (
            f"SOURCELOWER_{ext.replace('.', '_').upper()}",
            (f"%(namelower)s-%(version)s.{ext}", f"Source .{ext} bundle with lowercase name"),
        ),
    )
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants