Skip to content

Commit

Permalink
Release of 0.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
s-m-e committed Dec 6, 2017
2 parents 8022c27 + 1a0e230 commit ba9bdc2
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 30 deletions.
12 changes: 11 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
Changes
=======

0.0.6 (2017-12-06)
------------------

* 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

0.0.5 (2017-11-13)
------------------

* 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)
------------------
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion HOWTORELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``.

Expand Down
6 changes: 2 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 2 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
setuptools
wheel
pytest
Sphinx
sphinx_rtd_theme
twine
--index-url https://pypi.python.org/simple/
--process-dependency-links -e .[dev]
12 changes: 10 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


# Bump version HERE!
_version_ = '0.0.5'
_version_ = '0.0.6'


# List all versions of Python which are supported
Expand Down Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion src/zugbruecke/_wrapper_.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down
11 changes: 5 additions & 6 deletions src/zugbruecke/core/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
Client,
Listener
)
import pickle
from threading import Thread
import traceback

Expand All @@ -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):
Expand Down Expand Up @@ -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:

Expand Down
26 changes: 18 additions & 8 deletions src/zugbruecke/core/wineenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -114,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)
)
Expand All @@ -123,9 +120,22 @@ 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()

# 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):

Expand Down

0 comments on commit ba9bdc2

Please sign in to comment.