Replace internal-only imports and comments that aren't valid externally.

PiperOrigin-RevId: 476492651
Change-Id: I310a21a73a65da3a5939f5cb8a1c8a67c8595863
This commit is contained in:
Saran Tunyasuvunakool
2022-09-23 16:58:09 -07:00
committed by Copybara-Service
parent 6acc111c48
commit b1a79aa01b
8 changed files with 22 additions and 28 deletions
+1 -1
View File
@@ -16,7 +16,7 @@
from absl.testing import absltest
from google3.third_party.mujoco.introspect import ast_nodes
from . import ast_nodes
class AstNodesTest(absltest.TestCase):
+4 -4
View File
@@ -15,7 +15,7 @@
"""Generates enums.py.
The JSON input can be generated via:
clang -Xclang -ast-dump=json -fsyntax-only -fparse-all-comments mujoco.h
clang -Xclang -ast-dump=json -fsyntax-only -fparse-all-comments -x c mujoco.h
"""
import json
@@ -24,8 +24,8 @@ from typing import Any, Mapping, Sequence
from absl import app
from absl import flags
from google3.third_party.mujoco.introspect import ast_nodes
from google3.third_party.mujoco.introspect.codegen import formatter
from introspect import ast_nodes
from . import formatter
FLAGS = flags.FLAGS
flags.DEFINE_string(
@@ -116,7 +116,7 @@ DO NOT EDIT. THIS FILE IS AUTOMATICALLY GENERATED.
from typing import Mapping
from google3.third_party.mujoco.introspect.ast_nodes import EnumDecl
from .ast_nodes import EnumDecl
ENUMS: Mapping[str, EnumDecl] = {enums_str}
'''.strip()) # `print` adds a trailing newline
+9 -9
View File
@@ -15,7 +15,7 @@
"""Generates functions.py.
The JSON input can be generated via:
clang -Xclang -ast-dump=json -fsyntax-only -fparse-all-comments mujoco.h
clang -Xclang -ast-dump=json -fsyntax-only -fparse-all-comments -x c mujoco.h
"""
import json
@@ -24,9 +24,9 @@ from typing import Any, Mapping, Sequence
from absl import app
from absl import flags
from google3.third_party.mujoco.introspect import ast_nodes
from google3.third_party.mujoco.introspect import type_parsing
from google3.third_party.mujoco.introspect.codegen import formatter
from introspect import ast_nodes
from introspect import type_parsing
from . import formatter
FLAGS = flags.FLAGS
flags.DEFINE_string('header_path', None, 'Path to the original mujoco.h')
@@ -145,11 +145,11 @@ DO NOT EDIT. THIS FILE IS AUTOMATICALLY GENERATED.
from typing import Mapping
from google3.third_party.mujoco.introspect.ast_nodes import ArrayType
from google3.third_party.mujoco.introspect.ast_nodes import FunctionDecl
from google3.third_party.mujoco.introspect.ast_nodes import FunctionParameterDecl
from google3.third_party.mujoco.introspect.ast_nodes import PointerType
from google3.third_party.mujoco.introspect.ast_nodes import ValueType
from .ast_nodes import ArrayType
from .ast_nodes import FunctionDecl
from .ast_nodes import FunctionParameterDecl
from .ast_nodes import PointerType
from .ast_nodes import ValueType
FUNCTIONS: Mapping[str, FunctionDecl] = {functions_str}
'''.strip()) # `print` adds a trailing newline
+1 -1
View File
@@ -16,7 +16,7 @@
from absl.testing import absltest
from google3.third_party.mujoco.introspect import enums
from . import enums
class EnumsTest(absltest.TestCase):
+3 -3
View File
@@ -16,9 +16,9 @@
from absl.testing import absltest
from google3.third_party.mujoco.introspect import ast_nodes
from google3.third_party.mujoco.introspect import functions
from google3.third_party.mujoco.introspect import type_parsing
from . import ast_nodes
from . import functions
from . import type_parsing
class FunctionsTest(absltest.TestCase):
+1 -1
View File
@@ -18,7 +18,7 @@ import collections
import re
from typing import Mapping, MutableSequence, Optional, Sequence, Tuple, Union
from google3.third_party.mujoco.introspect import ast_nodes
from . import ast_nodes
ARRAY_EXTENTS_PATTERN = re.compile(r'(\[[^\]]+\]\s*)+\Z')
ARRAY_N_PATTERN = re.compile(r'\[([^\]]+)\]')
+2 -2
View File
@@ -16,8 +16,8 @@
from absl.testing import absltest
from google3.third_party.mujoco.introspect import ast_nodes
from google3.third_party.mujoco.introspect import type_parsing
from . import ast_nodes
from . import type_parsing
class TypeParsingTest(absltest.TestCase):
+1 -7
View File
@@ -13,13 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""A script for running step_benchmark_test for a variety of build settings.
This is not meant to be run in google3, but in the git repository's root.
This will be used for release 2.1.1, and adapted for future use when more
decisions about the build need to be made.
"""
"""A script for running step_benchmark_test for a variety of build settings."""
import argparse
import os