Skip to content

yuuki0xff/all-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

all-python

The all-python is a helper script to build python interpreter and run some code on various python versions. Supports historical CPython versions since v2.0.1.

Installation

Download the pre-built docker image from docker hub.

$ docker pull yuuki0xff/all-python

If you want to build the docker image yourself, please run the following command. It takes few hours and 30GB+ free space on local storage to build.

$ make

Usage

Show help:

$ docker run --rm -it yuuki0xff/all-python --help

Run a small script on all python versions:

$ docker run --rm -it yuuki0xff/all-python -- -c 'print(type(u""))'
=====> 2.0.1 ~ 2.7.16 <=====
<type 'unicode'>

=====> 3.0 ~ 3.2.6 <=====
  File "<string>", line 1
    print(type(u""))
                 ^
SyntaxError: invalid syntax

Command returned non-zero exit status 1
Command: ['python', '-c', 'print(type(u""))']

=====> 3.3.0 ~ 3.7.3 <=====
<class 'str'>

Run a small script on python 2.7.x:

$ docker run --rm -it yuuki0xff/all-python -v 2.7.x -- -c 'print(type(u""))'
=====> 2.7.1 ~ 2.7.16 <=====
<type 'unicode'>

Run the unit test of flask framework on all python versions:

$ docker run --rm -it yuuki0xff/all-python \
	--before 'git clone --depth=1 https://github.com/pallets/flask &>/dev/null' \
	--exec 'cd flask && make test'

Enter interactive shell:

$ docker run --rm -it yuuki0xff/all-python bash

Related projects