Skip to content

Commit c19a2bd

Browse files
committed
PyQ Release 5.0.0
1 parent 99f3310 commit c19a2bd

28 files changed

+258
-669
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ MANIFEST
2020

2121
.pytest_cache/
2222

23+
.kdb/

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ addons:
5656
- gcc-multilib
5757
script:
5858
- pyq --versions
59-
- pyq -mpytest --pyargs pyq --cov pyq
60-
after_success:
61-
- bash <(curl -s https://codecov.io/bash)
59+
- pyq -mpytest --pyargs pyq
60+
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
61+
$QHOME/l32/q src/pyq/tests/test_embed.q;
62+
fi

HISTORY.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# PyQ History
22

3+
## PyQ 5.0
4+
5+
Released on 2020-06-02
6+
7+
Deprecations and removals:
8+
9+
- !688 - #1037 - remove python 2 support; python >=3.6 is now required;
10+
users of python 2.7 - see 4.2.x series.
11+
- !703 - drop embedPy
12+
13+
14+
Enhancements:
15+
16+
- !702 - #1051 - add support for deleting columns using `.delete()`
17+
- !707 - #1057 - add support for numpy 1.18
18+
- !703 - #1055 - use setuptools_scm to specify version
19+
- !697 - #1048 - drop 32-bit support
20+
21+
Bug fixes:
22+
23+
- !695 - #1047 Fix `K.inspect(str)`
24+
- !704 - #1054 Don't try to define scov when running under older versions of kdb+
25+
- !722 - #1068 Set program name in pyq.so, which fixes several issues related to venv and virtualenv20 modules on macOS.
26+
327
## PyQ 4.2.1
428

529
Released on 2019-02-12

MANIFEST.in

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@ include HISTORY.md
33
include LICENSE
44
include README.md
55
include src/pyq/_k.c
6-
include src/pyq/mv.c
76
include src/pyq/pyq.c
87
include src/pyq/pyq.def
98
include src/pyq/p.k
109
include src/pyq/python.q
1110
include src/pyq/pyq-operators.q
1211
include src/pyq/pyq-print.q
1312
include src/pyq.c
14-
include doc/*.rst
1513
include src/pyq/kx/*
1614
include src/pyq/kx/*/*
17-
include embedPy/p.q
18-
include embedPy/py.c
19-
include embedPy/py.h
20-
15+
prune .travis
16+
prune src/ipy
17+
prune doc
18+
exclude *.yml
19+
exclude .*.yml
20+
exclude *.sh
21+
exclude .git*
22+
exclude .mailmap
23+
exclude meta.yaml
24+
exclude tox.ini
25+
exclude .clang-format
26+
exclude .coveragerc

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
# built documents.
5555
#
5656
# The short X.Y version.
57-
version = '4.2.1'
57+
version = '5.0.0'
5858
# The full version, including alpha/beta/rc tags.
5959
release = version
6060

embedPy

Lines changed: 0 additions & 1 deletion
This file was deleted.

meta.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
11
{% set name = "PyQ" %}
2-
{% set setup_data = load_setup_py_data() %}
32

43
package:
54
name: '{{ name|lower }}'
6-
version: '{{ setup_data.version }}'
5+
version: '5.0.0'
76

87
source:
98
path: .
109

1110
build:
1211
number: 0
13-
script_env:
14-
- QHOME
15-
- QLIC
16-
script: 'python setup.py install'
17-
requires:
18-
- kdb
12+
script:
13+
- python -m pip install -f file://`pwd`/dist pyq
1914
detect_binary_files_with_prefix: false
2015
has_prefix_files:
2116
- q/pyq-config.q
2217

2318
requirements:
24-
host:
19+
build:
2520
- python
21+
- setuptools_scm
2622
- kdb
2723
run:
2824
- python
@@ -35,6 +31,7 @@ test:
3531
- pytest-pyq
3632
- numpy
3733
commands:
34+
- echo .z.l | q
3835
# NB: For this to work, use conda build . --no-long-test-prefix
3936
- pyq --versions
4037
- pyq -mpytest --pyargs pyq

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build-system]
2+
requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm"]

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[pytest]
2-
addopts = --showlocals
2+
addopts = --showlocals -p no:faulthandler

setup.py

Lines changed: 19 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
11
"""PyQ - Python for kdb+
22
3-
|Documentation Status| |PyPI Version|
3+
PyQ brings the Python programming language to the kdb+ database. It allows
4+
developers to seamlessly integrate Python and q codes in one application.
5+
This is achieved by bringing the Python and q interpreters in the same
6+
process so that codes written in either of the languages operate on the same
7+
data. In PyQ, Python and q objects live in the same memory space and share
8+
the same data.
49
5-
PyQ_ brings the `Python programming language`_ to the `kdb+ database`_. It
6-
allows developers to seamlessly integrate Python and q codes in one
7-
application. This is achieved by bringing the Python and q interpreters in
8-
the same process so that codes written in either of the languages operate on
9-
the same data. In PyQ, Python and q objects live in the same memory space
10-
and share the same data.
11-
12-
.. |Documentation Status|
13-
image:: https://readthedocs.org/projects/pyq/badge/?version=latest
14-
:target: http://pyq.readthedocs.io/en/latest/?badge=latest
15-
16-
.. |PyPI Version| image:: https://img.shields.io/pypi/v/pyq.svg
17-
:target: https://pypi.python.org/pypi/pyq
18-
19-
.. _PyQ: https://code.kx.com/q/interfaces/pyq/
20-
.. _`Python programming language`: https://www.python.org/about
21-
.. _`kdb+ database`: https://kx.com
2210
"""
2311
import os
2412
import platform
2513
import subprocess
2614
import sys
2715

