-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python: Move tests outside of src directory
Tests shouldn't be shipped with the Python NVTX package. With this commit, test_profiler.pyx is not included in the wheel anymore. More information about test layout: https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#choosing-a-test-layout-import-rules
- Loading branch information
1 parent
372a784
commit 272fafb
Showing
8 changed files
with
28 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from Cython.Build import cythonize | ||
from Cython.Build.Cythonize import run_distutils | ||
from pathlib import Path | ||
from setuptools.extension import Extension | ||
|
||
|
||
def build_cython(): | ||
"""Compile Cython files inside tests/cython""" | ||
tests_dir = Path(__file__).parent | ||
cython_dir = tests_dir / 'cython' | ||
include_dir = tests_dir.parent.parent / 'c' / 'include' | ||
run_distutils(( | ||
str(cython_dir), | ||
cythonize( | ||
Extension('*', sources=[str(cython_dir / '*.pyx')], include_dirs=[str(include_dir)]), | ||
compiler_directives=dict(language_level=3, embedsignature=True, profile=True)) | ||
)) | ||
|
||
|
||
def pytest_configure(config): | ||
build_cython() |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .cython.test_profiler import test_profiler_message as _test_profiler_message | ||
|
||
|
||
def test_profiler(): | ||
_test_profiler_message() |