You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am currently using hatch in a project with hatch-cython to compile parts of it. I have been able to set up the hatch-cython hook such that it compiles the files I desire and excludes some (using its exclude option) like
Above I exclude the .py files because I will instead have compiled .pyd files. I then tell it not to exclude my_file.py because I do not have a compiled version of it from cython.
This seems to work correctly and if I hatch build and then pip install --target my_pkg my_pkg.whl then I can see it builds the wheel as I specify.
On the other hand, when I run in a test environment and it installs the package in development mode, only the compiled pyd files are included and my_file.py is not in the installed directory C:\Users\<user>\AppData\Local\hatch\env\virtual\my_pkg\<id>\test\Lib\site-packages\my_pkg.
Note that if I add dev-mode = false in tool.hatch.envs.test then it builds correctly (I suppose because it is building from the wheel instead). How, then, is the package built in development mode and how come it is not following the exclude rules I set for the wheel? I notice that it still seems to trigger the cython hook I setup for wheel and generates the files correctly (i.e it is compiling everything except my_file.py).
I might update with a minimum reproducible example later if it helps but if anyone even has some info on exactly how dev builds are set up that would be useful info.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am currently using hatch in a project with hatch-cython to compile parts of it. I have been able to set up the hatch-cython hook such that it compiles the files I desire and excludes some (using its
exclude
option) likeThen I can choose which are excluded when I build the wheel
Above I exclude the .py files because I will instead have compiled .pyd files. I then tell it not to exclude
my_file.py
because I do not have a compiled version of it from cython.This seems to work correctly and if I
hatch build
and thenpip install --target my_pkg my_pkg.whl
then I can see it builds the wheel as I specify.On the other hand, when I run in a test environment and it installs the package in development mode, only the compiled pyd files are included and
my_file.py
is not in the installed directoryC:\Users\<user>\AppData\Local\hatch\env\virtual\my_pkg\<id>\test\Lib\site-packages\my_pkg
.Some related config for my test env
Note that if I add
dev-mode = false
intool.hatch.envs.test
then it builds correctly (I suppose because it is building from the wheel instead). How, then, is the package built in development mode and how come it is not following the exclude rules I set for the wheel? I notice that it still seems to trigger the cython hook I setup for wheel and generates the files correctly (i.e it is compiling everything exceptmy_file.py
).I might update with a minimum reproducible example later if it helps but if anyone even has some info on exactly how dev builds are set up that would be useful info.
Beta Was this translation helpful? Give feedback.
All reactions