Skip to content

Commit

Permalink
PyQ Release 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pyq-enlnt committed Jun 2, 2020
1 parent 99f3310 commit c19a2bd
Show file tree
Hide file tree
Showing 28 changed files with 258 additions and 669 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ MANIFEST

.pytest_cache/

.kdb/
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ addons:
- gcc-multilib
script:
- pyq --versions
- pyq -mpytest --pyargs pyq --cov pyq
after_success:
- bash <(curl -s https://codecov.io/bash)
- pyq -mpytest --pyargs pyq
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
$QHOME/l32/q src/pyq/tests/test_embed.q;
fi
24 changes: 24 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# PyQ History

## PyQ 5.0

Released on 2020-06-02

Deprecations and removals:

- !688 - #1037 - remove python 2 support; python >=3.6 is now required;
users of python 2.7 - see 4.2.x series.
- !703 - drop embedPy


Enhancements:

- !702 - #1051 - add support for deleting columns using `.delete()`
- !707 - #1057 - add support for numpy 1.18
- !703 - #1055 - use setuptools_scm to specify version
- !697 - #1048 - drop 32-bit support

Bug fixes:

- !695 - #1047 Fix `K.inspect(str)`
- !704 - #1054 Don't try to define scov when running under older versions of kdb+
- !722 - #1068 Set program name in pyq.so, which fixes several issues related to venv and virtualenv20 modules on macOS.

## PyQ 4.2.1

Released on 2019-02-12
Expand Down
18 changes: 12 additions & 6 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@ include HISTORY.md
include LICENSE
include README.md
include src/pyq/_k.c
include src/pyq/mv.c
include src/pyq/pyq.c
include src/pyq/pyq.def
include src/pyq/p.k
include src/pyq/python.q
include src/pyq/pyq-operators.q
include src/pyq/pyq-print.q
include src/pyq.c
include doc/*.rst
include src/pyq/kx/*
include src/pyq/kx/*/*
include embedPy/p.q
include embedPy/py.c
include embedPy/py.h

prune .travis
prune src/ipy
prune doc
exclude *.yml
exclude .*.yml
exclude *.sh
exclude .git*
exclude .mailmap
exclude meta.yaml
exclude tox.ini
exclude .clang-format
exclude .coveragerc
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# built documents.
#
# The short X.Y version.
version = '4.2.1'
version = '5.0.0'
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
1 change: 0 additions & 1 deletion embedPy
Submodule embedPy deleted from 6b07a5
15 changes: 6 additions & 9 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
{% set name = "PyQ" %}
{% set setup_data = load_setup_py_data() %}

package:
name: '{{ name|lower }}'
version: '{{ setup_data.version }}'
version: '5.0.0'

source:
path: .

build:
number: 0
script_env:
- QHOME
- QLIC
script: 'python setup.py install'
requires:
- kdb
script:
- python -m pip install -f file://`pwd`/dist pyq
detect_binary_files_with_prefix: false
has_prefix_files:
- q/pyq-config.q

requirements:
host:
build:
- python
- setuptools_scm
- kdb
run:
- python
Expand All @@ -35,6 +31,7 @@ test:
- pytest-pyq
- numpy
commands:
- echo .z.l | q
# NB: For this to work, use conda build . --no-long-test-prefix
- pyq --versions
- pyq -mpytest --pyargs pyq
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm"]
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[pytest]
addopts = --showlocals
addopts = --showlocals -p no:faulthandler
104 changes: 19 additions & 85 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
"""PyQ - Python for kdb+
|Documentation Status| |PyPI Version|
PyQ brings the Python programming language to the kdb+ database. It allows
developers to seamlessly integrate Python and q codes in one application.
This is achieved by bringing the Python and q interpreters in the same
process so that codes written in either of the languages operate on the same
data. In PyQ, Python and q objects live in the same memory space and share
the same data.
PyQ_ brings the `Python programming language`_ to the `kdb+ database`_. It
allows developers to seamlessly integrate Python and q codes in one
application. This is achieved by bringing the Python and q interpreters in
the same process so that codes written in either of the languages operate on
the same data. In PyQ, Python and q objects live in the same memory space
and share the same data.
.. |Documentation Status|
image:: https://readthedocs.org/projects/pyq/badge/?version=latest
:target: http://pyq.readthedocs.io/en/latest/?badge=latest
.. |PyPI Version| image:: https://img.shields.io/pypi/v/pyq.svg
:target: https://pypi.python.org/pypi/pyq
.. _PyQ: https://code.kx.com/q/interfaces/pyq/
.. _`Python programming language`: https://www.python.org/about
.. _`kdb+ database`: https://kx.com
"""
import os
import platform
import subprocess
import sys

try:
from setuptools import setup
except ImportError:
from distutils.core import setup

from distutils.core import Command, Distribution, Extension
from distutils.command.build import build
from distutils.command.build_ext import build_ext
from distutils.command.config import config
Expand All @@ -35,19 +29,7 @@
import sysconfig

WINDOWS = platform.system() == 'Windows'
if WINDOWS:
from setuptools import Command, Distribution, Extension, setup
else:
from distutils.core import Command, Distribution, Extension, setup

VERSION = '4.2.1'
IS_RELEASE = True
VERSION_FILE = 'src/pyq/version.py'
VERSION_PY = """\
# generated by setup.py
version = '{}'
"""

CFLAGS = ['/WX', '/wd4090'] if WINDOWS else ['-fno-strict-aliasing']

if sys.version_info >= (3, ) and not WINDOWS:
Expand Down Expand Up @@ -131,8 +113,6 @@ def split_replace(string, a, b, sep):
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows :: Windows 10',
'Programming Language :: C',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
Expand All @@ -154,34 +134,6 @@ def add_data_file(data_files, target, source):
f.append(source)


def get_version():
write_version_file = True
if IS_RELEASE:
version = VERSION
elif os.path.exists('.git'):
try:
out = subprocess.check_output(['git', 'describe'])
_, commits, revision = decode(out).strip().split('-')
version = '{}.dev{}+{}'.format(VERSION, commits, revision[1:])
except (OSError, ValueError):
version = VERSION + '.dev0+unknown'
else:
try:
f = open(VERSION_FILE)
except OSError:
version = VERSION + '.dev0+unknown'
else:
with f:
g = {}
exec(f.read(), g)
version = g['version']
write_version_file = False
if write_version_file:
with open(VERSION_FILE, 'w') as f:
f.write(VERSION_PY.format(version))
return version


def get_q_home(env):
"""Derive q home from the environment"""
q_home = env.get('QHOME')
Expand Down Expand Up @@ -453,17 +405,13 @@ def run(self):
dry_run=self.dry_run,
force=self.force)
customize_compiler(compiler)
define = self.define[:]
if sys.version_info >= (3,):
py3k = '{:d}{:d}'.format(*sys.version_info[:2])
define.append(('PY3K', py3k))
if WINDOWS:
compiler.initialize()
compiler.compile_options.remove('/MD')
extra_args = ext.extra_compile_args or []
objects = compiler.compile(sources,
output_dir=self.build_temp,
macros=define,
macros=self.define,
extra_postargs=extra_args,
include_dirs=include_dirs)
extra_args = conf.extra_link_args[:] + ext.extra_link_args
Expand Down Expand Up @@ -661,12 +609,14 @@ class PyqDistribution(Distribution):

