Skip to content

Commit 9f79bd5

Browse files
committed
Merge branch 'rel1.3'
2 parents 81091f3 + 368f856 commit 9f79bd5

28 files changed

+224
-24
lines changed

.travis.yml

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
stage: standalone
12
language: c
23
os:
34
- linux
@@ -21,13 +22,11 @@ script:
2122
fi
2223
- make p.so
2324
- cp [ml]64/p.so q/$QLIBDIR;
24-
- echo "Preparing version $TRAVIS_BRANCH-$TRAVIS_COMMIT"
2525
- tar czf embedPy_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.tgz p.q p.k test.q tests [ml]64/p.so LICENSE README.md
26-
- echo "Packaged as embedPy_$TRAVIS_OS_NAME-$TRAVIS_BRANCH.zip"
2726
- if [[ "x$QLIC_KC" != "x" ]]; then
2827
echo -n $QLIC_KC |base64 --decode > q/kc.lic;
2928
pip3 -q install -r tests/requirements.txt;
30-
q test.q -q;
29+
q test.q -s 4 -q;
3130
else
3231
echo No kdb+, no tests;
3332
fi
@@ -43,7 +42,9 @@ deploy:
4342
tags: true
4443
jobs:
4544
include:
46-
- stage: docker
45+
- stage: deploy_target
46+
env:
47+
- TARGET=docker
4748
sudo: required
4849
services:
4950
- docker
@@ -56,9 +57,45 @@ jobs:
5657
script:
5758
- echo $DOCKER_PASSWORD|docker login --username $DOCKER_USERNAME --password-stdin && docker push kxsys/embedpy:latest && docker push kxsys/embedpy:$TRAVIS_BRANCH
5859
skip_cleanup: true
60+
on:
61+
tags: true
62+
condition: $TRAVIS_BRANCH =~ ^[0-9]+\. && $TRAVIS_REPOSLUG = KxSystems/embedPy
63+
- &conda_build
64+
stage: deploy_target
65+
env:
66+
- TARGET=conda
67+
os:
68+
- linux
69+
before_install: skip
70+
install:
71+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
72+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
73+
else
74+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
75+
fi
76+
- bash miniconda.sh -b -p $HOME/miniconda
77+
- export PATH="$HOME/miniconda/bin:$PATH"
78+
- hash -r
79+
- conda config --set always_yes yes --set changeps1 no
80+
- conda install -q "conda-build<3.12"
81+
script:
82+
- if [ $TRAVIS_OS_NAME = linux ]; then QLIBDIR=l64; elif [ $TRAVIS_OS_NAME = osx ]; then QLIBDIR=m64; fi; export QLIBDIR
83+
- if [[ "x$QLIC_KC" != "x" ]]; then mkdir -p q; echo -n $QLIC_KC |base64 --decode > q/kc.lic; export QLIC=$(pwd)/q; fi
84+
- export EMBEDPY_VERSION=$TRAVIS_BRANCH
85+
- conda build conda-recipe --output -c kx > packagenames.txt
86+
- conda build -c kx conda-recipe --no-long-test-prefix
87+
deploy:
88+
provider: script
89+
script:
90+
- build/anaconda_upload.sh
91+
skip_cleanup: true
5992
on:
6093
tags: true
6194
condition: $TRAVIS_BRANCH =~ ^[0-9]+\.
95+
- <<: *conda_build
96+
os:
97+
- osx
98+
6299
notifications:
63100
slack:
64101
secure: "MR5icOywJJSFy7gnxeNXACN2nKiHniVgX1myiF+H9U4wsW6+2BHzPMcmy3FIUjL3Tb+PcAfq7+8RHerAx/XEB7nsVJsu9TyCjYWgaqx5Z9WNIDcjQh4wnFurhlzqrwF4gjelY+wxdffpsKUVaP+fermWbqHvv1aPPk4l3xEonXZ5J5uNkPTPufILzpx2cTxWg08o6PhvgjTrombs+9rGxahU8cfUSwTVuPCcPtOy70kcaowFfrU2kWzQk88NM5d/TVZdkOmGhLqVWSvRgaLXFkGYwRWatT7divlXX2evYwdYib++RUUhxDGZwJjdFCbGDNjrMyBbJOrCkndxLSATd6gN76dWuWsVV49K4YB0Mw5uFJFt6J0TnbkJC5Zsl9i6vik7m3anuIPOeAI54/wtlCvMeIpt2eQCPMy7xXu2hXNUR4ofM4yaVjKz69b5JIZ1o3vBxPQxAqIYggqPsTaLJM4vLpZlncnViBkfO/La5V9sJNQy3IyLSlEKry3giYfo8wbHT3PLn1xG7HW2DJ7hRn19yzTkCCNfaSzvq8YlSQvjNlPCO566ykYYG6SzG/NnbDqJAqydhpFuNC7ZB5dPuAOoDANCGs4gtfYKia+ZVxKYn25Y52vdi34L5TO83BUrsQWgytb0J6a4jDe3PWLVFSP7XLiy4h8Tyv76+Hm4lHk="

