From f24f1a45a7be2f6e5c7a63cfd309ba97425b9e61 Mon Sep 17 00:00:00 2001 From: Shivansh-007 Date: Wed, 14 Apr 2021 09:54:58 +0530 Subject: [PATCH] Adds python 3.9.4 and 3.10.0a7 (#217) * pkg(python-3.9.4): Adds python 3.9.4 * pkg(python-3.10.0a7): Adds python 3.10.0a7 * pkg(python-3.10.0a7): More pythonic 3.10.0a7 code * pkg(python-3.10.0a7): Use semver versioning * pkg(python-3.10.0a7): remove 'py3' alias and add 'py' * pkg(python-3.9.4): remove 'py3' alias and add 'py' --- packages/python/3.10.0-alpha.7/build.sh | 22 ++++++++++++++++++++ packages/python/3.10.0-alpha.7/environment | 1 + packages/python/3.10.0-alpha.7/metadata.json | 5 +++++ packages/python/3.10.0-alpha.7/run | 3 +++ packages/python/3.10.0-alpha.7/test.py | 7 +++++++ packages/python/3.9.4/build.sh | 21 +++++++++++++++++++ packages/python/3.9.4/environment | 1 + packages/python/3.9.4/metadata.json | 5 +++++ packages/python/3.9.4/run | 3 +++ packages/python/3.9.4/test.py | 18 ++++++++++++++++ 10 files changed, 86 insertions(+) create mode 100755 packages/python/3.10.0-alpha.7/build.sh create mode 100644 packages/python/3.10.0-alpha.7/environment create mode 100644 packages/python/3.10.0-alpha.7/metadata.json create mode 100644 packages/python/3.10.0-alpha.7/run create mode 100644 packages/python/3.10.0-alpha.7/test.py create mode 100755 packages/python/3.9.4/build.sh create mode 100644 packages/python/3.9.4/environment create mode 100644 packages/python/3.9.4/metadata.json create mode 100644 packages/python/3.9.4/run create mode 100644 packages/python/3.9.4/test.py diff --git a/packages/python/3.10.0-alpha.7/build.sh b/packages/python/3.10.0-alpha.7/build.sh new file mode 100755 index 0000000..914353f --- /dev/null +++ b/packages/python/3.10.0-alpha.7/build.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl "https://www.python.org/ftp/python/3.10.0/Python-3.10.0a7.tgz" -o python.tar.gz +tar xzf python.tar.gz --strip-components=1 +rm python.tar.gz + +./configure --prefix "$PREFIX" --with-ensurepip=install +make -j$(nproc) +make install -j$(nproc) + +cd .. + +rm -rf build + +# This is alpha version, hence most of the libraries are not compatible with python3.10.0 +# bin/pip3 install numpy scipy pandas pycrypto whoosh bcrypt passlib diff --git a/packages/python/3.10.0-alpha.7/environment b/packages/python/3.10.0-alpha.7/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/python/3.10.0-alpha.7/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/python/3.10.0-alpha.7/metadata.json b/packages/python/3.10.0-alpha.7/metadata.json new file mode 100644 index 0000000..18c1722 --- /dev/null +++ b/packages/python/3.10.0-alpha.7/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "python", + "version": "3.10.0-alpha.7", + "aliases": ["py", "python3"] +} diff --git a/packages/python/3.10.0-alpha.7/run b/packages/python/3.10.0-alpha.7/run new file mode 100644 index 0000000..ff60df2 --- /dev/null +++ b/packages/python/3.10.0-alpha.7/run @@ -0,0 +1,3 @@ +#!/bin/bash + +python3.10 "$@" \ No newline at end of file diff --git a/packages/python/3.10.0-alpha.7/test.py b/packages/python/3.10.0-alpha.7/test.py new file mode 100644 index 0000000..c3135e2 --- /dev/null +++ b/packages/python/3.10.0-alpha.7/test.py @@ -0,0 +1,7 @@ +working = True + +match working: + case True: + print("OK") + case False: + print() \ No newline at end of file diff --git a/packages/python/3.9.4/build.sh b/packages/python/3.9.4/build.sh new file mode 100755 index 0000000..f9ab88c --- /dev/null +++ b/packages/python/3.9.4/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +PREFIX=$(realpath $(dirname $0)) + +mkdir -p build + +cd build + +curl "https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tgz" -o python.tar.gz +tar xzf python.tar.gz --strip-components=1 +rm python.tar.gz + +./configure --prefix "$PREFIX" --with-ensurepip=install +make -j$(nproc) +make install -j$(nproc) + +cd .. + +rm -rf build + +bin/pip3 install numpy scipy pandas pycrypto whoosh bcrypt passlib diff --git a/packages/python/3.9.4/environment b/packages/python/3.9.4/environment new file mode 100644 index 0000000..bd0ff98 --- /dev/null +++ b/packages/python/3.9.4/environment @@ -0,0 +1 @@ +export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/python/3.9.4/metadata.json b/packages/python/3.9.4/metadata.json new file mode 100644 index 0000000..b49acc9 --- /dev/null +++ b/packages/python/3.9.4/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "python", + "version": "3.9.4", + "aliases": ["py", "python3"] +} diff --git a/packages/python/3.9.4/run b/packages/python/3.9.4/run new file mode 100644 index 0000000..450bb76 --- /dev/null +++ b/packages/python/3.9.4/run @@ -0,0 +1,3 @@ +#!/bin/bash + +python3.9 "$@" \ No newline at end of file diff --git a/packages/python/3.9.4/test.py b/packages/python/3.9.4/test.py new file mode 100644 index 0000000..f8bcd5c --- /dev/null +++ b/packages/python/3.9.4/test.py @@ -0,0 +1,18 @@ +execute = (execute_with := lambda *a, **k: lambda f: f(*a, **k))() + + +@int +@execute +class n: __int__ = lambda _: 69 + + +@execute +class cout: __lshift__ = print + + +@execute_with(n) +def output(n): + return "OK" + + +cout << output