spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

Spacy Projects: Directories are created before vars interpolation

Open polkaYK opened this issue 3 years ago • 3 comments

This may not be a bug per se, but I was a bit surprised by the behavior.

I discovered that directories are created before variable interpolation in a spacy project, so you can't have something like

directories: [
  "cfg",
  "${vars.lang}_model",
]

I searched the code and found this place: https://github.com/explosion/spaCy/blob/8ffff18ac4e6a1d4fdae76dd7a9ecdf251b149fa/spacy/cli/_util.py#L161-L170 I swapped these two code blocks and it still worked, at least in my small project. But maybe there are concerns that prevent you from doing this. So, are you just not supposed to create directories with variable interpolation because of some reason or the order of these code blocks can be swapped?

polkaYK avatar Jul 27 '22 22:07 polkaYK

Thanks for the report, I think we just didn't consider interpolation in the directory names. I don't think there's any particular reason these blocks couldn't be swapped.

adrianeboyd avatar Aug 03 '22 07:08 adrianeboyd

I would like to take care of this issue

AhmedIssa11 avatar Aug 25 '22 00:08 AhmedIssa11

@AhmedIssa11 Sure, we'd be happy to review a PR for this!

adrianeboyd avatar Aug 25 '22 06:08 adrianeboyd

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Jan 06 '23 00:01 github-actions[bot]