Skip to content

Commit bcebd33

Browse files
jdbrettlangdon
authored andcommitted
fix(setup): force rebuilding Cython files (#1468)
Always force rebuilding Cython files to make sure we build for the right Python version. This allows to remove the hack we had in tox.ini and makes sure that when building from a sdist, the .c files are generated with the right Python version. Fixes #1461 Co-authored-by: Brett Langdon <[email protected]>
1 parent 38046da commit bcebd33

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ def get_exts_for(name):
172172
"PY_MINOR_VERSION": sys.version_info.minor,
173173
"PY_MICRO_VERSION": sys.version_info.micro,
174174
},
175+
force=True,
175176
)
176177
+ get_exts_for("wrapt")
177178
+ get_exts_for("psutil"),

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ isolated_build = true
158158
# meaning running on py3.x will fail
159159
# https://stackoverflow.com/questions/57459123/why-do-i-need-to-run-tox-twice-to-test-a-python-package-with-c-extension
160160
whitelist_externals=rm
161-
commands_pre=rm -f ddtrace/profiling/_build.c ddtrace/profiling/collector/stack.c ddtrace/profiling/collector/_traceback.c ddtrace/internal/_rand.c
162-
{envpython} {toxinidir}/setup.py develop
161+
commands_pre={envpython} {toxinidir}/setup.py develop
163162
usedevelop =
164163
# do not use develop mode with celery as running multiple python versions within
165164
# same job will cause problem for tests that use ddtrace-run

0 commit comments

Comments
 (0)