Skip to content

Commit

Permalink
Decommission python client generator (#15486)
Browse files Browse the repository at this point in the history
* decomission python client generator

* udpate

* update doc
  • Loading branch information
wing328 authored May 14, 2023
1 parent cc2dc65 commit 780d266
Show file tree
Hide file tree
Showing 2,460 changed files with 7 additions and 307,868 deletions.
6 changes: 3 additions & 3 deletions CI/circle_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ elif [ "$NODE_INDEX" = "3" ]; then
#sudo make altinstall
pyenv install --list
pyenv install 3.7.12
pyenv install 2.7.14
#pyenv install 2.7.14 #python2 no longer supported
pyenv global 3.7.12

# Install node@stable (for angular 6)
Expand All @@ -78,10 +78,10 @@ elif [ "$NODE_INDEX" = "4" ]; then
echo "Running node $NODE_INDEX to test 'samples.circleci.node4' defined in pom.xml ..."

#mvn --no-snapshot-updates --quiet verify -Psamples.circleci.node4 -Dorg.slf4j.simpleLogger.defaultLogLevel=error
(cd samples/openapi3/client/petstore/python && make test)
#(cd samples/openapi3/client/petstore/python && make test)
# comment out due to ModuleNotFoundError: No module named 'urllib3.request'
#(cd samples/openapi3/client/petstore/python-prior && make test)
(cd samples/openapi3/client/3_0_3_unit_test/python && make test)
#(cd samples/openapi3/client/3_0_3_unit_test/python && make test)

else
echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..."
Expand Down
6 changes: 0 additions & 6 deletions bin/configs/python-features-dynamic-servers.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions bin/configs/python.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions bin/configs/python_3_0_3_unit_test.yaml

This file was deleted.

1 change: 0 additions & 1 deletion docs/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ The following generators are available:
* [php](generators/php.md)
* [php-dt (beta)](generators/php-dt.md)
* [powershell (beta)](generators/powershell.md)
* [python](generators/python.md)
* [python-nextgen](generators/python-nextgen.md)
* [r](generators/r.md)
* [ruby](generators/ruby.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import org.openapitools.codegen.api.TemplatingEngineAdapter;
import org.openapitools.codegen.config.GlobalSettings;
import org.openapitools.codegen.examples.ExampleGenerator;
import org.openapitools.codegen.languages.PythonClientCodegen;
import org.openapitools.codegen.languages.RustServerCodegen;
import org.openapitools.codegen.meta.FeatureSet;
import org.openapitools.codegen.meta.GeneratorMetadata;
Expand Down Expand Up @@ -651,9 +650,7 @@ public Map<String, ModelsMap> updateAllModels(Map<String, ModelsMap> objs) {
removeSelfReferenceImports(cm);

if (!this.getLegacyDiscriminatorBehavior()) {
// skip cleaning up mapped models for python client generator
// which uses its own logic
cm.addDiscriminatorMappedModelsImports(!(this instanceof PythonClientCodegen));
cm.addDiscriminatorMappedModelsImports(true);
}
}
}
Expand Down Expand Up @@ -3777,14 +3774,13 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo

Schema original = null;
// check if it's allOf (only 1 sub schema) with or without default/nullable/etc set in the top level
if (ModelUtils.isAllOf(p) && p.getAllOf().size() == 1 && !(this instanceof PythonClientCodegen)) {
if (ModelUtils.isAllOf(p) && p.getAllOf().size() == 1) {
if (p.getAllOf().get(0) instanceof Schema) {
original = p;
p = (Schema) p.getAllOf().get(0);
} else {
LOGGER.error("Unknown type in allOf schema. Please report the issue via openapi-generator's Github issue tracker.");
}

}

CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.openapitools.codegen.api.TemplatingEngineAdapter;
import org.openapitools.codegen.api.TemplateFileType;
import org.openapitools.codegen.ignore.CodegenIgnoreProcessor;
import org.openapitools.codegen.languages.PythonClientCodegen;
import org.openapitools.codegen.meta.GeneratorMetadata;
import org.openapitools.codegen.meta.Stability;
import org.openapitools.codegen.model.ApiInfoMap;
Expand Down Expand Up @@ -546,9 +545,8 @@ void generateModels(List<File> files, List<ModelMap> allModels, List<String> unu
ModelMap modelTemplate = modelList.get(0);
if (modelTemplate != null && modelTemplate.getModel() != null) {
CodegenModel m = modelTemplate.getModel();
if (m.isAlias && !(config instanceof PythonClientCodegen)) {
if (m.isAlias) {
// alias to number, string, enum, etc, which should not be generated as model
// for PythonClientCodegen, all aliases are generated as models
continue; // Don't create user-defined classes for aliases
}
}
Expand Down
Loading

0 comments on commit 780d266

Please sign in to comment.