Skip to content

Move runtime.txt parsing into base class #1428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

manics
Copy link
Member

@manics manics commented Jun 24, 2025

There's a discussion somewhere (I can't remember where) about using https://github.com/astrofrog/pypi-timemachine or similar so Python packages can be installed as if pip were run in the past, similar to R. If we do this we should define the cutoff date for Python in the same way as for R, which is to use runtime.txt.

Something to consider is we haven't formally defined what runtime.txt contains.

Our docs state it should be one of:

  • name-version-yyyy-mm-dd: (r-<RVERSION>-<YYYY>-<MM>-<DD>)
  • name-version: (python-x.y)
    Have ``python-x.y`` in ``runtime.txt`` to run the repository with Python version x.y.
    See our `Python2 example repository <https://github.com/binder-examples/python2_runtime/blob/HEAD/runtime.txt>`_.
    Have ``r-<RVERSION>-<YYYY>-<MM>-<DD>`` in ``runtime.txt`` to run the repository with R version RVERSION and libraries from a YYYY-MM-DD snapshot of `Posit Package Manager <https://packagemanager.posit.co/client/#/repos/2/overview>`__.
    RVERSION can be set to 3.4, 3.5, 3.6, or to patch releases for the 3.5 and 3.6 series.
    If you do not specify a version, the latest release will be used (currently R 3.6).
    See our `R example repository <https://github.com/binder-examples/r/blob/HEAD/runtime.txt>`_.

Our tests say it can also be:

This PR handles all three formats. I've made a breaking change and redefined the existing .runtime property instead of creating a new one to avoid leaving an unused .runtime property that may cause confusion in the future.

@manics manics added the maintenance Under the hood fixes and improvements label Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Under the hood fixes and improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant