Working as in developing and building own version of Python with whatever the modifications

Setting up environment

First thing is to clone official https://github.com/python/cpython locally or in some remote machine

(even better if you clone your own fork)

if you feel cloning is taking too much time, you can skip downloading entire commit tree by giving depth argument as 1 for just latest commit or whatever the depth you need

for example git clone [email protected]:m4tu4g/cpython.git --depth 1

I recommend setting up through dev container as cpython already has devcontainer definition defined. Note that this will require installing docker but a very clean process than setting up natively w/ libraries

Building

Once the dev container setup is completed, you can run make

to utilize all cpu cores or some specific number, you can use j arg, like make -j $(nsproc), but I just do -j16 out of habit

this will output python.exe executable and you can verify details of that build by running it

image.png

.exe extension here is just to remove conflict of getting mixed with folder name Python


more info available at https://devguide.python.org/