-
Notifications
You must be signed in to change notification settings - Fork 812
Make TorchText installable from direct reference #1154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In order to make `pip install https://github.com/pytorch/text` succeed `setup.py` should have logic to initialize submodules Add `check_submodules()` routine to setup.py to check if 'third_party/re2/CMakeLists.txt' is present on the filesystem and attempt to initialize submodules if it is not
3036a2b
to
26ffbe5
Compare
third_party_dir = ROOT_DIR / 'third_party' | ||
if not (third_party_dir / 're2' / 'CMakeFiles.txt').exists(): | ||
print(' --- third_party/re2/CMakeFiles.txt do not exist, trying to init submodules') | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PyTorch fails and asks the user to do it manually. I worry that this might cause issues when someone wants to debug / modify the submodules and then subsequently runs setup.py. Are there similar plans for PyTorch as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpuhrsch yes, I plan to make similar change for pytorch as well, although Pytorch is less likely to be built directly from source (building TorchText using direct link takes less than 15 min, whereas for PyTorch, especially with GPU support will likely to take more than an hour)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the context of this work? Are we going to do the same for torchaudio (which I support)?
This commit adds `git` submodule initialization commands at the beginning of setup, so that third party modules become available automatically. This makes it possible to install torchtext with a command like `pip install --no-use-pep517 git+https://github.com/pytorch/text.git` See also: - pytorch#1154 - pytorch/audio#1966
* Automatically initialize submodule This commit adds `git` submodule initialization commands at the beginning of setup, so that third party modules become available automatically. This makes it possible to install torchtext with a command like `pip install --no-use-pep517 git+https://github.com/pytorch/text.git` See also: - #1154 - pytorch/audio#1966
In order to make
pip install https://github.com/pytorch/text
succeedsetup.py
should have logic to initialize submodulesAdd
check_submodules()
routine to setup.py to check if'third_party/re2/CMakeLists.txt' is present on the filesystem and
attempt to initialize submodules if it is not