From 133216956d3a6a1c05e6453f1878c3c966883f0a Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Mon, 13 Nov 2017 11:17:29 +0100 Subject: [PATCH 01/12] started new dev cycle --- CHANGES.rst | 5 +++++ setup.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 789d4c3c..56facf4a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,11 @@ Changes ======= +0.0.6 (2017-XX-XX) +------------------ + +* ... + 0.0.5 (2017-11-13) ------------------ diff --git a/setup.py b/setup.py index 3e0bbc3b..cb309789 100644 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ # Bump version HERE! -_version_ = '0.0.5' +_version_ = '0.0.6' # List all versions of Python which are supported From f5f67b9956b13e994f8bffac50b7c6d7e7daab8b Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Mon, 13 Nov 2017 17:37:23 +0100 Subject: [PATCH 02/12] removed import --- src/zugbruecke/_wrapper_.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/zugbruecke/_wrapper_.py b/src/zugbruecke/_wrapper_.py index ed6e024e..c3c45f90 100644 --- a/src/zugbruecke/_wrapper_.py +++ b/src/zugbruecke/_wrapper_.py @@ -44,7 +44,6 @@ # IMPORT: Unix ctypes members, which will be modified # +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -from ctypes import cdll as ctypes_cdll_obj from ctypes import CDLL as ctypes_CDLL_class from ctypes import CFUNCTYPE as __CFUNCTYPE__ From 6012a69377f43cd9fc815ef09e8b53fd5e9d986c Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Mon, 13 Nov 2017 17:52:30 +0100 Subject: [PATCH 03/12] removed pickle from rpc --- src/zugbruecke/core/rpc.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/zugbruecke/core/rpc.py b/src/zugbruecke/core/rpc.py index ede8f693..23cec637 100644 --- a/src/zugbruecke/core/rpc.py +++ b/src/zugbruecke/core/rpc.py @@ -35,7 +35,6 @@ Client, Listener ) -import pickle from threading import Thread import traceback @@ -59,9 +58,9 @@ def __getattr__(self, name): def do_rpc(*args, **kwargs): # Send request to server - self.client.send(pickle.dumps((name, args, kwargs))) + self.client.send((name, args, kwargs)) # Receive answer - result = pickle.loads(self.client.recv()) + result = self.client.recv() # If the answer is an error, raise it if isinstance(result, Exception): @@ -101,14 +100,14 @@ def handle_connection(self, connection_client): while True: # Receive the incomming message - function_name, args, kwargs = pickle.loads(connection_client.recv()) + function_name, args, kwargs = connection_client.recv() # Run the RPC and send a response try: r = self.__functions__[function_name](*args,**kwargs) - connection_client.send(pickle.dumps(r)) + connection_client.send(r) except Exception as e: - connection_client.send(pickle.dumps(e)) + connection_client.send(e) except EOFError: From 07a81a0a2630752215d16117134bcf5ff4cf1b9f Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Mon, 13 Nov 2017 17:53:35 +0100 Subject: [PATCH 04/12] added pickle removal to changelog --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 56facf4a..346f6a11 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ Changes 0.0.6 (2017-XX-XX) ------------------ -* ... +* RPC speedup due to removal of extra pickling step 0.0.5 (2017-11-13) ------------------ From aa784c64d4e6342b317cbedb047586e777f88cdb Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Wed, 6 Dec 2017 06:59:11 +0100 Subject: [PATCH 05/12] moved dev requirements into setup.py --- makefile | 6 ++---- requirements.txt | 8 ++------ setup.py | 10 +++++++++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/makefile b/makefile index 7e9445d0..e916583e 100644 --- a/makefile +++ b/makefile @@ -45,13 +45,11 @@ upload_test: done install: - pip install -r requirements.txt - pip install . + pip install --process-dependency-links .[dev] wine-pytest --version install_link: - pip install -r requirements.txt - pip install -e . + pip install --process-dependency-links -e .[dev] wine-pytest --version test: diff --git a/requirements.txt b/requirements.txt index 0d3829d4..3f0f488f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,2 @@ -setuptools -wheel -pytest -Sphinx -sphinx_rtd_theme -twine +--index-url https://pypi.python.org/simple/ +--process-dependency-links -e .[dev] diff --git a/setup.py b/setup.py index cb309789..a560bfd2 100644 --- a/setup.py +++ b/setup.py @@ -82,8 +82,16 @@ scripts = glob(os.path.join('scripts', '*')), include_package_data = True, install_requires = [], + extras_require = {'dev': [ + 'pytest', + 'python-language-server', + 'setuptools', + 'Sphinx', + 'sphinx_rtd_theme', + 'twine', + 'wheel' + ]}, zip_safe = False, - extras_require = {}, entry_points = {}, classifiers = [ 'Development Status :: 3 - Alpha', From 2e4b6b2d403e35af4fa352244d32ff7c70ef2664 Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Wed, 6 Dec 2017 07:04:39 +0100 Subject: [PATCH 06/12] wine python setup cleanup --- src/zugbruecke/core/wineenv.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/zugbruecke/core/wineenv.py b/src/zugbruecke/core/wineenv.py index 03c472de..f35220d9 100644 --- a/src/zugbruecke/core/wineenv.py +++ b/src/zugbruecke/core/wineenv.py @@ -92,20 +92,17 @@ def setup_wine_python(arch, version, directory, overwrite = False): # Target directory target_directory = os.path.join(directory, pydir) - # Target location of python.exe - python_exe_path = os.path.join(target_directory, 'python.exe') - # Is there a pre-existing Python installation with identical parameters? - preexisting = os.path.isfile(python_exe_path) + preexisting = os.path.isfile(os.path.join(target_directory, 'python.exe')) # Is there a preexisting installation and should it be overwritten? if preexisting and overwrite: - # Delete folder - shutil.rmtree(python_exe_path) + shutil.rmtree(target_directory) # Make sure the target directory exists if not os.path.exists(directory): + # Create folder os.makedirs(directory) # Only do if Python is not there OR if should be overwritten @@ -123,7 +120,7 @@ def setup_wine_python(arch, version, directory, overwrite = False): # Unpack from memory to disk f = zipfile.ZipFile(archive_zip) - f.extractall(path = target_directory) + f.extractall(path = target_directory) # Directory created if required f.close() From 139a73adf950f3228da02cb32c3d10b951da74d4 Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Wed, 6 Dec 2017 07:13:03 +0100 Subject: [PATCH 07/12] fixed comment --- src/zugbruecke/core/wineenv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zugbruecke/core/wineenv.py b/src/zugbruecke/core/wineenv.py index f35220d9..9627aa77 100644 --- a/src/zugbruecke/core/wineenv.py +++ b/src/zugbruecke/core/wineenv.py @@ -111,7 +111,7 @@ def setup_wine_python(arch, version, directory, overwrite = False): # Generate in-memory file-like-object archive_zip = BytesIO() - # Download zip file from Python website into directory + # Download zip file from Python website into file-like-object archive_req = urllib.request.urlopen( 'https://www.python.org/ftp/python/%s/%s' % (version, pyarchive) ) From 1708a870675cc1b37430c3625d6cff4b918db14d Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Wed, 6 Dec 2017 07:19:51 +0100 Subject: [PATCH 08/12] implemented workaround, cpython bug issue24960 --- src/zugbruecke/core/wineenv.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/zugbruecke/core/wineenv.py b/src/zugbruecke/core/wineenv.py index 9627aa77..e582eadb 100644 --- a/src/zugbruecke/core/wineenv.py +++ b/src/zugbruecke/core/wineenv.py @@ -123,6 +123,19 @@ def setup_wine_python(arch, version, directory, overwrite = False): f.extractall(path = target_directory) # Directory created if required f.close() + # Get path of Python library zip + library_zip_path = os.path.join(target_directory, 'python%s%s.zip' % ( + version.split('.')[0], version.split('.')[1] + )) + + # Unpack Python library from embedded zip on disk + f = zipfile.ZipFile(library_zip_path, 'r') + f.extractall(path = os.path.join(target_directory, 'Lib')) # Directory created if required + f.close() + + # Remove Python library zip from disk + os.remove(library_zip_path) + def set_wine_env(cfg_dir, arch): From 06d9f941c84ab86ace96b7840a78f9d7ba0ad425 Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Wed, 6 Dec 2017 07:26:52 +0100 Subject: [PATCH 09/12] tested and added to changelog --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 346f6a11..7784b461 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,8 +4,11 @@ Changes 0.0.6 (2017-XX-XX) ------------------ +* Added workaround for `CPython issue 24960`_ * RPC speedup due to removal of extra pickling step +.. _CPython issue 24960: https://bugs.python.org/issue24960 + 0.0.5 (2017-11-13) ------------------ From f87770a7950bb8a8b07b805ef3c0b3cc2038da86 Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Wed, 6 Dec 2017 07:38:01 +0100 Subject: [PATCH 10/12] added more info to changelog for release --- CHANGES.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 7784b461..9965b7bd 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,11 +1,13 @@ Changes ======= -0.0.6 (2017-XX-XX) +0.0.6 (2017-12-06) ------------------ -* Added workaround for `CPython issue 24960`_ * RPC speedup due to removal of extra pickling step +* Moved definition of development dependencies into ``setup.py`` +* FIX: Added workaround for `CPython issue 24960`_ (embedded zip file extracted into library folder) - was triggered by latest version of ``pluggy`` (dependency of ``pytest``) +* FIX: Preexisting installation of ``wine-python`` is now always being removed completely when required due to update or new installation .. _CPython issue 24960: https://bugs.python.org/issue24960 @@ -15,7 +17,7 @@ Changes * Added support for light-weight pointers (``ctypes.byref``) * FIX: Elements within structures are properly synchronized even if they are not a pointer on their own. * FIX: Structure objects in arrays of structures are properly initialized. -* FIX: Links in README.rst work when rendered on PyPI. +* FIX: Links in ``README.rst`` work when rendered on PyPI. 0.0.4 (2017-11-05) ------------------ From 93a6d4b6512f2785eff3687f8f67da449b8fddd7 Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Wed, 6 Dec 2017 07:40:15 +0100 Subject: [PATCH 11/12] clarified release proceedure --- HOWTORELEASE.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/HOWTORELEASE.rst b/HOWTORELEASE.rst index 910563ac..5784fccb 100644 --- a/HOWTORELEASE.rst +++ b/HOWTORELEASE.rst @@ -15,7 +15,9 @@ How to release zugbruecke #. Change to branch ``master``. -#. Merge branch ``develop`` into branch ``master`` and push it to GitHub. +#. Merge branch ``develop`` into branch ``master``. + +#. Push branch ``master`` to GitHub. #. Tag branch ``master`` with ``"v_%s" % version``. From 1a0e230651c1cebbdacebaf28b9e53d1e1507e3b Mon Sep 17 00:00:00 2001 From: "Sebastian M. Ernst" Date: Wed, 6 Dec 2017 07:44:36 +0100 Subject: [PATCH 12/12] fixed grammar in contributing file --- CONTRIBUTING.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index a5bcc98a..7e068fa6 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -57,7 +57,7 @@ Submitting patches ------------------ - Include tests if your patch is supposed to solve a bug or add a missing feature, - and explain clearly under which circumstances the bug happens what was missing. + and explain clearly under which circumstances the bug happens or what was missing. Make sure the test fails with *zugbruecke* without your patch, while it must work with *ctypes* on *Wine*. - Use **tabs** for indentation.