Skip to content

Commit

Permalink
PyQ Release 4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pyq-enlnt committed Sep 21, 2017
1 parent 6d4403b commit 03b0582
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ html/
.vscode/
.ipynb_checkpoints/

MANIFEST

1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ include src/pyq/pyq-operators.q
include src/pyq.c
include doc/*.rst
include src/pyq/kx/*
include src/pyq/kx/*/*
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
try:
from pyq import __version__
except ImportError:
__version__ = '4.1.0'
__version__ = '4.1.1'


# If extensions (or modules to document with autodoc) are in another directory,
Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ See the :ref:`ipython section <ipython>` for details.
:caption: Table of Contents
:name: mastertoc

whatsnew/4.0
whatsnew/4.1
whatsnew/4.0
install/install
User Guide <manual/pyq>
reference/pyq-auto
Expand Down
4 changes: 2 additions & 2 deletions doc/install/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Windows is not supported yet.
Required Software
.................

* `kdb+ 2.8 <https://kx.com/purchasesoftware.php>`_ or later;
* `kdb+ 2.8 <https://kx.com/discover/>`_ or later;
* Python 2.7, or 3.5 or later;
* GNU make, gcc or clang.

Expand Down Expand Up @@ -88,7 +88,7 @@ Create a new virtualenv and activate it:
$ virtualenv path/to/virtualenv
$ source path/to/virtualenv/bin/activate

Download `kdb+ <https://kx.com/purchasesoftware.php>`_ and save into your ``~/Downloads`` folder. Extract it into virtualenv:
Download `kdb+ <https://kx.com/download/>`_ and save into your ``~/Downloads`` folder. Extract it into virtualenv:

::

Expand Down
2 changes: 1 addition & 1 deletion doc/license/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

.. _DOWNLOAD KDB+ SOFTWARE LICENSE AGREEMENT: http://kx.com/software-download.php
.. _DOWNLOAD KDB+ SOFTWARE LICENSE AGREEMENT: https://kx.com/download/

**************
64-bit license
Expand Down
20 changes: 12 additions & 8 deletions doc/whatsnew/4.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
What's New in PyQ 4.1
*********************

:Release: |release|
:Date: |today|
:Release: 4.1
:Date: 2017-08-30

.. testsetup:: *

Expand All @@ -24,7 +24,7 @@ Summary -- Release highlights


Return arbitrary objects from Python functions called from q
------------------------------------------------------------
============================================================

When a Python function is called from q, the returned Python
objects are now automatically converted to q. Any type accepted
Expand All @@ -43,7 +43,7 @@ diagonal and zeros elsewhere. It can be called from q as follows:


Calling Python from ``peach``
-----------------------------
=============================

Python functions can now be safely called from multiple q threads.
For example, the following session illustrates how ``peach`` distributes
Expand All @@ -62,7 +62,7 @@ work between four threads:


Backtrace mode
--------------
==============

.. note::

Expand All @@ -89,7 +89,11 @@ For example::


Experimental Windows support
----------------------------
============================

PyQ can now be installed on Windows. We tested PyQ 4.1.0 with Python 3.6 build using VS 2015 and 2017
and 32-bit kdb+ 3.5.

PyQ 4.1.1 adds support for Python 2.7.x with `Microsoft Visual C++ Compiler for Python 2.7 <http://aka.ms/vcpython27>`_.

PyQ can now be compiled under Windows. We tested Python 3.6 build using VS 2015 and 2017
and 32-bit kdb+ 3.5. Details will be provided at `Github <https://github.com/enlnt/pyq/issues/1>`_.
Latest updates on Windows support, as well as latest patches can be found at `Github <https://github.com/enlnt/pyq/issues/1>`_.
21 changes: 21 additions & 0 deletions doc/whatsnew/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@
Version History
===============

`PyQ 4.1.1 <http://pyq.readthedocs.io/en/pyq-4.1.1/>`_
------------------------------------------------------

Released on 2017-09-21

Bug fixes and enhancements

- !579 - BUG #948 Fixed compile errors on Windows with kdb+ version < 3.5.
- !577 - BUG #946 Fixed compilation errors for Python 2.7 on Windows.
- !582 - ENH #950 Explain how to properly start PyQ when launching from stock Python.

Documentation

