Skip to content

Commit

Permalink
NXDRIVE-1224: Upgrade Python from 3.6.8 to 3.7.3
Browse files Browse the repository at this point in the history
* Add requests requirement to bypass a bug with old version and urllib3 >= 1.25;
  (see https://github.com/kennethreitz/requests/issues/5067)
* Use a development branch of PyInstaller to bypass a vevn bug;
  (see pyinstaller/pyinstaller#3942)
* Remove pip 18 requirement, there is no more issue here.

I needed to fix fix_app_qt_folder_names_for_codesign.py as it was yielding
files and folders in a random manner and was trying to fix non-DLL files.
  • Loading branch information
Mickaël Schoentgen committed Jun 17, 2019
1 parent 807422a commit 2f6f526
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 11 deletions.
4 changes: 3 additions & 1 deletion docs/changes/4.1.4.md
Expand Up @@ -33,7 +33,7 @@ Release date: `2019-xx-xx`

## Packaging / Build

- [NXDRIVE-](https://jira.nuxeo.com/browse/NXDRIVE-): ...
- [NXDRIVE-1224](https://jira.nuxeo.com/browse/NXDRIVE-1224): Upgrade from Python 3.6.8 to 3.7.3

## Tests

Expand All @@ -46,6 +46,8 @@ Release date: `2019-xx-xx`
## Minor Changes

- Packaging: Added `junitparser` 1.3.2
- Packaging: Added `requests` 2.2.0
- Packaging: Removed `dataclasses` 0.6
- Packaging: Updated `markdown` from 3.1 to 3.1.1
- Packaging: Updated `nuxeo` from 2.0.5 to 2.1.1
- Packaging: Updated `pre-commit` from 1.16.1 to 1.17.0
Expand Down
5 changes: 4 additions & 1 deletion docs/support.md
Expand Up @@ -60,10 +60,13 @@ If you want to use the module version as a basic module for your own software, p

It may evolve quickly without notification as we are following the Python development cycle.

As of now, we are using the __Python 3.6.8__.
[//]: # (XXX_PYTHON)

As of now, we are using the __Python 3.7.3__.

History:

- `2019-06-17` (v4.1.4): dropped support for Python 3.6
- `2018-10-30` (v4.0.0): dropped support for Python 2.7
- `2014-??-??`: dropped support for Python 2.6

Expand Down
4 changes: 3 additions & 1 deletion requirements-dev.txt
@@ -1,2 +1,4 @@
# nuitka==0.6.3; sys_platform == 'win32'
pyinstaller==3.4.0
# pyinstaller==3.5.0 or newer
# https://github.com/pyinstaller/pyinstaller/issues/3942
https://github.com/pyinstaller/pyinstaller/archive/9e1f05ba22ee797b6914d85ac11fe9dc425ad649.zip
3 changes: 2 additions & 1 deletion requirements.txt
@@ -1,5 +1,4 @@
appdirs==1.4.3
dataclasses==0.6
distro==1.4.0; sys_platform == 'linux'
https://github.com/GoodRx/universal-analytics-python/archive/77ce628c56de1ba51a9bf0774794fd687f785803.zip
https://github.com/gorakhargosh/watchdog/archive/8b94506c3156a3b66faef7aac9a139f603772506.zip
Expand All @@ -16,8 +15,10 @@ pypac==0.12.0
pypiwin32==223; sys_platform == 'win32'
# Ignore PyQt5 updates until NXDRIVE-1391 is done
PyQt5==5.11.2 # pyup: ignore
# NXDRIVE-1560: issue with codesign on macOS and sip > 4.19.13
PyQt5-sip==4.19.13
python-dateutil==2.8.0
requests==2.22.0
rfc3987==1.3.8
Send2Trash==1.5.0
sentry-sdk==0.9.0
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Expand Up @@ -18,7 +18,7 @@
def _basename(path: str) -> str:
"""
Patch shutil._basename for pathlib compatibility.
TODO: remove when https://bugs.python.org/issue32689 is fixed (Python 3.7.3 or newer)
TODO: remove when https://bugs.python.org/issue32689 is fixed (Python 3.7.4 or newer)
"""
if isinstance(path, os.PathLike):
return path.name
Expand Down
10 changes: 9 additions & 1 deletion tools/osx/fix_app_qt_folder_names_for_codesign.py
Expand Up @@ -85,8 +85,16 @@ def move_contents_to_resources(folder: Path) -> Generator[Path, None, None]:
yield from move_contents_to_resources(path)
else:
sibbling = Path(str(path).replace("MacOS", "Resources"))

# Create the parent if it does not exist yet
sibbling.parent.mkdir(parents=True, exist_ok=True)

# Make the move
shutil.move(path, sibbling)
yield sibbling

# Yield the DLL if it is one
if sibbling.name.endswith(".dylib"):
yield sibbling


def main(args: List[str]) -> int:
Expand Down
6 changes: 2 additions & 4 deletions tools/posix/deploy_jenkins_slave.sh
Expand Up @@ -87,7 +87,7 @@ check_import() {
check_vars() {
# Check required variables
if [ "${PYTHON_DRIVE_VERSION:=unset}" = "unset" ]; then
export PYTHON_DRIVE_VERSION="3.6.8" # XXX_PYTHON
export PYTHON_DRIVE_VERSION="3.7.3" # XXX_PYTHON
fi
if [ "${WORKSPACE:=unset}" = "unset" ]; then
echo "WORKSPACE not defined. Aborting."
Expand Down Expand Up @@ -131,9 +131,7 @@ check_vars() {
install_deps() {
echo ">>> Installing requirements"
# Do not delete, it fixes "Could not import setuptools which is required to install from a source distribution."
${PIP} setuptools
# NXDRIVE-1521: pip 19.0.1 prevents PyInstaller installation
${PIP} pip==18.1
${PIP} setuptools pip
${PIP} -r requirements.txt
${PIP} -r requirements-dev.txt
if [ "${INSTALL_RELEASE_ARG:=0}" != "1" ]; then
Expand Down
2 changes: 1 addition & 1 deletion tools/windows/deploy_jenkins_slave.ps1
Expand Up @@ -173,7 +173,7 @@ function check_import($import) {
function check_vars {
# Check required variables
if (-Not ($Env:PYTHON_DRIVE_VERSION)) {
$Env:PYTHON_DRIVE_VERSION = '3.6.8' # XXX_PYTHON
$Env:PYTHON_DRIVE_VERSION = '3.7.3' # XXX_PYTHON
} elseif (-Not ($Env:WORKSPACE)) {
Write-Output ">>> WORKSPACE not defined. Aborting."
ExitWithCode 1
Expand Down

0 comments on commit 2f6f526

Please sign in to comment.