Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .circleci/unittest/linux/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ printf "Installing torchdata nightly\n"
pip install --pre torchdata --extra-index-url https://download.pytorch.org/whl/nightly/cpu

printf "* Installing torchtext\n"
git submodule update --init --recursive
python setup.py develop

printf "* Installing parameterized\n"
Expand Down
1 change: 0 additions & 1 deletion .circleci/unittest/windows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ curl --output pywin32_postinstall.py https://raw.githubusercontent.com/mhammond/
python pywin32_postinstall.py -install

printf "* Installing torchtext\n"
git submodule update --init --recursive
"$root_dir/packaging/vc_env_helper.bat" python setup.py develop

printf "* Installing parameterized\n"
Expand Down
3 changes: 0 additions & 3 deletions packaging/torchtext/bld.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@echo off

git submodule update --init --recursive
if errorlevel 1 exit /b 1

python setup.py install --single-version-externally-managed --record=record.txt
if errorlevel 1 exit /b 1
1 change: 0 additions & 1 deletion packaging/torchtext/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env bash
set -ex

git submodule update --init --recursive
python setup.py install --single-version-externally-managed --record=record.txt
14 changes: 14 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import shutil
import subprocess
import sys
from pathlib import Path

from build_tools import setup_helpers
Expand Down Expand Up @@ -44,6 +45,18 @@ def _export_version(version, sha):
fileobj.write("git_version = {}\n".format(repr(sha)))


def _init_submodule():
print(" --- Initializing submodules")
try:
subprocess.check_call(["git", "submodule", "init"])
subprocess.check_call(["git", "submodule", "update"])
except Exception:
print(" --- Submodule initalization failed")
print("Please run:\n\tgit submodule update --init --recursive")
sys.exit(1)
print(" --- Initialized submodule")


VERSION, SHA = _get_version()
_export_version(VERSION, SHA)

Expand Down Expand Up @@ -76,6 +89,7 @@ def run(self):
shutil.rmtree(str(path), ignore_errors=True)


_init_submodule()
setup_info = dict(
# Metadata
name="torchtext",
Expand Down