Skip to content
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

Support Python codegen for the OpenAPI backend #21316

Merged
merged 21 commits into from
Dec 22, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
One test works
  • Loading branch information
grihabor committed Aug 17, 2024
commit 22d4f6aa14efbef1e42769434e9ecec53e961ede
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

from __future__ import annotations

from pants.core.util_rules.config_files import rules as config_files_rules
from typing import Iterable

import pytest

from pants.backend.openapi.codegen.python.generate import GeneratePythonFromOpenAPIRequest
from pants.backend.openapi.codegen.python.generate import rules as generate_rules
from pants.backend.openapi.codegen.python.rules import rules as python_codegen_rules
from pants.backend.openapi.sample.resources import PETSTORE_SAMPLE_SPEC
from pants.backend.openapi.target_types import (
Expand All @@ -22,7 +22,6 @@
from pants.backend.openapi.target_types import rules as target_types_rules
from pants.backend.openapi.util_rules import openapi_bundle
from pants.backend.python.register import rules as python_backend_rules
from pants.core.goals.test import rules as core_test_rules
from pants.engine.addresses import Address, Addresses
from pants.engine.target import (
DependenciesRequest,
Expand All @@ -32,6 +31,8 @@
)
from pants.testutil.rule_runner import PYTHON_BOOTSTRAP_ENV, QueryRule, RuleRunner

from pants.core.goals.test import rules as test_rules


@pytest.fixture
def rule_runner() -> RuleRunner:
Expand All @@ -44,10 +45,10 @@ def rule_runner() -> RuleRunner:
OpenApiDocumentGeneratorTarget,
],
rules=[
*core_test_rules(),
*test_rules(),
*config_files_rules(),
*python_backend_rules(),
*python_codegen_rules(),
*generate_rules(),
*openapi_bundle.rules(),
*target_types_rules(),
QueryRule(HydratedSources, (HydrateSourcesRequest,)),
Expand Down