Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python3.9 support #2318

Merged
merged 58 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
787f9c5
Update linux_optional_compilation_dependencies.sh
DavidMansolino Oct 12, 2020
063f940
Update Makefile
DavidMansolino Oct 12, 2020
dd7a16b
Update files_core.txt
DavidMansolino Oct 12, 2020
a42eb4d
Update tests_sources.yml
DavidMansolino Oct 12, 2020
7f2bb7c
Update tests_doc.yml
DavidMansolino Oct 12, 2020
5710bb5
Update test_suite_linux.yml
DavidMansolino Oct 12, 2020
4e479e4
gitignore.
DavidMansolino Oct 12, 2020
ed07634
Other libraries.
DavidMansolino Oct 12, 2020
d38d701
mac
DavidMansolino Oct 12, 2020
b7e31cb
Changelog.
DavidMansolino Oct 12, 2020
eabdb79
Test appveyor.
DavidMansolino Oct 12, 2020
a579b22
Other tests.
DavidMansolino Oct 12, 2020
f2d4f70
gitignore.
DavidMansolino Oct 12, 2020
0750d19
Windows.
DavidMansolino Oct 12, 2020
3c1fdea
Missing gitignore.
DavidMansolino Oct 12, 2020
0db7fc4
Removed not working test.
DavidMansolino Oct 12, 2020
95b33d5
debug macos
DavidMansolino Oct 12, 2020
64d3ce5
Remove temporary test.
DavidMansolino Oct 12, 2020
5b683d7
Update test_suite_mac.yml
DavidMansolino Oct 12, 2020
4045d18
Update test_suite_mac.yml
DavidMansolino Oct 12, 2020
395167e
Update test_suite_mac.yml
DavidMansolino Oct 12, 2020
d958380
Update test_suite_mac.yml
DavidMansolino Oct 12, 2020
1178be6
Update test_suite_mac.yml
DavidMansolino Oct 12, 2020
fcf590e
Update test_suite_mac.yml
DavidMansolino Oct 12, 2020
c6a851e
Update test_suite_mac.yml
DavidMansolino Oct 12, 2020
9b3879f
Update test_suite_mac.yml
DavidMansolino Oct 13, 2020
093cc1c
Update test_suite_mac.yml
DavidMansolino Oct 13, 2020
19a786b
Update test_suite_mac.yml
DavidMansolino Oct 13, 2020
6d5ee61
Update test_suite_mac.yml
DavidMansolino Oct 13, 2020
8ec8513
Update test_suite_mac.yml
DavidMansolino Oct 13, 2020
95cc9d1
Update test_suite_mac.yml
DavidMansolino Oct 13, 2020
1a2a290
Update .travis.yml
DavidMansolino Oct 13, 2020
94ee5c5
Update .travis.yml
DavidMansolino Oct 13, 2020
76f229d
Update test_suite_mac.yml
DavidMansolino Oct 13, 2020
5d2eeeb
Update test_suite_mac.yml
DavidMansolino Oct 13, 2020
bef121f
Update test_suite_mac.yml
DavidMansolino Oct 13, 2020
324bd56
Update .travis.yml
DavidMansolino Oct 13, 2020
11a4d51
Update .travis.yml
DavidMansolino Oct 13, 2020
33d3a9c
Update test_suite_mac.yml
DavidMansolino Oct 14, 2020
51fc0ed
Update test_suite_mac.yml
DavidMansolino Oct 14, 2020
01b9e96
Update test_suite_mac.yml
DavidMansolino Oct 14, 2020
092c484
Update Makefile
DavidMansolino Oct 14, 2020
109d5df
Merge branch 'master' into Add-python3.9
DavidMansolino Oct 15, 2020
bba0963
Cleaner makefile
DavidMansolino Oct 15, 2020
a3be956
Extend to other makefiles.
DavidMansolino Oct 15, 2020
364f121
Update test_suite_mac.yml
DavidMansolino Oct 15, 2020
4ea64ea
Update test_suite_mac.yml
DavidMansolino Oct 15, 2020
1c6861b
Update test_suite_mac.yml
DavidMansolino Oct 15, 2020
8640a84
Update test_suite_mac.yml
DavidMansolino Oct 15, 2020
6c29a3d
Update test_suite_mac.yml
DavidMansolino Oct 15, 2020
6cacb11
Update test_suite_mac.yml
DavidMansolino Oct 15, 2020
6353c4f
Update test_suite_mac.yml
DavidMansolino Oct 15, 2020
476d6d6
Update test_suite_mac.yml
DavidMansolino Oct 15, 2020
3f86ea1
Update test_suite_mac.yml
DavidMansolino Oct 15, 2020
617d59a
Update test_suite_mac.yml
DavidMansolino Oct 15, 2020
dd0b66d
Docs.
DavidMansolino Oct 15, 2020
c7fc221
Update .appveyor-build.yml
DavidMansolino Oct 15, 2020
fa213d0
Update .appveyor-build-tag.yml
DavidMansolino Oct 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .appveyor-build-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ init:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