- !583 - DOC #951 Updated links to the new kx.com website.

CI

- !584 - TST #952 Attempt to fix failing tests on Windows.



`PyQ 4.1.0 <http://pyq.readthedocs.io/en/pyq-4.1.0/>`_
------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
else:
from distutils.core import Command, Distribution, Extension, setup

VERSION = '4.1.0'
VERSION = '4.1.1'
IS_RELEASE = True
VERSION_FILE = 'src/pyq/version.py'
VERSION_PY = """\
Expand Down
13 changes: 12 additions & 1 deletion src/pyq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@
except ImportError:
_np = None

from ._k import K as _K, error as kerr, Q_VERSION, Q_DATE, Q_OS
try:
from ._k import K as _K, error as kerr, Q_VERSION, Q_DATE, Q_OS
except ImportError:
if 'python' in os.path.basename(sys.executable).lower():
import platform
message = "Importing pyq from stock python is not supported. "
if platform.system() == 'Windows':
message += "Run path\\to\\q.exe python.q."
else:
message += "Use pyq executable."
raise ImportError(message)
raise

try:
from .version import version as __version__
Expand Down
11 changes: 9 additions & 2 deletions src/pyq/_k.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ static char __version__[] = "$Revision: 10002$";
#include "kx/k.h"
#include <math.h>
#if defined (WIN32) || defined(_WIN32)
#ifndef isnan
#define isnan _isnan
#endif
#ifndef isfinite
#define isfinite _finite
#endif
Expand Down Expand Up @@ -148,7 +151,7 @@ PY_STR_AsStringAndSize(PyObject *obj, char **pstr, Py_ssize_t *psize)
/* these should be in k.h */
#if KXVER >= 3 && KXVER2 >= 5
K ee(K);
#else
#elif !defined (WIN32) && !defined(_WIN32)
V clr(V);
K1(ee)
{
Expand Down Expand Up @@ -357,9 +360,9 @@ K_trp(KObject * self, KObject *args)
}
else {
K x0, x1;
PyObject *exc_value, *message, *traceback;
x0 = kK(xk)[0];
x1 = kK(xk)[1];
PyObject *exc_value, *message, *traceback;
message = PY_STR_FromStringAndSize((S)kG(x0), (Py_ssize_t)x0->n);
traceback = KObject_FromK(Py_TYPE(self), r1(x1));
r0(x);
Expand Down Expand Up @@ -1366,7 +1369,11 @@ K_ktd(PyTypeObject * type, PyObject *args)
since 2011-01-27, ktd always decrements ref count of input.
<http://code.kx.com/q/interfaces/c-client-for-q/#creating-dictionaries-and-tables>
*/
#if defined (WIN32) || defined(_WIN32)
return KObject_FromK(type, k(0, "0!", r1(x), (K)0));
#else
return KObject_FromK(type, ee(ktd(r1(x))));
#endif
}

PyDoc_STRVAR(K_err_doc, "sets a K error\n\n>>> K.err('test')\n");
Expand Down
2 changes: 1 addition & 1 deletion src/pyq/p.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ py(K f, K x)
free(wargv_copy);
free(wargv);
#else
r = Py_Main((size_t)argc, argv);
r = Py_Main((int)argc, argv);
#endif
free(argv);
free(buf);
Expand Down
8 changes: 6 additions & 2 deletions src/pyq/tests/test_p.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def test():
def test_test_p0(tmpdir):
test_p = tmpdir.join('test.p')
test_p.write(TEST_P)
out = subprocess.check_output([os.environ['QBIN'], str(test_p)])
with open(os.devnull) as null:
out = subprocess.check_output([os.environ['QBIN'], str(test_p)],
stdin=null)
assert b'ok' in out


Expand Down Expand Up @@ -60,5 +62,7 @@ def test_test_p_exception(tmpdir):
def test_p__file__qbin(tmpdir):
p = tmpdir.join('test.p')
p.write("import sys\nprint(__file__)\nsys.exit(0)")
out = subprocess.check_output([os.environ['QBIN'], str(p)])
with open(os.devnull) as null:
out = subprocess.check_output([os.environ['QBIN'], str(p)],
stdin=null)
assert out.strip().endswith(str(p).encode())

0 comments on commit 03b0582

Please sign in to comment.