Skip to content

Commit

Permalink
refactor: Use apigen to generate cython.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Jan 6, 2024
1 parent 3a9e66b commit e366f1f
Show file tree
Hide file tree
Showing 13 changed files with 1,117 additions and 553 deletions.
28 changes: 14 additions & 14 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ load("//tools/project:build_defs.bzl", "project")

project(license = "gpl3-https")

genrule(
name = "pytox/core",
srcs = [
"pytox/src/core.pyx",
"//c-toxcore:tox/tox.h",
],
outs = ["pytox/core.pyx"],
cmd = "$(location //py_toxcore_c/tools:gen_api) $(location pytox/src/core.pyx) $(location //c-toxcore:tox/tox.h) > $@",
tools = ["//py_toxcore_c/tools:gen_api"],
)
#genrule(
# name = "pytox/core",
# srcs = [
# "pytox/src/core.pyx",
# "//c-toxcore:tox/tox.h",
# ],
# outs = ["pytox/core.pyx"],
# cmd = "$(location //py_toxcore_c/tools:gen_api) $(location pytox/src/core.pyx) $(location //c-toxcore:tox/tox.h) > $@",
# tools = ["//py_toxcore_c/tools:gen_api"],
#)

pyx_library(
name = "pytox",
srcs = [
"pytox/av.pyx",
"pytox/core.pyx",
],
srcs = glob([
"pytox/**/*.pxd",
"pytox/**/*.pyx",
]),
cdeps = ["//c-toxcore"],
cython_directives = {"language_level": "3"},
tags = ["no-cross"],
Expand Down
6 changes: 0 additions & 6 deletions pytox/av.pyx

This file was deleted.

233 changes: 0 additions & 233 deletions pytox/src/core.pyx

This file was deleted.

6 changes: 6 additions & 0 deletions pytox/toxav/toxav.pyx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# cython: language_level=3

from pytox.toxcore import tox

def foo() -> str:
tox.VERSION
Loading

0 comments on commit e366f1f

Please sign in to comment.