Skip to content

Commit

Permalink
Set cython directives globally (#666)
Browse files Browse the repository at this point in the history
Set cython directives like `language_level=3` and `embedsignature=True` globally,
so that they are applied to all the cython files, rather than manually in each one.
This removes a bunch of build warnings about not specifying a language_level while
building
  • Loading branch information
benfred authored Jun 7, 2023
1 parent 954e8f8 commit c55fb70
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
6 changes: 6 additions & 0 deletions implicit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
if(NOT CYTHON_FLAGS)
set(CYTHON_FLAGS
"--directive always_allow_keywords=True,binding=True,embedsignature=True,language_level=3"
)
endif()

add_cython_target(_nearest_neighbours CXX)
add_library(_nearest_neighbours MODULE ${_nearest_neighbours})
python_extension_module(_nearest_neighbours)
Expand Down
3 changes: 0 additions & 3 deletions implicit/cpu/bpr.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# cython: language_level=3
# cython: embedsignature=True

import cython

from cython cimport floating, integral
Expand Down
3 changes: 0 additions & 3 deletions implicit/cpu/lmf.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# cython: language_level=3
# cython: embedsignature=True

import cython

from cython cimport floating, integral
Expand Down
2 changes: 0 additions & 2 deletions implicit/evaluation.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# distutils: language = c++
# cython: language_level=3
# cython: embedsignature=True

import cython
import numpy as np
Expand Down

0 comments on commit c55fb70

Please sign in to comment.