Skip to content

Commit

Permalink
imporve py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethosa committed Jan 13, 2024
1 parent 2e428cc commit 61bf93a
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/language_bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
echo "Win Module compiled with"
echo "nim c --app:lib --out:../bindings/python/happyx/happyx.pyd -d:useRealtimeGC --mm:arc --tlsEmulation:off --passL:-static --t:-flto --l:-flto --opt:speed --threads:off -d:release -d:httpx -d:export2py happyx"
echo "Linux module"
nim c --app:lib --out:../bindings/python/happyx/happyx.so -d:useRealtimeGC --mm:arc -t:-flto -l:-flto --opt:speed --threads:on -d:release -d:happyxDebug -x:off -a:off -d:httpx -d:export2py happyx
nim c --app:lib --out:../bindings/python/happyx/happyx.so -d:useRealtimeGC --mm:arc -t:-flto -l:-flto --opt:speed --threads:off -d:release -d:happyxDebug -x:off -a:off -d:beast -d:export2py happyx
shell: bash

- name: Build Package 🏗
Expand Down
Binary file modified bindings/python/happyx/happyx.pyd
Binary file not shown.
19 changes: 18 additions & 1 deletion build_py.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
echo "Build Python Win Bindings"
cd src
nim c --app:lib --out:../bindings/python/happyx/happyx.pyd --tlsEmulation:off --mm:arc --passL:-static --threads:on --opt:speed -t:-flto -l:-flto -x:off -a:off -d:useRealtimeGC -d:release -d:happyxDebug -d:httpx -d:export2py happyx
nim c ^
--app:lib ^
--out:../bindings/python/happyx/happyx.pyd ^
--tlsEmulation:off ^
--mm:arc ^
--passL:-static ^
--threads:off ^
--opt:speed ^
-t:-flto ^
-l:-flto ^
-x:off ^
-a:off ^
-d:useRealtimeGC ^
-d:release ^
-d:happyxDebug ^
-d:httpx ^
-d:export2py ^
happyx
cd ../
2 changes: 1 addition & 1 deletion happyx.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

description = "Macro-oriented asynchronous web-framework written with ♥"
author = "HapticX"
version = "3.8.9"
version = "3.8.10"
license = "MIT"
srcDir = "src"
installExt = @["nim"]
Expand Down
2 changes: 1 addition & 1 deletion src/happyx/bindings/python_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ proc initRoute*(path, purePath: string, httpMethod: seq[string], pattern: Regex2
posArgs: @[]
)
result.locals = pyDict()
result.locals["func"] = handler
result.locals["handler"] = handler
# fetch __defaults__
if not handler.isNil:
var defaults: JsonNode
Expand Down
2 changes: 1 addition & 1 deletion src/happyx/core/constants.nim
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const
# Framework version
HpxMajor* = 3
HpxMinor* = 8
HpxPatch* = 9
HpxPatch* = 10
HpxVersion* = $HpxMajor & "." & $HpxMinor & "." & $HpxPatch


Expand Down
1 change: 0 additions & 1 deletion src/happyx/ssr/handlers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ elif exportPython:
if route.httpMethod == @["WEBSOCKET"]:
let wsClient = await newWebSocket(req)
# Declare route handler
var handler = route.handler
let wsConnection = newWebSocketObj(wsClient, "")
if handlerParams.hasParamType("WebSocket"):
pyFuncParams[handlerParams.getParamName("WebSocket")] = wsConnection
Expand Down

0 comments on commit 61bf93a

Please sign in to comment.