16+
try:
17+
from setuptools import setup
18+
except ImportError:
19+
from distutils.core import setup
20+
21+
from distutils.core import Command, Distribution, Extension
2822
from distutils.command.build import build
2923
from distutils.command.build_ext import build_ext
3024
from distutils.command.config import config
@@ -35,19 +29,7 @@
3529
import sysconfig
3630

3731
WINDOWS = platform.system() == 'Windows'
38-
if WINDOWS:
39-
from setuptools import Command, Distribution, Extension, setup
40-
else:
41-
from distutils.core import Command, Distribution, Extension, setup
42-
43-
VERSION = '4.2.1'
44-
IS_RELEASE = True
4532
VERSION_FILE = 'src/pyq/version.py'
46-
VERSION_PY = """\
47-
# generated by setup.py
48-
version = '{}'
49-
"""
50-
5133
CFLAGS = ['/WX', '/wd4090'] if WINDOWS else ['-fno-strict-aliasing']
5234

5335
if sys.version_info >= (3, ) and not WINDOWS:
@@ -131,8 +113,6 @@ def split_replace(string, a, b, sep):
131113
'Operating System :: POSIX :: Linux',
132114
'Operating System :: Microsoft :: Windows :: Windows 10',
133115
'Programming Language :: C',
134-
'Programming Language :: Python :: 2.7',
135-
'Programming Language :: Python :: 3.5',
136116
'Programming Language :: Python :: 3.6',
137117
'Programming Language :: Python :: 3.7',
138118
'Programming Language :: Python :: Implementation :: CPython',
@@ -154,34 +134,6 @@ def add_data_file(data_files, target, source):
154134
f.append(source)
155135

156136

157-
def get_version():
158-
write_version_file = True
159-
if IS_RELEASE:
160-
version = VERSION
161-
elif os.path.exists('.git'):
162-
try:
163-
out = subprocess.check_output(['git', 'describe'])
164-
_, commits, revision = decode(out).strip().split('-')
165-
version = '{}.dev{}+{}'.format(VERSION, commits, revision[1:])
166-
except (OSError, ValueError):
167-
version = VERSION + '.dev0+unknown'
168-
else:
169-
try:
170-
f = open(VERSION_FILE)
171-
except OSError:
172-
version = VERSION + '.dev0+unknown'
173-
else:
174-
with f:
175-
g = {}
176-
exec(f.read(), g)
177-
version = g['version']
178-
write_version_file = False
179-
if write_version_file:
180-
with open(VERSION_FILE, 'w') as f:
181-
f.write(VERSION_PY.format(version))
182-
return version
183-
184-
185137
def get_q_home(env):
186138
"""Derive q home from the environment"""
187139
q_home = env.get('QHOME')
@@ -453,17 +405,13 @@ def run(self):
453405
dry_run=self.dry_run,
454406
force=self.force)
455407
customize_compiler(compiler)
456-
define = self.define[:]
457-
if sys.version_info >= (3,):
458-
py3k = '{:d}{:d}'.format(*sys.version_info[:2])
459-
define.append(('PY3K', py3k))
460408
if WINDOWS:
461409
compiler.initialize()
462410
compiler.compile_options.remove('/MD')
463411
extra_args = ext.extra_compile_args or []
464412
objects = compiler.compile(sources,
465413
output_dir=self.build_temp,
466-
macros=define,
414+
macros=self.define,
467415
extra_postargs=extra_args,
468416
include_dirs=include_dirs)
469417
extra_args = conf.extra_link_args[:] + ext.extra_link_args
@@ -661,12 +609,14 @@ class PyqDistribution(Distribution):
661609

662610
def run_setup(metadata):
663611
summary, details = __doc__.split('\n\n', 1)
664-
rst_description = '\n'.join([summary, '=' * len(summary), '\n' + details])
612+
with open('README.md') as f:
613+
long_description = f.read()
665614
keywords = metadata.copy()
666615
keywords.update(
667-
version=get_version(),
616+
use_scm_version={'write_to': VERSION_FILE},
668617
description=summary,
669-
long_description=rst_description,
618+
long_description=long_description,
619+
long_description_content_type='text/markdown',
670620
distclass=PyqDistribution,
671621
cmdclass={
672622
'config': Config,
@@ -686,26 +636,10 @@ def run_setup(metadata):
686636
'all': TEST_REQUIREMENTS + IPYTHON_REQUIREMENTS + [
687637
'py', 'numpy', 'prompt-toolkit', 'pygments-q'],
688638
}
689-
if (sys.version_info >= (3,) and not WINDOWS and
690-
'CONDA_PREFIX' not in os.environ and
691-
os.path.exists('embedPy/p.q')):
692-
try:
693-
import numpy
694-
except ImportError:
695-
pass
696-
else:
697-
add_embedpy_components(keywords)
639+
keywords['setup_requires'] = ['setuptools_scm']
698640

699641
setup(**keywords)
700642

701643

702-
def add_embedpy_components(keywords):
703-
keywords['qlib_scripts'].append('../../embedPy/p.q')
704-
keywords['qext_modules'].append(
705-
Extension('p', sources=['embedPy/py.c', ]),
706-
)
707-
add_data_file(keywords['data_files'], 'q', 'embedPy/p.q')
708-
709-
710644
if __name__ == '__main__':
711645
run_setup(METADATA)

0 commit comments

Comments
 (0)