def run_setup(metadata):
summary, details = __doc__.split('\n\n', 1)
rst_description = '\n'.join([summary, '=' * len(summary), '\n' + details])
with open('README.md') as f:
long_description = f.read()
keywords = metadata.copy()
keywords.update(
version=get_version(),
use_scm_version={'write_to': VERSION_FILE},
description=summary,
long_description=rst_description,
long_description=long_description,
long_description_content_type='text/markdown',
distclass=PyqDistribution,
cmdclass={
'config': Config,
Expand All @@ -686,26 +636,10 @@ def run_setup(metadata):
'all': TEST_REQUIREMENTS + IPYTHON_REQUIREMENTS + [
'py', 'numpy', 'prompt-toolkit', 'pygments-q'],
}
if (sys.version_info >= (3,) and not WINDOWS and
'CONDA_PREFIX' not in os.environ and
os.path.exists('embedPy/p.q')):
try:
import numpy
except ImportError:
pass
else:
add_embedpy_components(keywords)
keywords['setup_requires'] = ['setuptools_scm']

setup(**keywords)


def add_embedpy_components(keywords):
keywords['qlib_scripts'].append('../../embedPy/p.q')
keywords['qext_modules'].append(
Extension('p', sources=['embedPy/py.c', ]),
)
add_data_file(keywords['data_files'], 'q', 'embedPy/p.q')


if __name__ == '__main__':
run_setup(METADATA)
Loading

0 comments on commit c19a2bd

Please sign in to comment.