Skip to content

Commit

Permalink
Replace word "master" everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Nov 28, 2024
1 parent 6d87d1c commit 2d35d29
Show file tree
Hide file tree
Showing 40 changed files with 107 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aio_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
python-version: ${{ matrix.version }}
allow-prereleases: true
cache: "pip"
- name: Install master
- name: Install main packages
run: |
pip install mypy_boto3_output/types_aiobotocore_package
pip install mypy_boto3_output/types_aioboto3_package
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/aio_sanity_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ jobs:
run: |
uv pip install boto3==${BOTO3_VERSION} botocore==${BOTOCORE_VERSION}
uv pip install -U aioboto3
- name: Build master packages
- name: Build main packages
run: |
rm -rf mypy_boto3_output/*
uv run mypy_boto3_builder mypy_boto3_output \
--product aioboto3 aiobotocore \
--no-smart-version
- name: Install master packages
- name: Install main packages
run: |
bash ./scripts/install_aiobotocore.sh master
bash ./scripts/install_aiobotocore.sh main
- name: Check s3 output
run: |
rm -rf mypy_boto3_output/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
python-version: ${{ matrix.version }}
allow-prereleases: true
cache: "pip"
- name: Install master
- name: Install main packages
run: |
pip install mypy_boto3_output/boto3_stubs_package
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sanity_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ jobs:
BOTOCORE_VERSION: ${{ needs.versions.outputs.botocore }}
run: |
uv pip install -U boto3==${BOTO3_VERSION} botocore==${BOTOCORE_VERSION}
- name: Build master packages
- name: Build main packages
run: |
rm -rf mypy_boto3_output/*
uv run mypy_boto3_builder mypy_boto3_output \
--product boto3 \
--no-smart-version
- name: Install master packages
- name: Install main packages
run: |
bash ./scripts/install.sh master
bash ./scripts/install.sh main
- name: Check s3 output
run: |
rm -rf mypy_boto3_output/*
Expand Down
2 changes: 1 addition & 1 deletion mypy_boto3_builder/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class TemplatePath:
Template paths.
"""

master: Final = TEMPLATES_PATH / "master"
mypy_boto3: Final = TEMPLATES_PATH / "mypy-boto3"

types_boto3: Final = TEMPLATES_PATH / "types-boto3"
types_boto3_docs: Final = TEMPLATES_PATH / "types-boto3-docs"
Expand Down
8 changes: 4 additions & 4 deletions mypy_boto3_builder/generators/aioboto3_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _get_postprocessor(self, service_package: ServicePackage) -> AioBoto3Postpro
"""
Get postprocessor for service package.
"""
return AioBoto3Postprocessor(service_package, self.master_service_names)
return AioBoto3Postprocessor(service_package, self.main_service_names)

def generate_stubs(self) -> list[Package]:
"""
Expand Down Expand Up @@ -74,7 +74,7 @@ def _generate_stubs(self) -> TypesAioBoto3Package | None:
self.logger.info(f"Generating {package_data.PYPI_NAME} {version}")
return process_types_aioboto3(
output_path=self.output_path,
service_names=self.master_service_names,
service_names=self.main_service_names,
generate_package=self.is_package(),
version=version,
static_files_path=self._get_static_files_path(),
Expand All @@ -91,15 +91,15 @@ def _generate_stubs_lite(self) -> TypesAioBoto3Package | None:
self.logger.info(f"Generating {package_data.PYPI_NAME} {version}")
return process_types_aioboto3_lite(
output_path=self.output_path,
service_names=self.master_service_names,
service_names=self.main_service_names,
generate_package=self.is_package(),
version=version,
static_files_path=self._get_static_files_path(),
)

def generate_docs(self) -> None:
"""
Generate service and master docs.
Generate service and main docs.
"""
package_data = TypesAioBoto3PackageData
total_str = f"{len(self.service_names)}"
Expand Down
8 changes: 4 additions & 4 deletions mypy_boto3_builder/generators/aiobotocore_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _get_postprocessor(self, service_package: ServicePackage) -> AioBotocorePost
"""
Get postprocessor for service package.
"""
return AioBotocorePostprocessor(service_package, self.master_service_names)
return AioBotocorePostprocessor(service_package, self.main_service_names)

def generate_stubs(self) -> list[Package]:
"""
Expand Down Expand Up @@ -80,7 +80,7 @@ def _generate_stubs(self) -> TypesAioBotocorePackage | None:
self.logger.info(f"Generating {package_data.PYPI_NAME} {version}")
return process_types_aiobotocore(
output_path=self.output_path,
service_names=self.master_service_names,
service_names=self.main_service_names,
generate_package=self.is_package(),
version=version,
static_files_path=self._get_static_files_path(),
Expand All @@ -97,15 +97,15 @@ def _generate_stubs_lite(self) -> TypesAioBotocorePackage | None:
self.logger.info(f"Generating {package_data.PYPI_NAME} {version}")
return process_types_aiobotocore_lite(
output_path=self.output_path,
service_names=self.master_service_names,
service_names=self.main_service_names,
generate_package=self.is_package(),
version=version,
static_files_path=self._get_static_files_path(),
)

def generate_docs(self) -> None:
"""
Generate service and master docs.
Generate service and main docs.
"""
package_data = TypesAioBotocorePackageData
total_str = f"{len(self.service_names)}"
Expand Down
8 changes: 4 additions & 4 deletions mypy_boto3_builder/generators/base_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class BaseGenerator(ABC):
Arguments:
service_names -- Selected service names
master_service_names -- Service names included in master
main_service_names -- Service names included in main
config -- CLI configuration
version -- Package build version
cleanup -- Whether to cleanup generated files
Expand All @@ -45,7 +45,7 @@ class BaseGenerator(ABC):
def __init__(
self,
service_names: Sequence[ServiceName],
master_service_names: Sequence[ServiceName],
main_service_names: Sequence[ServiceName],
config: CLINamespace,
version: str,
*,
Expand All @@ -56,7 +56,7 @@ def __init__(
self._downloaded_static_files_path: Path | None = None

self.service_names = service_names
self.master_service_names = master_service_names
self.main_service_names = main_service_names
self.config = config
self.logger = get_logger()
self.version = version or self._get_library_version()
Expand Down Expand Up @@ -203,7 +203,7 @@ def _generate_full_stubs_services(self, package: Package) -> None:
@abstractmethod
def generate_docs(self) -> None:
"""
Generate service and master docs.
Generate service and main docs.
"""

def generate_product(self, product_type: ProductType) -> None:
Expand Down
20 changes: 10 additions & 10 deletions mypy_boto3_builder/generators/boto3_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
MypyBoto3PackageData,
)
from mypy_boto3_builder.postprocessors.botocore import BotocorePostprocessor
from mypy_boto3_builder.structures.master_package import MasterPackage
from mypy_boto3_builder.structures.mypy_boto3_package import MypyBoto3Package
from mypy_boto3_builder.structures.package import Package
from mypy_boto3_builder.structures.service_package import ServicePackage
from mypy_boto3_builder.structures.types_boto3_package import TypesBoto3Package
from mypy_boto3_builder.writers.processors import (
process_master,
process_mypy_boto3,
process_types_boto3,
process_types_boto3_docs,
process_types_boto3_full,
Expand All @@ -45,9 +45,9 @@ def _get_postprocessor(self, service_package: ServicePackage) -> BotocorePostpro
"""
Get postprocessor for service package.
"""
return BotocorePostprocessor(service_package, self.master_service_names)
return BotocorePostprocessor(service_package, self.main_service_names)

def _generate_master(self) -> MasterPackage | None:
def _generate_mypy_boto3(self) -> MypyBoto3Package | None:
"""
Generate `mypy-boto3` package.
"""
Expand All @@ -59,9 +59,9 @@ def _generate_master(self) -> MasterPackage | None:
return None

self.logger.info(f"Generating {package_data.PYPI_NAME} {version}")
return process_master(
return process_mypy_boto3(
output_path=self.output_path,
service_names=self.master_service_names,
service_names=self.main_service_names,
version=version,
generate_package=self.is_package(),
)
Expand All @@ -83,7 +83,7 @@ def _generate_stubs(self) -> TypesBoto3Package | None:
self.logger.info(f"Generating {package_data.PYPI_NAME} {version}")
return process_types_boto3(
output_path=self.output_path,
service_names=self.master_service_names,
service_names=self.main_service_names,
generate_package=self.is_package(),
package_data=package_data,
version=version,
Expand All @@ -101,7 +101,7 @@ def _generate_stubs_lite(self) -> TypesBoto3Package | None:
self.logger.info(f"Generating {package_data.PYPI_NAME} {version}")
return process_types_boto3_lite(
output_path=self.output_path,
service_names=self.master_service_names,
service_names=self.main_service_names,
generate_package=self.is_package(),
package_data=package_data,
version=version,
Expand All @@ -120,7 +120,7 @@ def generate_stubs(self) -> list[Package]:
result.append(package)

if not self.is_package():
package = self._generate_master()
package = self._generate_mypy_boto3()
if package:
result.append(package)

Expand All @@ -137,7 +137,7 @@ def generate_stubs_lite(self) -> list[Package]:

def generate_docs(self) -> None:
"""
Generate service and master docs.
Generate service and docs.
"""
package_data = Boto3StubsPackageData
total_str = f"{len(self.service_names)}"
Expand Down
8 changes: 4 additions & 4 deletions mypy_boto3_builder/generators/types_boto3_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _get_postprocessor(self, service_package: ServicePackage) -> BotocorePostpro
"""
Get postprocessor for service package.
"""
return BotocorePostprocessor(service_package, self.master_service_names)
return BotocorePostprocessor(service_package, self.main_service_names)

def _get_static_files_path(self) -> Path:
return self._get_or_download_static_files_path(
Expand All @@ -61,7 +61,7 @@ def _generate_stubs(self) -> TypesBoto3Package | None:
self.logger.info(f"Generating {package_data.PYPI_NAME} {version}")
return process_types_boto3(
output_path=self.output_path,
service_names=self.master_service_names,
service_names=self.main_service_names,
generate_package=self.is_package(),
package_data=package_data,
version=version,
Expand All @@ -79,7 +79,7 @@ def _generate_stubs_lite(self) -> TypesBoto3Package | None:
self.logger.info(f"Generating {package_data.PYPI_NAME} {version}")
return process_types_boto3_lite(
output_path=self.output_path,
service_names=self.master_service_names,
service_names=self.main_service_names,
generate_package=self.is_package(),
package_data=package_data,
version=version,
Expand Down Expand Up @@ -107,7 +107,7 @@ def generate_stubs_lite(self) -> list[Package]:

def generate_docs(self) -> None:
"""
Generate service and master docs.
Generate service and main docs.
"""
package_data = TypesBoto3PackageData
total_str = f"{len(self.service_names)}"
Expand Down
2 changes: 1 addition & 1 deletion mypy_boto3_builder/import_helpers/import_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ImportString:
Wrapper for Python import strings.
Arguments:
master -- Master module name
parent -- Parent module name
parts -- Other import parts
Examples::
Expand Down
4 changes: 2 additions & 2 deletions mypy_boto3_builder/import_helpers/internal_import_record.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Helper for Python import strings with not set master module name.
Helper for Python import strings without parent module name.
Copyright 2024 Vlad Emelianov
"""
Expand All @@ -11,7 +11,7 @@

class InternalImportRecord(ImportRecord):
"""
Helper for Python import strings with not set master module name.
Helper for Python import strings without parent module name.
Arguments:
service_module_name -- Service module name.
Expand Down
10 changes: 5 additions & 5 deletions mypy_boto3_builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def generate_product(
product: Product,
args: CLINamespace,
service_names: Sequence[ServiceName],
master_service_names: Sequence[ServiceName],
main_service_names: Sequence[ServiceName],
) -> None:
"""
Generate a selected product.
Expand All @@ -136,13 +136,13 @@ def generate_product(
product -- Product to generate
args -- CLI namespace
service_names -- Selected service names
master_service_names -- Service names included in master
main_service_names -- Service names included in main
"""
generator = get_generator(
product,
{
"service_names": service_names,
"master_service_names": master_service_names,
"main_service_names": main_service_names,
"config": args,
"version": args.build_version,
"cleanup": True,
Expand Down Expand Up @@ -199,11 +199,11 @@ def run(args: CLINamespace) -> None:
return

service_names = get_selected_service_names(args.service_names, available_service_names)
master_service_names = service_names if args.partial_overload else available_service_names
main_service_names = service_names if args.partial_overload else available_service_names

for product in args.products:
logger.info(f"Generating {product} product")
generate_product(product, args, service_names, master_service_names)
generate_product(product, args, service_names, main_service_names)

logger.debug("Done!")

Expand Down
4 changes: 2 additions & 2 deletions mypy_boto3_builder/parsers/fake_service_package.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Fake parser that produces `structures.ServiceModule` for master module and stubs.
Fake parser that produces `structures.ServiceModule` for main module and stubs.
Copyright 2024 Vlad Emelianov
"""
Expand All @@ -23,7 +23,7 @@ def parse_fake_service_package(
"""
Create fake boto3 service module structure.
Used by stubs and master package.
Used by stubs and main package.
Arguments:
service_name -- Target service name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@
from mypy_boto3_builder.parsers.fake_service_package import parse_fake_service_package
from mypy_boto3_builder.parsers.resource_loader import ResourceLoader
from mypy_boto3_builder.service_name import ServiceName
from mypy_boto3_builder.structures.master_package import MasterPackage
from mypy_boto3_builder.structures.mypy_boto3_package import MypyBoto3Package
from mypy_boto3_builder.type_annotations.type_literal import TypeLiteral


def parse_master_package(
def parse_mypy_boto3_package(
service_names: Iterable[ServiceName],
version: str,
) -> MasterPackage:
) -> MypyBoto3Package:
"""
Parse data for master package.
Parse data for mypy-boto3 package.
Arguments:
service_names -- All available service names.
version -- Package version.
Returns:
MasterPackage structure.
MypyBoto3Package structure.
"""
result = MasterPackage(service_names=service_names, service_packages=[], version=version)
result = MypyBoto3Package(service_names=service_names, service_packages=[], version=version)
for service_name in result.service_names:
result.service_packages.append(
parse_fake_service_package(service_name, Boto3StubsPackageData, version),
Expand Down
Loading

0 comments on commit 2d35d29

Please sign in to comment.