Skip to content

Commit

Permalink
basic generaiton possible from autorest with script files moved to pygen
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft committed May 13, 2024
1 parent c0367d4 commit 93ea493
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/autorest.python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "The Python extension for generators in AutoRest.",
"scripts": {
"prepare": "node ./node_modules/@azure-tools/python-client-generator-core/run-python3.js ./node_modules/@azure-tools/python-client-generator-core/prepare.py",
"start": "node ./node_modules/@azure-tools/python-client-generator-core/run-python3.js ./node_modules/@azure-tools/python-client-generator-core/start.py",
"start": "node ./node_modules/@azure-tools/python-client-generator-core/run-python3.js start.py",
"install": "node ./node_modules/@azure-tools/python-client-generator-core/run-python3.js ./node_modules/@azure-tools/python-client-generator-core/install.py",
"debug": "node r./node_modules/@azure-tools/python-client-generator-core/un-python3.js ./node_modules/@azure-tools/python-client-generator-core/start.py --debug"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pathlib import Path
import venv

from venvtools import python_run
from pygen.utils.venvtools import python_run

_ROOT_DIR = Path(__file__).parent

Expand Down
2 changes: 1 addition & 1 deletion packages/pygen/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import subprocess
from pathlib import Path

from venvtools import ExtendedEnvBuilder, python_run
from pygen.utils.venvtools import ExtendedEnvBuilder, python_run

_ROOT_DIR = Path(__file__).parent

Expand Down
1 change: 0 additions & 1 deletion packages/pygen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"setup.py",
"install.py",
"prepare.py",
"start.py",
"venvtools.py",
"run-python3.js",
"requirements.txt",
Expand Down
2 changes: 1 addition & 1 deletion packages/pygen/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from pathlib import Path
import venv

from venvtools import python_run
from pygen.utils.venvtools import python_run

_ROOT_DIR = Path(__file__).parent

Expand Down
2 changes: 1 addition & 1 deletion packages/pygen/pygen/black/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from black.report import NothingChanged

from .. import Plugin
from .._utils import parse_args
from ..utils import parse_args

_LOGGER = logging.getLogger("blib2to3")

Expand Down
2 changes: 1 addition & 1 deletion packages/pygen/pygen/codegen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


from .. import Plugin
from .._utils import parse_args
from ..utils import parse_args
from .models.code_model import CodeModel
from .serializers import JinjaSerializer
from ._utils import DEFAULT_HEADER_TEXT, VALID_PACKAGE_MODE, TYPESPEC_PACKAGE_MODE
Expand Down
2 changes: 1 addition & 1 deletion packages/pygen/pygen/codegen/serializers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from .sample_serializer import SampleSerializer
from .test_serializer import TestSerializer, TestGeneralSerializer
from .types_serializer import TypesSerializer
from ..._utils import to_snake_case
from ...utils import to_snake_case
from .._utils import VALID_PACKAGE_MODE
from .utils import (
extract_sample_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from .parameter_serializer import ParameterSerializer, PopKwargType
from ..models.parameter_list import ParameterType
from . import utils
from ..._utils import JSON_REGEXP
from ...utils import JSON_REGEXP

T = TypeVar("T")
OrderedSet = Dict[T, None]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from . import utils
from ..models import Client, ParameterMethodLocation
from .parameter_serializer import ParameterSerializer, PopKwargType
from ..._utils import build_policies
from ...utils import build_policies


class ClientSerializer:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
FileImport,
)
from .utils import get_namespace_config, get_namespace_from_package_name
from ..._utils import to_snake_case
from ...utils import to_snake_case

_LOGGER = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion packages/pygen/pygen/m2r/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import m2r2

from .. import YamlUpdatePlugin
from .._utils import parse_args
from ..utils import parse_args


_LOGGER = logging.getLogger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions packages/pygen/pygen/preprocess/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import copy
from typing import Callable, Dict, Any, List, Optional

from .._utils import to_snake_case
from ..utils import to_snake_case
from .helpers import (
add_redefined_builtin_info,
pad_builtin_namespaces,
Expand All @@ -17,7 +17,7 @@
from .python_mappings import CADL_RESERVED_WORDS, RESERVED_WORDS, PadType

from .. import YamlUpdatePlugin
from .._utils import parse_args, get_body_type_for_description, JSON_REGEXP, KNOWN_TYPES
from ..utils import parse_args, get_body_type_for_description, JSON_REGEXP, KNOWN_TYPES


def update_overload_section(
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/pygen/run_tsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import venv
import logging
from pathlib import Path
from venvtools import python_run
from pygen.utils.venvtools import python_run

_ROOT_DIR = Path(__file__).parent

Expand Down

0 comments on commit 93ea493

Please sign in to comment.