Skip to content

Conversation

@flofriday
Copy link
Contributor

@flofriday flofriday commented Dec 29, 2025

Explanation

Python3 before the 3.1 release creates a binary name python3.0 instead of the more commonpython3 which every other version uses. I know with 3.0.x being EOL for more than 16 years this probably won't be a common occurrence. But I'm currently working on a archiving project that requires some truly old historic versions and this tool really helped building those CPython versions from source (thanks for that 🎉).

Here is a screenshot of the output from a 3.0.1 build and the binaries produced (please ignore the empty block in the middle I did the cd calls with a lot of intermittent steps and so removed it for readability):

Screenshot 2025-12-29 at 15 16 07

Considerations

  1. I don't have access to a Windows PC right now so I only implemented that fix for Unix platforms (but I don't think it will apply for Windows since the naming seems to be completely different).
  2. Should I add some tests for this behavior?

How I build it

I'm certain you already have well working developing setup but I fell into some pitfalls (like installing python2), so here is the docker file I used for completeness. It fails without before this PR and works with the changes.

Docker setup
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

# Install build dependencies and curl for uv
RUN apt-get update && apt-get install -y build-essential gdb lcov pkg-config \
    libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
    libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
    lzma lzma-dev tk-dev uuid-dev zlib1g-dev libzstd-dev \
    inetutils-inetd curl git python2.7

# Create a link to call python2 with `python` which is the name the build script for early Python3 versions require it.
RUN ln -s /usr/bin/python2.7 /usr/bin/python

# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:$PATH"

COPY . . 
RUN uv run every-python install v3.0.1
RUN uv run -- every-python run v3.0.1 -- python --version

CMD ["/bin/bash"]

On my arm based macOS host machine I also had to build it with the x86 compatibility mode: docker build --platform linux/amd64 -t every-python .

Copy link
Owner

@savannahostrowski savannahostrowski left a comment

Choose a reason for hiding this comment

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

One nit but this looks solid to me! Thank you again!

@flofriday
Copy link
Contributor Author

Should we also add some tests here and if so can I assume that all of your CI runners have a python2 binary in the path as python (at least on Unix, probably python.exe on Windows)?
Maybe I'm missing something but I couldn't find any setup for the runners to see which dependencies are installed. 😅

@savannahostrowski
Copy link
Owner

In the test.yml, there's a job for each platform. Let's not worry about python2. I'm happy saying this supports 3+.

@flofriday
Copy link
Contributor Author

flofriday commented Jan 7, 2026

Oh 100% let's not worry about building python2. But the configure script (or Makefile) <= Python3.3 shells out to python so we need a python2 binary somewhere to add a test to build Python3.0.

Docker setup with missing python2
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

# Install build dependencies and curl for uv
RUN apt-get update && apt-get install -y build-essential gdb lcov pkg-config \
    libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
    libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \
    lzma lzma-dev tk-dev uuid-dev zlib1g-dev libzstd-dev \
    inetutils-inetd curl git 


# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.local/bin:$PATH"

COPY . . 
RUN uv run every-python install v3.0.1
RUN uv run -- every-python run v3.0.1 -- python --version

CMD ["/bin/bash"]

Run with: docker build --platform linux/amd64 -t every-python .

UPDATE: Apprently I was wrong, cannot reproduce this one 😅

Copy link
Owner

@savannahostrowski savannahostrowski left a comment

Choose a reason for hiding this comment

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

Ah, I see. Thinking about this more, I think this is pretty niche and would require us to install Python 2 on the runners. I think the change is safe enough to accept as is, without the tests.

@savannahostrowski savannahostrowski merged commit 5eb115f into savannahostrowski:main Jan 7, 2026
9 checks passed
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.

2 participants