install:
- set PATH=C:\Python38-x64;C:\Python38-x64\Scripts;C:\msys64\usr\bin;%PATH%
# temporary workaround to install Python 3.9
- bash -lc "curl -O https://www.python.org/ftp/python/3.9.0/python-3.9.0-amd64.exe"
- cmd /c start /wait python-3.9.0-amd64.exe /quiet TargetDir="C:\Python39-x64" Shortcuts=0 Include_launcher=1 InstallLauncherAllUsers=1 Include_debug=1
# end of workaround
- set PATH=C:\Python39-x64;C:\Python39-x64\Scripts;C:\msys64\usr\bin;%PATH%
- bash -lc "curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz"
- bash -lc "curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig"
- bash -lc "pacman-key --verify msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig"
Expand Down
6 changes: 5 additions & 1 deletion .appveyor-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ init:
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

install:
- set PATH=C:\Python38-x64;C:\Python38-x64\Scripts;C:\msys64\usr\bin;%PATH%
# temporary workaround to install Python 3.9
- bash -lc "curl -O https://www.python.org/ftp/python/3.9.0/python-3.9.0-amd64.exe"
- cmd /c start /wait python-3.9.0-amd64.exe /quiet TargetDir="C:\Python39-x64" Shortcuts=0 Include_launcher=1 InstallLauncherAllUsers=1 Include_debug=1
# end of workaround
- set PATH=C:\Python39-x64;C:\Python39-x64\Scripts;C:\msys64\usr\bin;%PATH%
- bash -lc "curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz"
- bash -lc "curl -O http://repo.msys2.org/msys/x86_64/msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig"
- bash -lc "pacman-key --verify msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig msys2-keyring-r21.b39fb11-1-any.pkg.tar.xz.sig"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_suite_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ jobs:
run: tar xjf artifact/webots-*-x86-64.tar.bz2 -C artifact
- name: Install Webots Dependencies
run: sudo scripts/install/linux_runtime_dependencies.sh
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Test Suite
run: |
export LIBGL_ALWAYS_SOFTWARE=true
Expand All @@ -103,10 +103,10 @@ jobs:
run: tar xjf artifact/webots-*-x86-64.tar.bz2 -C artifact
- name: Install Webots Dependencies
run: sudo scripts/install/linux_runtime_dependencies.sh
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Update World
run: |
export LIBGL_ALWAYS_SOFTWARE=true
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/test_suite_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ jobs:
submodules: true
- name: Install Webots Compilation Dependencies
run: |
brew install cmake swig wget python@3.7
brew update # required to get the python@3.9 formula
brew install swig wget python@3.7 python@3.9 # skip 'cmake' and 'python@3.8' because already installed
npm install -g appdmg
# install regular Python 3.7
sudo mkdir -p /Library/Frameworks/Python.framework/Versions/3.7
Expand All @@ -39,13 +40,17 @@ jobs:
sudo mkdir -p /Library/Frameworks/Python.framework/Versions/3.8
wget -qq https://cyberbotics.com/files/repository/dependencies/mac/release/python3.8.zip -P dependencies
sudo unzip -o -q dependencies/python3.8.zip -d /Library/Frameworks/Python.framework/Versions/3.8
# install regular Python 3.9
sudo mkdir -p /Library/Frameworks/Python.framework/Versions/3.9
wget -qq https://cyberbotics.com/files/repository/dependencies/mac/release/python3.9.zip -P dependencies
sudo unzip -o -q dependencies/python3.9.zip -d /Library/Frameworks/Python.framework/Versions/3.9
- name: Set Commit SHA in Version
if: ${{ github.event_name == 'schedule' }}
run: python scripts/packaging/set_commit_and_date_in_version.py ${{ github.sha }}
- name: Webots Package Creation
run: |
export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
export PATH=/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin/:$PATH
export PATH=/Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin/:$PATH
make distrib -j4
- uses: actions/upload-artifact@v2
with:
Expand All @@ -71,10 +76,10 @@ jobs:
hdiutil mount artifact/webots-*.dmg
sudo cp -R /Volumes/Webots/Webots.app /Applications
hdiutil unmount /Volumes/Webots
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Test
run:
export WEBOTS_DISABLE_SAVE_SCREEN_PERSPECTIVE_ON_CLOSE=true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.9
- name: Tests
run: |
pip install -r docs/tests/requirements.txt
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04, macos-10.15]
python: [2.7, 3.8]
python: [2.7, 3.9]
include:
- os: ubuntu-16.04
DEPENDENCIES_INSTALLATION: "sudo apt -y install clang-format-9"
Expand All @@ -35,14 +35,14 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
if: (matrix.os == 'ubuntu-18.04' && matrix.python == '3.8') || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
if: (matrix.os == 'ubuntu-18.04' && matrix.python == '3.9') || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
- name: Set up Python ${{ matrix.python }}
if: (matrix.os == 'ubuntu-18.04' && matrix.python == '3.8') || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
if: (matrix.os == 'ubuntu-18.04' && matrix.python == '3.9') || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Tests
if: (matrix.os == 'ubuntu-18.04' && matrix.python == '3.8') || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
if: (matrix.os == 'ubuntu-18.04' && matrix.python == '3.9') || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
run: |
${{ matrix.DEPENDENCIES_INSTALLATION }}
cp dependencies/.clang-format-9 .clang-format
Expand Down
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ jobs:
- node
before_install: &mac_before_install
- brew update
- brew install python@3.7
- brew install python@3.7 python@3.9
- export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
- npm install -g appdmg
- pip install PyGithub # used to upload packages to Github releases
Expand All @@ -234,6 +234,9 @@ jobs:
- sudo mkdir -p /Library/Frameworks/Python.framework/Versions/3.8 # we can't use python3.8 from homebrew for the compilation because it is not compatible with the normal one
- if [[ ! -f $WEBOTS_HOME/dependencies/python3.8.zip ]]; then wget -qq https://cyberbotics.com/files/repository/dependencies/mac/release/python3.8.zip -P $WEBOTS_HOME/dependencies; fi
- sudo unzip -o -q $WEBOTS_HOME/dependencies/python3.8.zip -d /Library/Frameworks/Python.framework/Versions/3.8
- sudo mkdir -p /Library/Frameworks/Python.framework/Versions/3.9 # we can't use python3.9 from homebrew for the compilation because it is not compatible with the normal one
- if [[ ! -f $WEBOTS_HOME/dependencies/python3.9.zip ]]; then wget -qq https://cyberbotics.com/files/repository/dependencies/mac/release/python3.9.zip -P $WEBOTS_HOME/dependencies; fi
- sudo unzip -o -q $WEBOTS_HOME/dependencies/python3.9.zip -d /Library/Frameworks/Python.framework/Versions/3.9
script:
- if [[ -z "${TRAVIS_TAG}" ]]; then python scripts/packaging/set_commit_and_date_in_version.py $TRAVIS_COMMIT; fi
- make distrib -j2
Expand Down
10 changes: 5 additions & 5 deletions docs/guide/using-python.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The Python API is currently composed of a set of about 25 classes having about 2
The classes are either representations of a node of the scene tree (such as Robot, LED, etc.) or utility classes (such as Motion, ImageRef, etc.).
A complete description of these functions can be found in the reference guide while the instructions about the common way to program a Python controller can be found in [this chapter](programming-fundamentals.md).