appveyor.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,15 @@ platform: x64
88
build_script:
99
- cmd: >-
1010
11-
curl -fsSL -o k.h https://github.com/KxSystems/kdb/raw/master/c/c/k.h
11+
call build\build.bat
1212
13-
curl -fsSL -o q.lib https://github.com/KxSystems/kdb/raw/master/w64/q.lib
14-
15-
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
16-
17-
mkdir w64
18-
19-
cl /LD /DKXVER=3 /Fep.dll /O2 py.c q.lib
20-
21-
move p.dll w64
2213
after_build:
2314
- cmd: >-
2415
25-
if "%APPVEYOR_REPO_TAG%"=="true" ( 7z a embedPy_windows-%APPVEYOR_REPO_TAG_NAME%.zip p.q p.k test.q tests w64/p.dll LICENSE README.md && appveyor PushArtifact embedPy_windows-%APPVEYOR_REPO_TAG_NAME%.zip )
16+
call build\package.bat
17+
18+
call build\anaconda_upload.bat
2619
27-
if "%APPVEYOR_REPO_TAG%"=="false" ( 7z a embedPy_windows-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_BUILD_VERSION%.zip p.q p.k test.q tests w64/p.dll LICENSE README.md && appveyor PushArtifact embedPy_windows-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_BUILD_VERSION%.zip )
2820
deploy:
2921
release: $(appveyor_repo_tag_name)
3022
provider: GitHub

build/anaconda_upload.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if "%APPVEYOR_REPO_TAG%"=="true" (
2+
for /F "tokens=*" %%P in (packagenames.txt) do anaconda -t %CONDATOKEN% upload -l dev %%P || goto :error
3+
)
4+
:error
5+
exit /b %errorLevel%

build/anaconda_upload.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
conda install -q -y anaconda-client
3+
for pack in $(cat packagenames.txt)
4+
do
5+
anaconda -t $CONDATOKEN upload -l dev $pack
6+
done
7+

build/build.bat

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
:: Standalone build
2+
curl -fsSL -o k.h https://github.com/KxSystems/kdb/raw/master/c/c/k.h || goto :error
3+
curl -fsSL -o q.lib https://github.com/KxSystems/kdb/raw/master/w64/q.lib || goto :error
4+
::keep original PATH, PATH may get too long otherwise
5+
set OP=%PATH%
6+
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
7+
mkdir w64
8+
cl /LD /DKXVER=3 /Fep.dll /O2 py.c q.lib || goto :error
9+
move p.dll w64
10+
set PATH=%OP%
11+
12+
:: Conda build
13+
set PATH=C:\Miniconda3-x64;C:\Miniconda3-x64\Scripts;%PATH%
14+
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86_amd64
15+
:: install conda build requirements (use version < 3.12 to avoid warning about verify in output file)
16+
conda install -y "conda-build<3.12" || goto :error
17+
conda install -y anaconda-client || goto :error
18+
:: set up kdb+ if available
19+
if defined QLIC_KC ( echo|set /P=%QLIC_KC% > kc.lic.enc & certutil -decode kc.lic.enc kc.lic & set QLIC=%CD%)
20+
if "%APPVEYOR_REPO_TAG%"=="true" ( set EMBEDPY_VERSION=%APPVEYOR_REPO_TAG_NAME% )
21+
conda build --output conda-recipe > packagenames.txt || goto :error
22+
conda build -c kx conda-recipe || goto :error
23+
set PATH=%OP%;C:\Miniconda3-x64;C:\Miniconda3-x64\Scripts
24+
exit /b 0
25+
26+
:error
27+
exit /b %errorLevel%

build/package.bat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
set ZIPNAME=
2+
if "%APPVEYOR_REPO_TAG%"=="true" (
3+
set ZIPNAME=embedPy_windows-%APPVEYOR_REPO_TAG_NAME%.zip
4+
) else (
5+
set ZIPNAME=embedPy_windows-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_BUILD_VERSION%.zip
6+
)
7+
7z a %ZIPNAME% p.q p.k test.q tests w64/p.dll LICENSE README.md || goto :error
8+
appveyor PushArtifact %ZIPNAME% || goto :error
9+
exit /b 0
10+
:error
11+
exit /b %errorLevel%

conda-recipe/bld.bat

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
set QHOME=%PREFIX%\q
2+
mkdir %QHOME%
3+
move p.q %QHOME% || goto :error
4+
move p.k %QHOME% || goto :error
5+
6+
set QBIN=%QHOME%\w64
7+
mkdir QBIN
8+
cl /LD /DKXVER=3 /Fep.dll /O2 py.c q.lib || goto :error
9+
move p.dll %QBIN% || goto :error
10+
exit 0
11+
:error
12+
exit %errorlevel%
13+

conda-recipe/build.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
export QHOME=$PREFIX/q
3+
if [ $(uname) == Linux ];
4+
then
5+
QLIBDIR=l64
6+
else
7+
QLIBDIR=m64
8+
fi
9+
make p.so
10+
mkdir -p $QHOME
11+
mkdir -p $QHOME/$QLIBDIR
12+
mv p.q p.k $QHOME
13+
mv $QLIBDIR/p.so $QHOME/$QLIBDIR
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
python:
2+
- 3.5
3+
- 3.6
4+
- 3.7

conda-recipe/meta.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package:
2+
name: embedpy
3+
version: {{ environ.get('EMBEDPY_VERSION', 'noversion') }}
4+
5+
source:
6+
path: ..
7+
8+
build:
9+
detect_binary_files_with_prefix: False
10+
script_env:
11+
QLIC
12+
13+
requirements:
14+
build:
15+
- m2w64-make [win]
16+
- {{ compiler('c') }}
17+
host:
18+
- python
19+
- kdb
20+
run:
21+
- python
22+
- kdb
23+
test:
24+
source_files:
25+
- test.q
26+
- tests/
27+
- conda-recipe/prep_requirements.q
28+
29+
about:
30+
home: https://github.com/KxSystems/embedPy
31+
summary: allows the kdb+ interpreter to manipulate Python objects

0 commit comments

Comments
 (0)