Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit 17ea043

Browse files
authored
Add Python 3.11 (#228)
1 parent ff2bf40 commit 17ea043

File tree

57 files changed

+633
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+633
-32
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ deploy:
3232
all_branches: true
3333
repo: ibm-functions/runtime-python
3434
- provider: script
35-
script: "./tools/travis/publish.sh ibmfunctions 3.7 master && ./tools/travis/publish.sh ibmfunctions 3.9 master"
35+
script: "./tools/travis/publish.sh ibmfunctions 3.7 master && ./tools/travis/publish.sh ibmfunctions 3.9 master && ./tools/travis/publish.sh ibmfunctions 3.11 master"
3636
on:
3737
branch: master
3838
repo: ibm-functions/runtime-python

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2017 IBM Corp.
1+
Copyright 2023 IBM Corp.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# IBM Cloud Functions Runtime for Python
22
[![Build Status](https://travis-ci.com/ibm-functions/runtime-python.svg?branch=master)](https://travis-ci.com/ibm-functions/runtime-python)
33

4+
- The runtime provides [python v3.11](python3.11/) with a set of [python packages](python3.11/requirements.txt), see [python3.11/CHANGELOG.md](python3.11/CHANGELOG.md)
45
- The runtime provides [python v3.9](python3.9/) with a set of [python packages](python3.9/requirements.txt), see [python3.9/CHANGELOG.md](python3.9/CHANGELOG.md)
56
- The runtime provides [python v3.7](python3.7/) with a set of [python packages](python3.7/requirements.txt), see [python3.7/CHANGELOG.md](python3.7/CHANGELOG.md)
67
- The runtime provides [python v3.6](python3.6/) with a set of [python packages](python3.6/requirements.txt), see [python3.6/CHANGELOG.md](python3.6/CHANGELOG.md)

ansible/environments/local/group_vars/all

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,10 @@ runtimes_manifest:
4545
image:
4646
name: "action-python-v3.9"
4747
deprecated: false
48+
- kind: "python:3.11"
49+
default: false
50+
image:
51+
name: "action-python-v3.11"
52+
deprecated: false
4853
blackboxes:
4954
- name: "dockerskeleton"

python3.11/CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# IBM Functions Python 3.11 Runtime Container
2+
3+
## Migrating from Python:3.9 to Python:3.11
4+
- Replaced `cloudant` with `ibmcloudant`
5+
- The `cloudant` sdk has moved to the new `ibmcloudant` sdk. It includes a number of breaking changes. See [migration guide](https://github.com/cloudant/python-cloudant/blob/master/MIGRATION.md) for more information.
6+
- [pypi cloudant](https://pypi.org/project/cloudant/)
7+
- Replaced `watson-developer-cloud` with `ibm-watson`
8+
- The `watson-developer-cloud` sdk has renamed to the new `ibm-watson` sdk and includes breaking changes.
9+
- [pypi ibm-watson](https://pypi.org/project/ibm-watson/)
10+
- [github ibm-watson](https://github.com/watson-developer-cloud/python-sdk)
11+
12+
## 1.0.0
13+
Changes:
14+
- update all packages to their lates versions
15+
16+
Python version:
17+
- [3.9.9](https://www.python.org/downloads/release/python-399/)
18+
19+
Python packages:
20+
- The file [requirements.txt](requirements.txt) lists the packages we guarantee to be included in this runtime.<br/>
21+
Ensure that you only use packages mentioned there.<br/>
22+
Other python packages might be part of this runtime, but only due to indirect dependencies of the above listed packages. These indirectly included packages are candidates to be removed at any time in case they are not required by the referring package anymore.

python3.11/Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM openwhisk/action-python-v3.11:4707653
2+
3+
COPY requirements.txt requirements.txt
4+
5+
RUN apt-get update \
6+
# Upgrade installed packages to get latest security fixes if the base image does not contain them already.
7+
&& apt-get upgrade -y --no-install-recommends \
8+
# cleanup package lists, they are not used anymore in this image
9+
&& rm -rf /var/lib/apt/lists/* \
10+
# We do not have mysql-server installed but mysql-common contains config files (/etc/mysql/my.cnf) for it.
11+
# We need to add some dummy entries to /etc/mysql/my.cnf to sattisfy vulnerability checking of it.
12+
&& echo "\n[mysqld]\nssl-ca=/tmp/ca.pem\nssl-cert=/tmp/server-cert.pem\nssl-key=/tmp/server-key.pem\n" >> /etc/mysql/my.cnf \
13+
# install additional python modules
14+
# we pin setuptools==57.5.0, reason is that ibm_db<=3.0.4 requires 'use_2to3' during install which has been
15+
# removed from setuptools starting with the 58.x.x release. The install therefore fails with:
16+
# error in ibm_db setup command: use_2to3 is invalid.
17+
# When ibm_db is upgraded to a version that does not need 'use_2to3' anymore the pin can also be removed.
18+
&& pip install --upgrade pip \
19+
&& pip install --no-cache-dir -r requirements.txt \
20+
# Show actual python version in the build output.
21+
&& echo "Actual python version is:" \
22+
&& python --version \
23+
# Show actual /bin/proxy version in the build output, makes it easier to check if go security fixes need to be applied.
24+
&& echo "Actual /bin/proxy version is:" \
25+
&& /bin/proxy -version

python3.11/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ext.dockerImageName = 'action-python-v3.11'
2+
apply from: '../gradle/docker.gradle'
3+
4+
// To always get the latest vulnerability updates into the image, use --no-cache for building the image.
5+
// This is not needed for travis builds (the VM is always new), but for local development.
6+
dockerBuildArg = ['build','--no-cache']

python3.11/requirements.txt

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This requirements.txt file contains the list of packages included in the Python 3.9 runtime.
2+
#
3+
# These packages are guaranteed to be included. Ensure that your action code only uses the listed ones.
4+
# Other Python packages might be part of the runtime, but only due to indirect dependencies of
5+
# the listed packages. These indirectly included packages are candidates to be removed
6+
# at any time in case they are not required by the referring package anymore.
7+
8+
9+
# Setup modules
10+
gevent == 22.10.2
11+
flask == 2.2.3
12+
13+
# default available packages for python3action
14+
beautifulsoup4 == 4.11.2
15+
httplib2 == 0.21.0
16+
kafka_python == 2.0.2
17+
lxml == 4.9.2
18+
python-dateutil == 2.8.2
19+
requests == 2.28.2
20+
scrapy == 2.8.0
21+
simplejson == 3.18.3
22+
virtualenv == 20.20.0
23+
twisted == 22.10.0
24+
PyJWT == 2.6.0
25+
26+
# packages for numerics
27+
numpy == 1.24.2
28+
scikit-learn == 1.2.1
29+
scipy == 1.10.1
30+
pandas == 1.5.3
31+
32+
# packages for image processing
33+
Pillow == 9.4.0
34+
35+
# IBM specific python modules
36+
ibm_db == 3.1.4
37+
ibmcloudant == 0.3.3
38+
ibm-watson == 6.1.0
39+
ibm-cos-sdk == 2.12.2
40+
ibmcloudsql == 0.5.13
41+
42+
# Compose Libs
43+
psycopg2 == 2.9.5
44+
pymongo == 4.3.3
45+
redis == 4.5.1
46+
pika == 1.3.1
47+
elasticsearch == 8.6.2
48+
cassandra-driver == 3.25.0
49+
etcd3 == 0.12.0
50+
51+
# Other required modules
52+
botocore == 1.29.86
53+
tornado == 6.2
54+
55+
# required for etcd3 to work correctly can be removed at any time do not use in your own actions
56+
protobuf==3.20.1

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ include 'tests'
22

33
include 'python3.7'
44
include 'python3.9'
5+
include 'python3.11'
56

67
rootProject.name = 'runtime-python-ibm'
78

tests/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ tasks.withType(Test) {
2020
// The default python:3.6 is deprecated (it reached end of support).
2121
include '**/*IBMPython37*'
2222
include '**/*IBMPython39*'
23+
include '**/*IBMPython311*'
2324
}
2425

2526
task testWithoutCredentials(type: Test) {

0 commit comments

Comments
 (0)