Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: heroku/heroku-buildpack-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v300
Choose a base ref
...
head repository: heroku/heroku-buildpack-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 10 commits
  • 33 files changed
  • 4 contributors

Commits on Aug 18, 2025

  1. Record cache restore duration for the empty cache case too (#1871)

    So that all builds have this field populated for consistency.
    edmorley authored Aug 18, 2025
    Configuration menu
    Copy the full SHA
    b0974da View commit details
    Browse the repository at this point in the history
  2. Simplify handling of caches written by older buildpack versions (#1870)

    It's been a year since the current metadata store implementation was
    added, so it's fine to now simplify the handling/messaging around
    reading older cache versions.
    
    This cleanup will also help with the upcoming switch to the new JSON
    metadata store implementation.
    
    GUS-W-19361163.
    edmorley authored Aug 18, 2025
    Configuration menu
    Copy the full SHA
    e375ad3 View commit details
    Browse the repository at this point in the history
  3. Prepare release v301 (#1872)

    Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
    heroku-linguist[bot] authored Aug 18, 2025
    Configuration menu
    Copy the full SHA
    c1f9208 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2025

  1. Remove support for BUILDPACK_S3_BASE_URL (#1875)

    Since:
    - Metrics show it to be unused on Heroku.
    - It's not supported by the CNB, so removing it improves parity.
    - As a feature it's pretty fragile, since unless someone managed
      to keep up with all changes we make to our S3 bucket, builds
      would break every time we bump versions. (And as such, anyone
      using it should be carefully curating the buildpack versions, and
      so can patch the buildpack as part of that repackaging/automation
      process.)
    
    GUS-W-19372843.
    edmorley authored Aug 19, 2025
    Configuration menu
    Copy the full SHA
    82379bd View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2025

  1. Stop setting the PYTHONHASHSEED env var (#1876)

    Since hash randomisation has been enabled by default since Python 3.3,
    so setting `PYTHONHASHSEED=random` is the same as the default, and so
    redundant.
    
    See:
    - https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHASHSEED
    - https://docs.python.org/3/reference/datamodel.html#object.__hash__
    - https://docs.python.org/3/whatsnew/3.3.html#builtin-functions-and-types
    
    GUS-W-19372908.
    edmorley authored Aug 20, 2025
    Configuration menu
    Copy the full SHA
    fc152f6 View commit details
    Browse the repository at this point in the history
  2. Add tests for build metadata contents (#1877)

    It's not possible to test `bin/report` functionality directly using Hatchet
    tests, however, we can dump the raw build metadata store values to at
    least test that we're storing the expected keys/values.
    
    This complements the non-Hatchet container CI test that checks that
    `bin/report` exits zero.
    
    This has been split out of the upcoming `bin/report` refactor PR to
    keep that PR smaller, and to more easily demonstrate the change in
    behaviour after that PR.
    
    GUS-W-19384622.
    edmorley authored Aug 20, 2025
    Configuration menu
    Copy the full SHA
    3c27de9 View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2025

  1. Refactor buildpack data store and bin/report (#1878)

    The Node.js buildpack had a set of Bash helper utils for managing a
    key-value store of metadata, that could be added to during the build,
    and then output when bin/report was run. When the Python buildpack
    added support for bin/report, its implementation was based on the
    Node.js one, with some further small improvements.
    
    However, there remains a number of issues with the design:
    1. It handles different data types (string vs int vs float vs bool) at
       `bin/report` time, so requires a hardcoded mapping of values which
       can (and does) get out of sync. (Plus doesn't work well for some
       cases, like jvm-common being wrapped by the other JVM related
       buildpacks.)
    2. It tries to escape newlines and carriage returns, but there are a
       number of edge cases still not handled properly which result in some
       fields not being sent to Honeycomb properly.
    
    In order to work around the above, Manuel created a jq based approach
    for use by the JVM buildpacks:
    https://github.com/heroku/heroku-buildpack-jvm-common/blob/4fd6e4f8f258a5766a8b2e9ffec2690675b00879/lib/metrics.sh
    
    However, that doesn't have the full API of the existing solution (it's
    missing the ability to fetch previous values; something which Python
    needs), and I spotted a few more places where things can be optimised.
    
    In addition, now that we're using jq and JSON internally in the
    buildpack, it makes sense for us to update cytokine to support the
    build report being emitted as JSON too (in addition to YAML),
    particularly since cytokine then submits the report to Vacuole as
    JSON afterwards.
    
    And in fact, since JSON is roughly a subset of YAML (at least for the
    simple data types and schema we're using for the build report), we can
    start emitting the build report as JSON now, rather than needing to wait
    for the cytokine change to land first. (We'll still want to update
    cytokine to use a JSON parser though, just to avoid any edge cases in
    the future).
    
    The new implementation:
    - Sets the data type at the call site where the metadata is set,
      rather than relying on a hardcoded mapping at time of retrieval.
    - Uses jq to do the string escaping, so much less fragile than the
      hand-rolled implementation.
    - Uses a simplified initialisation/setup API, which avoids the need to
      call both `init` and `setup`.
    - Has been rewritten to avoid unnecessary processes calls, redirections,
      and patterns that required disabling a number of shellcheck warnings.
    
    I've confirmed that metrics still appear in Honeycomb with the changes
    here.
    
    After this merges, I'll open PRs against some of the other language
    buildpacks that don't yet implement `bin/report`, using the improved
    implementation from here (with simplifications since other buildpacks
    won't need the legacy data store handling that Python needs to support
    caches written by older buildpack versions).
    
    GUS-W-19344754.
    
    Signed-off-by: Ed Morley <501702+edmorley@users.noreply.github.com>
    edmorley authored Aug 21, 2025
    Configuration menu
    Copy the full SHA
    db9788b View commit details
    Browse the repository at this point in the history
  2. Prepare release v302 (#1879)

    Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
    heroku-linguist[bot] authored Aug 21, 2025
    Configuration menu
    Copy the full SHA
    5ffcadf View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2025

  1. Bump uv from 0.8.9 to 0.8.13 (#1880)

    * Bump uv from 0.8.9 to 0.8.13
    
    Bumps [uv](https://github.com/astral-sh/uv) from 0.8.9 to 0.8.13.
    - [Release notes](https://github.com/astral-sh/uv/releases)
    - [Changelog](https://github.com/astral-sh/uv/blob/main/CHANGELOG.md)
    - [Commits](astral-sh/uv@0.8.9...0.8.13)
    
    ---
    updated-dependencies:
    - dependency-name: uv
      dependency-version: 0.8.13
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    * Add changelog entry
    
    ---------
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
    dependabot[bot] and edmorley authored Aug 22, 2025
    Configuration menu
    Copy the full SHA
    5671ed7 View commit details
    Browse the repository at this point in the history
  2. Use EPOCHREALTIME in build_data timing logic (#1881)

    Built-in Bash (5.0+) variable, a float with microseconds precision.
    Faster, simpler, and more portable (no longer requires GNU date).
    
    Logging it with six digits worth of precision instead of the previous three, but a float is a float ;)
    
    GUS-W-19404492.
    
    Co-authored-by: Ed Morley <501702+edmorley@users.noreply.github.com>
    dzuelke and edmorley authored Aug 22, 2025
    Configuration menu
    Copy the full SHA
    30086f2 View commit details
    Browse the repository at this point in the history
Loading