Skip to content

Commit

Permalink
try get more python working on windows (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipDeegan authored Mar 4, 2023
1 parent 4187902 commit 6be9d62
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
python-version: ['3.7', '3.9', '3.10'] # '3.8' has "'tp_print' is deprecated [-Werror,-Wdeprecated-declarations]"
python-version: ['3.7', '3.9', '3.10', '3.11'] # '3.8' has "'tp_print' is deprecated [-Werror,-Wdeprecated-declarations]"

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/build_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env:
TICK_DEBUG: 0
TICK_WERROR: 0
MKN_CL_PREFERRED: 1
MKN_COMPILE_THREADS: 2

jobs:
build:
Expand All @@ -21,10 +22,10 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
python-version: ['3.7'] # '3.8', '3.9', '3.10', have dll init issues
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true

Expand Down
4 changes: 2 additions & 2 deletions lib/mkn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ property:
lib_path: ./../tick
cargs: -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION
-D_FILE_OFFSET_BITS=64 -DPYTHON_LINK -DNDEBUG
win_cargs: -GL -MD -EHsc -DBUILDING_DLL -std:c++11
win_cargs: -GL -MD -EHsc -DBUILDING_DLL
nixish_cargs: -fwrapv -O2 -Wall
-fstack-protector-strong
-Wformat -Werror -Wdate-time
Expand Down Expand Up @@ -53,7 +53,7 @@ profile:
if_link:
nix_lib: ${nix_largs}
bsd_lib: ${bsd_largs}
win: -nodefaultlib:libucrt.lib ucrt.lib -MANIFEST:EMBED,ID=2 -MANIFESTUAC:NO -LTCG
win: -LTCG # -nodefaultlib:libucrt.lib ucrt.lib -MANIFEST:EMBED,ID=2 -MANIFESTUAC:NO

- name: base
parent: arg
Expand Down
2 changes: 2 additions & 0 deletions lib/swig/tick/array/array_module.i
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
#include "numpy/arrayobject.h"
#include "numpy/npy_math.h"

#ifndef _WIN32
// initialize python and numpy
int tick_import_numpy(){
Py_Initialize();
return _import_array();
}
static const int tick_numpy_import = tick_import_numpy();
#endif

#include "tick/base/debug.h"
#include "tick/array/carray_python.h"
Expand Down
4 changes: 2 additions & 2 deletions sh/configure_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
######################################################################

set -ex
set -e

echo "Entering configure_env.sh"

Expand Down Expand Up @@ -329,7 +329,7 @@ MKN=${MKN:-mkn}
export MKN_LIB_LINK_LIB=1
export TICK_CONFIGURED=1

echo "Finished configure_env.sh for python (${PYVER}.${PYVER_MIN}) with the following args"
echo "Finished configure_env.sh for python (${PYVER}) with the following args"
echo "LDARGS = ${LDARGS}"
echo ""
##
Expand Down
2 changes: 1 addition & 1 deletion sh/mkn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pushd $CWD/.. 2>&1 > /dev/null
ROOT=$PWD
popd 2>&1 > /dev/null

source $ROOT/sh/configure_env.sh
source $CWD/configure_env.sh

COMPILE=1
LINK=1
Expand Down
6 changes: 5 additions & 1 deletion tick/base/tests/base_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# License: BSD 3 clause

# -*- coding: utf8 -*-
import sys
import unittest

from tick.base import Base
Expand Down Expand Up @@ -471,7 +472,10 @@ def test_getter_only_native_property(self):
def frop(x):
self.a0.readonly_prop = x

self.assertRaisesRegex(AttributeError, "can't set attribute", frop, 45)
msg = "can't set attribute"
if sys.version_info[1] == 11:
msg = "property 'readonly_prop' of 'A0' object has no setter"
self.assertRaisesRegex(AttributeError, msg, frop, 45)

def test_attributes_are_not_shared(self):
"""...Test that two instances of the same class do not share any
Expand Down

0 comments on commit 6be9d62

Please sign in to comment.