The Python API of Webots supports Python versions 2.7, 3.7 and 3.8.
The Python API of Webots supports Python versions 2.7, 3.7, 3.8 and 3.9.
Please note that Python 2.7 is deprecated since January 1st, 2020 and should be avoided.
On Ubuntu it also supports Python versions 3.5 and 3.6.

Expand Down Expand Up @@ -40,15 +40,15 @@ To check the versions of Python installed on your system, you can type in a term
#### macOS Installation

Python 2.7 installed by default.
You can install Python 3.7 or 3.8 from the [Python web site](https://www.python.org) or using [Homebrew](https://brew.sh).
To check the versions of Python installed on your system, you can type in a terminal: `python --version`, `python3.8 --version`, `python2.7 --version`, `python3 --version`, etc.
You can install Python 3.7, 3.8 or 3.9 from the [Python web site](https://www.python.org) or using [Homebrew](https://brew.sh).
To check the versions of Python installed on your system, you can type in a terminal: `python --version`, `python3.9 --version`, `python2.7 --version`, `python3 --version`, etc.

> **Note**: To use Python 3.x on macOS, it is recommended to set the absolute path to the python3 executable (e.g. `/Library/Frameworks/Python.framework/Versions/3.x/bin/python3`) in the [`Python command` option of the Preferences](preferences.md#general).

#### Windows Installation

You should install the latest version of Python 3.7 (64 bit) or Python 2.7 (64 bit) from the official [Python website](https://www.python.org).
Then, you have to modify your `PATH` environment variable to add the path to the `python.exe` binary which is located in the main `Python37` or `Python27` installation folder.
You should install the latest version of Python 3.7 (64 bit), 3.8 (64 bit), 3.9 (64 bit) or 2.7 (64 bit) from the official [Python website](https://www.python.org).
Then, you have to modify your `PATH` environment variable to add the path to the `python.exe` binary which is located in the main installation folder.
To check this was done properly, you can open a DOS console (`CMD.EXE`) and type `python --version`.
If it displays the correct Python version, then, everything is setup properly and you should be able to run the Python example provided with Webots in the `WEBOTS_HOME/projects/languages/python/worlds/example.wbt` world file.

Expand Down
2 changes: 2 additions & 0 deletions docs/reference/changelog-r2020.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## Webots R2020b Revision 2
Released on XXX YYY, 2020.

- Enhancements
- Added support for Python 3.9 ([#2318](https://github.com/cyberbotics/webots/pull/2079)).
- Bug fixes
- Fixed recording of movies which was broken when the [WorldInfo](worldinfo.md).`basicTimeStep` was greater than 40 ([#2268](https://github.com/cyberbotics/webots/pull/2268)).
- Fixed handling of <kbd>Ctrl</kbd> key on macOS from the [Keyboard](keyboard.md) API ([#2265](https://github.com/cyberbotics/webots/pull/2265)).
Expand Down
2 changes: 2 additions & 0 deletions lib/controller/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
/python36
/python37
/python38
/python39
/python37_brew
/python38_brew
/python39_brew
/*.so.*
8 changes: 7 additions & 1 deletion projects/default/libraries/vehicle/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ endif
+PYTHON_COMMAND=python3.7 make -s -C python $(MAKECMDGOALS)
@echo "# make" $@ python3.8;
+PYTHON_COMMAND=python3.8 make -s -C python $(MAKECMDGOALS)
@echo "# make" $@ python3.9;
+PYTHON_COMMAND=python3.9 make -s -C python $(MAKECMDGOALS)
endif
ifeq ($(OSTYPE),windows)
@echo "# make" $@ python3.9;
+PATH="$(PYTHON39_HOME):$(PATH)" make -s -C python $(MAKECMDGOALS)
omichel marked this conversation as resolved.
Show resolved Hide resolved
@echo "# make" $@ python3.8;
+make -s -C python $(MAKECMDGOALS)
+PATH="$(PYTHON38_HOME):$(PATH)" make -s -C python $(MAKECMDGOALS)
@echo "# make" $@ python3.7;
+PATH="$(PYTHON37_HOME):$(PATH)" make -s -C python $(MAKECMDGOALS)
@echo "# make" $@ python2.7;
Expand All @@ -55,6 +59,8 @@ ifeq ($(OSTYPE),darwin)
+PYTHON_COMMAND=python3.7 make -s -C python $(MAKECMDGOALS)
@echo "# make" $@ python3.8;
+PYTHON_COMMAND=python3.8 make -s -C python $(MAKECMDGOALS)
@echo "# make" $@ python3.9;
+PYTHON_COMMAND=python3.9 make -s -C python $(MAKECMDGOALS)
endif


Expand Down
8 changes: 3 additions & 5 deletions projects/default/libraries/vehicle/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,12 @@ endif
ifeq ($(OSTYPE),darwin)
ifeq ($(PYTHON_SHORT_VERSION), 27)
PYTHON_PATH ?= /System/Library/Frameworks/Python.framework/Versions/$(PYTHON_VERSION)
PYTHON_PYMALLOC =
else
PYTHON_PATH ?= /Library/Frameworks/Python.framework/Versions/$(PYTHON_VERSION)
ifeq ($(PYTHON_SHORT_VERSION), 38)
PYTHON_PYMALLOC =
else
PYTHON_PYMALLOC = m
endif
SKIP_PYTHON_PYMALLOC := 27 38 39
ifeq ($(filter $(PYTHON_SHORT_VERSION),$(SKIP_PYTHON_PYMALLOC)),)
PYTHON_PYMALLOC = m
endif
BREW_PYTHON_PATH = /usr/local/Cellar/python/$(PYTHON_FULL_VERSION)/Frameworks/Python.framework/Versions/$(PYTHON_VERSION)
C_FLAGS = -c -Wall -fPIC -mmacosx-version-min=$(MACOSX_MIN_SDK_VERSION) -stdlib=libc++
Expand Down
9 changes: 8 additions & 1 deletion projects/robots/robotis/darwin-op/libraries/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,14 @@ endif
+PYTHON_COMMAND=python3.7 make -s -C python $(MAKECMDGOALS)
@echo "# make" $@ python3.8;
+PYTHON_COMMAND=python3.8 make -s -C python $(MAKECMDGOALS)
@echo "# make" $@ python3.9;
+PYTHON_COMMAND=python3.9 make -s -C python $(MAKECMDGOALS)
endif
ifeq ($(OSTYPE),windows)
@echo "# make" $@ python3.9;
+PATH="$(PYTHON39_HOME):$(PATH)" make -s -C python $(MAKECMDGOALS)
omichel marked this conversation as resolved.
Show resolved Hide resolved
@echo "# make" $@ python3.8;
+make -s -C python $(MAKECMDGOALS)
+PATH="$(PYTHON38_HOME):$(PATH)" make -s -C python $(MAKECMDGOALS)
@echo "# make" $@ python3.7;
+PATH="$(PYTHON37_HOME):$(PATH)" make -s -C python $(MAKECMDGOALS)
@echo "# make" $@ python2.7;
Expand All @@ -71,4 +75,7 @@ ifeq ($(OSTYPE),darwin)
@echo "# make" $@ python3.8;
+PYTHON_COMMAND=python3.8 make -s -C python $(MAKECMDGOALS)
+make -f Makefile.mac $(MAKECMDGOALS)
@echo "# make" $@ python3.9;
+PYTHON_COMMAND=python3.9 make -s -C python $(MAKECMDGOALS)
+make -f Makefile.mac $(MAKECMDGOALS)
endif
8 changes: 3 additions & 5 deletions projects/robots/robotis/darwin-op/libraries/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,12 @@ endif
ifeq ($(OSTYPE),darwin)
ifeq ($(PYTHON_SHORT_VERSION), 27)
PYTHON_PATH ?= /System/Library/Frameworks/Python.framework/Versions/$(PYTHON_VERSION)
PYTHON_PYMALLOC =
else
PYTHON_PATH ?= /Library/Frameworks/Python.framework/Versions/$(PYTHON_VERSION)
ifeq ($(PYTHON_SHORT_VERSION), 38)
PYTHON_PYMALLOC =
else
PYTHON_PYMALLOC = m
endif
SKIP_PYTHON_PYMALLOC := 27 38 39
ifeq ($(filter $(PYTHON_SHORT_VERSION),$(SKIP_PYTHON_PYMALLOC)),)
PYTHON_PYMALLOC = m
endif
BREW_PYTHON_PATH = /usr/local/Cellar/python/$(PYTHON_FULL_VERSION)/Frameworks/Python.framework/Versions/$(PYTHON_VERSION)
C_FLAGS = -c -Wall -fPIC -mmacosx-version-min=$(MACOSX_MIN_SDK_VERSION) -stdlib=libc++
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/managers.py
/_managers.pyd
10 changes: 9 additions & 1 deletion resources/languages/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ endif
+PYTHON_COMMAND=python3.7 make -s -C python $@
@echo "# make" $@ python3.8;
+PYTHON_COMMAND=python3.8 make -s -C python $@
@echo "# make" $@ python3.9;
+PYTHON_COMMAND=python3.9 make -s -C python $@
endif
ifeq ($(OSTYPE),windows)
@echo "# make" $@ python3.9;
+PATH="$(PYTHON39_HOME):$(PATH)" make -s -C python $@
omichel marked this conversation as resolved.
Show resolved Hide resolved
@echo "# make" $@ python3.8;
+make -s -C python $@
+PATH="$(PYTHON38_HOME):$(PATH)" make -s -C python $@
@echo "# make" $@ python3.7;
+PATH="$(PYTHON37_HOME):$(PATH)" make -s -C python $@
@echo "# make" $@ python2.7;
Expand All @@ -50,8 +54,12 @@ ifeq ($(OSTYPE),darwin)
+PYTHON_COMMAND=/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 make -s -C python $@
@echo "# make" $@ python3.8;
+PYTHON_COMMAND=/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 make -s -C python $@
@echo "# make" $@ python3.9;
+PYTHON_COMMAND=/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 make -s -C python $@
@echo "# make" $@ python3.7 brew;
+PYTHON_COMMAND=/usr/local/opt/python@3.7/bin/python3.7 SUFFIX=_brew make -s -C python $@
@echo "# make" $@ python3.8 brew;
+PYTHON_COMMAND=/usr/local/opt/python@3.8/bin/python3.8 SUFFIX=_brew make -s -C python $@
@echo "# make" $@ python3.9 brew;
+PYTHON_COMMAND=/usr/local/opt/python@3.9/bin/python3.9 SUFFIX=_brew make -s -C python $@
endif
9 changes: 2 additions & 7 deletions resources/languages/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,10 @@ endif

ifeq ($(OSTYPE),darwin)
PYTHON_PATH = $(shell $(PYTHON_COMMAND) -u -c "import sys; print(sys.exec_prefix)")
ifeq ($(PYTHON_SHORT_VERSION), 27)
PYTHON_PYMALLOC =
else
ifeq ($(PYTHON_SHORT_VERSION), 38)
PYTHON_PYMALLOC =
else
SKIP_PYTHON_PYMALLOC := 27 38 39
ifeq ($(filter $(PYTHON_SHORT_VERSION),$(SKIP_PYTHON_PYMALLOC)),)
PYTHON_PYMALLOC = m
endif
endif
PYTHON_BIN = $(PYTHON_PATH)/bin/
C_FLAGS = -c -Wall -fPIC -mmacosx-version-min=$(MACOSX_MIN_SDK_VERSION) -Wno-uninitialized
ifeq ($(findstring llvm-g++,$(shell ls -lF $(shell which c++ 2> /dev/null))),)
Expand Down
1 change: 1 addition & 0 deletions scripts/install/bash_profile.windows
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# export PYTHON27_HOME=/C/Python27 # Optionally defines the path to Python 2.7 home.
# export PYTHON37_HOME=/C/Program\ Files/Python37 # Optionally defines the path to Python 3.7 home.
# export PYTHON38_HOME=/C/Program\ Files/Python38 # Optionally defines the path to Python 3.8 home.
# export PYTHON39_HOME=/C/Program\ Files/Python39 # Optionally defines the path to Python 3.9 home.
# export MATLAB_HOME=/C/Program\ Files/MATLAB/R2018b # Optionally defines the path to MATLAB home.
# export VISUAL_STUDIO_PATH="/C/Program Files (x86)/Microsoft Visual Studio 10.0" # Optionally defines the path to Microsoft Visual Studio home.
# export INNO_SETUP_HOME="/C/Program Files (x86)/Inno Setup 6" # Optionally defines the path to Inno Setup home.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi
apt install --yes software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt update
apt install --yes lsb-release wget python3.5-dev python3.6-dev python3.7-dev python3.8-dev
apt install --yes lsb-release wget python3.5-dev python3.6-dev python3.7-dev python3.8-dev python3.9-dev

UBUNTU_VERSION=$(lsb_release -rs)
if [[ $UBUNTU_VERSION == "16.04" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/install/msys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ cd ~
else
WINDOWS_DRIVE=${1:1:1}:\\${1:3}
export WEBOTS_HOME=${WINDOWS_DRIVE////\\}
export PATH="$PYTHON38_HOME:$PYTHON38_HOME/Scripts:$1/msys64/mingw64/bin":/mingw64/bin:/usr/bin:$JAVA_HOME/bin:/c/WINDOWS/system32:/c/WINDOWS:$MATLAB_HOME/bin:$1/bin/node
export PATH="$PYTHON39_HOME:$PYTHON39_HOME/Scripts:$1/msys64/mingw64/bin":/mingw64/bin:/usr/bin:$JAVA_HOME/bin:/c/WINDOWS/system32:/c/WINDOWS:$MATLAB_HOME/bin:$1/bin/node
cd "$1"
fi
9 changes: 9 additions & 0 deletions scripts/packaging/files_core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ lib/controller/python38_brew/ [mac]
lib/controller/python38_brew/*.py [mac]
lib/controller/python38_brew/_*.so [mac]

lib/controller/python39/
lib/controller/python39/*.py
lib/controller/python39/_*.so [linux,mac]
lib/controller/python39/_*.pyd [windows]

lib/controller/python39_brew/ [mac]
lib/controller/python39_brew/*.py [mac]
lib/controller/python39_brew/_*.so [mac]

lib/controller/matlab/
lib/controller/matlab/allincludes.h
lib/controller/matlab/*.m
Expand Down