[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues - #4992

Merged
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample
Jan 21, 2020
Merged

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues#4992
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample

Conversation

@sebastien-rosset

@sebastien-rossetsebastien-rosset commented Jan 13, 2020

Copy link
Copy Markdown
Contributor
  1. Add openapiv3 samples for Python experimental.
  2. Fix PEP8 python formatting issues (line too long) which was observed when generating python-experimental against the openapiv3 test spec.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@spacether

Copy link
Copy Markdown
Contributor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset this looks good, thanks for creating it!
Can you add

What is the reason for the first line of the Makefile to be?

#!/bin/bash

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.
https://stackoverflow.com/questions/7123241/makefile-as-an-executable-script-with-shebang

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

I will remove it and check.

Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

It looks like a couple other files are missing, I am adding them:

bash ./test_python2_and_3.sh
bash: ./test_python2_and_3.sh: No such file or directory

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Getting formatting issues:

petstore_api/api/fake_api.py:622:100: E501 line too long (115 > 99 characters)
kwargs['file_schema_test_class_file_schema_test_class'] = file_schema_test_class_file_schema_test_class
^
petstore_api/api/fake_api.py:654:100: E501 line too long (115 > 99 characters)
'file_schema_test_class_file_schema_test_class': (file_schema_test_class.FileSchemaTestClass,),
^
petstore_api/models/enum_test.py:46:100: E501 line too long (106 > 99 characters)
outer_enum_integer_default_value = sys.modules['petstore_api.models.outer_enum_integer_default_value']
^
Makefile:19: recipe for target 'test-all' failed

I will update the python template to fix.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I also had to add # noqa: E501 in a couple lines in the python api.template because the generated line is too long in openapi3.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

@spacether

spacether commented Jan 15, 2020

Copy link
Copy Markdown
Contributor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

That is a great question. I don't know. My suggestion is to ask on Slack because the maintainers are the most responsive there. If any actions come out of it, then maybe making a feature request to capture it would be a traceable way to track it.

My hope is that in the future this can replace the python generator or we can port a bunch of these features into it. We are allowed to make breaking changes on these experimental generators which means we can make progress quickly and aggressively refactor but I don't know what our plan is going forward.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, the CircleCi failure is an unrelated Maven issue

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

This looks good, the CircleCi failure is an unrelated Maven issue

thanks. I saw the Maven issue you have raised.

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

Are all maven issues resolved?

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.codehaus.groovy:groovy-all:2.5.7.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.5.7/groovy-all-2.5.7.pom'. Received status code 501 from server: HTTPS Required
> Could not resolve io.github.http-builder-ng:http-builder-ng-core:1.0.3.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/io/github/http-builder-ng/http-builder-ng-core/1.0.3/http-builder-ng-core-1.0.3.pom'. Received status code 501 from server: HTTPS Required

I see the following error in this build, but I have synced from master. There are still many instances of "http://maven" in master.

grep -r "http://" . |grep maven

@spacether

Copy link
Copy Markdown
Contributor

My PR was an attempt at a maven fix. But I don't know Maven so they may still be unresolved.

@spacether

Copy link
Copy Markdown
Contributor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

thanks. One thing I don't understand is I committed a change this morning, after syncing from master (which has the maven fix). But it still failed with "http" connection to maven.

Add python-experimental-openapiv3-sample
Add missing files for the Python samples
Add python-experimental-petstore.bat for openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3. Address review comments
add missing files for test purpose
fix python formatting issues
fix python formatting issues
fix python formatting issues
Fix unit tests
fix python formatting issues
fix python formatting issues
fix python formatting issues
fix 'line too long' pep8 error
address PR comments for pep8 'line too long' problem
regenerate samples
execute samples scripts
dummy commit to retrigger circleci
Revert dummy commit, it didn't help.
@sebastien-rosset
sebastien-rossetforce-pushed the python-experimental-openapiv3-sample branch from 0d399dc to b381972CompareJanuary 17, 2020 00:51
@sebastien-rossetsebastien-rosset changed the title [Python] Add python experimental openapiv3 sample[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issuesJan 17, 2020
@spacether

Copy link
Copy Markdown
Contributor

I am looking forward to approving this, just waiting on the CI tests to pass.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I am looking forward to approving this, just waiting on the CI tests to pass.

Build is successful now. There were unrelated issues with circleCI, Jim and I fixed the issues.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Thank you!

@wing328wing328 added this to the 4.2.3 milestone Jan 31, 2020
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset restored the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sebastien-rosset@spacether@wing328
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues - #4992

Merged
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample
Jan 21, 2020
Merged

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues#4992
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample

Conversation

@sebastien-rosset

@sebastien-rossetsebastien-rosset commented Jan 13, 2020

Copy link
Copy Markdown
Contributor
  1. Add openapiv3 samples for Python experimental.
  2. Fix PEP8 python formatting issues (line too long) which was observed when generating python-experimental against the openapiv3 test spec.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@spacether

Copy link
Copy Markdown
Contributor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset this looks good, thanks for creating it!
Can you add

What is the reason for the first line of the Makefile to be?

#!/bin/bash

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.
https://stackoverflow.com/questions/7123241/makefile-as-an-executable-script-with-shebang

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

I will remove it and check.

Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

It looks like a couple other files are missing, I am adding them:

bash ./test_python2_and_3.sh
bash: ./test_python2_and_3.sh: No such file or directory

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Getting formatting issues:

petstore_api/api/fake_api.py:622:100: E501 line too long (115 > 99 characters)
kwargs['file_schema_test_class_file_schema_test_class'] = file_schema_test_class_file_schema_test_class
^
petstore_api/api/fake_api.py:654:100: E501 line too long (115 > 99 characters)
'file_schema_test_class_file_schema_test_class': (file_schema_test_class.FileSchemaTestClass,),
^
petstore_api/models/enum_test.py:46:100: E501 line too long (106 > 99 characters)
outer_enum_integer_default_value = sys.modules['petstore_api.models.outer_enum_integer_default_value']
^
Makefile:19: recipe for target 'test-all' failed

I will update the python template to fix.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I also had to add # noqa: E501 in a couple lines in the python api.template because the generated line is too long in openapi3.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

@spacether

spacether commented Jan 15, 2020

Copy link
Copy Markdown
Contributor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

That is a great question. I don't know. My suggestion is to ask on Slack because the maintainers are the most responsive there. If any actions come out of it, then maybe making a feature request to capture it would be a traceable way to track it.

My hope is that in the future this can replace the python generator or we can port a bunch of these features into it. We are allowed to make breaking changes on these experimental generators which means we can make progress quickly and aggressively refactor but I don't know what our plan is going forward.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, the CircleCi failure is an unrelated Maven issue

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

This looks good, the CircleCi failure is an unrelated Maven issue

thanks. I saw the Maven issue you have raised.

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

Are all maven issues resolved?

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.codehaus.groovy:groovy-all:2.5.7.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.5.7/groovy-all-2.5.7.pom'. Received status code 501 from server: HTTPS Required
> Could not resolve io.github.http-builder-ng:http-builder-ng-core:1.0.3.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/io/github/http-builder-ng/http-builder-ng-core/1.0.3/http-builder-ng-core-1.0.3.pom'. Received status code 501 from server: HTTPS Required

I see the following error in this build, but I have synced from master. There are still many instances of "http://maven" in master.

grep -r "http://" . |grep maven

@spacether

Copy link
Copy Markdown
Contributor

My PR was an attempt at a maven fix. But I don't know Maven so they may still be unresolved.

@spacether

Copy link
Copy Markdown
Contributor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

thanks. One thing I don't understand is I committed a change this morning, after syncing from master (which has the maven fix). But it still failed with "http" connection to maven.

Add python-experimental-openapiv3-sample
Add missing files for the Python samples
Add python-experimental-petstore.bat for openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3. Address review comments
add missing files for test purpose
fix python formatting issues
fix python formatting issues
fix python formatting issues
Fix unit tests
fix python formatting issues
fix python formatting issues
fix python formatting issues
fix 'line too long' pep8 error
address PR comments for pep8 'line too long' problem
regenerate samples
execute samples scripts
dummy commit to retrigger circleci
Revert dummy commit, it didn't help.
@sebastien-rosset
sebastien-rossetforce-pushed the python-experimental-openapiv3-sample branch from 0d399dc to b381972CompareJanuary 17, 2020 00:51
@sebastien-rossetsebastien-rosset changed the title [Python] Add python experimental openapiv3 sample[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issuesJan 17, 2020
@spacether

Copy link
Copy Markdown
Contributor

I am looking forward to approving this, just waiting on the CI tests to pass.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I am looking forward to approving this, just waiting on the CI tests to pass.

Build is successful now. There were unrelated issues with circleCI, Jim and I fixed the issues.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Thank you!

@wing328wing328 added this to the 4.2.3 milestone Jan 31, 2020
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset restored the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sebastien-rosset@spacether@wing328
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues - #4992

Merged
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample
Jan 21, 2020
Merged

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues#4992
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample

Conversation

@sebastien-rosset

@sebastien-rossetsebastien-rosset commented Jan 13, 2020

Copy link
Copy Markdown
Contributor
  1. Add openapiv3 samples for Python experimental.
  2. Fix PEP8 python formatting issues (line too long) which was observed when generating python-experimental against the openapiv3 test spec.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@spacether

Copy link
Copy Markdown
Contributor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset this looks good, thanks for creating it!
Can you add

What is the reason for the first line of the Makefile to be?

#!/bin/bash

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.
https://stackoverflow.com/questions/7123241/makefile-as-an-executable-script-with-shebang

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

I will remove it and check.

Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

It looks like a couple other files are missing, I am adding them:

bash ./test_python2_and_3.sh
bash: ./test_python2_and_3.sh: No such file or directory

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Getting formatting issues:

petstore_api/api/fake_api.py:622:100: E501 line too long (115 > 99 characters)
kwargs['file_schema_test_class_file_schema_test_class'] = file_schema_test_class_file_schema_test_class
^
petstore_api/api/fake_api.py:654:100: E501 line too long (115 > 99 characters)
'file_schema_test_class_file_schema_test_class': (file_schema_test_class.FileSchemaTestClass,),
^
petstore_api/models/enum_test.py:46:100: E501 line too long (106 > 99 characters)
outer_enum_integer_default_value = sys.modules['petstore_api.models.outer_enum_integer_default_value']
^
Makefile:19: recipe for target 'test-all' failed

I will update the python template to fix.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I also had to add # noqa: E501 in a couple lines in the python api.template because the generated line is too long in openapi3.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

@spacether

spacether commented Jan 15, 2020

Copy link
Copy Markdown
Contributor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

That is a great question. I don't know. My suggestion is to ask on Slack because the maintainers are the most responsive there. If any actions come out of it, then maybe making a feature request to capture it would be a traceable way to track it.

My hope is that in the future this can replace the python generator or we can port a bunch of these features into it. We are allowed to make breaking changes on these experimental generators which means we can make progress quickly and aggressively refactor but I don't know what our plan is going forward.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, the CircleCi failure is an unrelated Maven issue

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

This looks good, the CircleCi failure is an unrelated Maven issue

thanks. I saw the Maven issue you have raised.

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

Are all maven issues resolved?

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.codehaus.groovy:groovy-all:2.5.7.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.5.7/groovy-all-2.5.7.pom'. Received status code 501 from server: HTTPS Required
> Could not resolve io.github.http-builder-ng:http-builder-ng-core:1.0.3.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/io/github/http-builder-ng/http-builder-ng-core/1.0.3/http-builder-ng-core-1.0.3.pom'. Received status code 501 from server: HTTPS Required

I see the following error in this build, but I have synced from master. There are still many instances of "http://maven" in master.

grep -r "http://" . |grep maven

@spacether

Copy link
Copy Markdown
Contributor

My PR was an attempt at a maven fix. But I don't know Maven so they may still be unresolved.

@spacether

Copy link
Copy Markdown
Contributor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

thanks. One thing I don't understand is I committed a change this morning, after syncing from master (which has the maven fix). But it still failed with "http" connection to maven.

Add python-experimental-openapiv3-sample
Add missing files for the Python samples
Add python-experimental-petstore.bat for openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3. Address review comments
add missing files for test purpose
fix python formatting issues
fix python formatting issues
fix python formatting issues
Fix unit tests
fix python formatting issues
fix python formatting issues
fix python formatting issues
fix 'line too long' pep8 error
address PR comments for pep8 'line too long' problem
regenerate samples
execute samples scripts
dummy commit to retrigger circleci
Revert dummy commit, it didn't help.
@sebastien-rosset
sebastien-rossetforce-pushed the python-experimental-openapiv3-sample branch from 0d399dc to b381972CompareJanuary 17, 2020 00:51
@sebastien-rossetsebastien-rosset changed the title [Python] Add python experimental openapiv3 sample[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issuesJan 17, 2020
@spacether

Copy link
Copy Markdown
Contributor

I am looking forward to approving this, just waiting on the CI tests to pass.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I am looking forward to approving this, just waiting on the CI tests to pass.

Build is successful now. There were unrelated issues with circleCI, Jim and I fixed the issues.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Thank you!

@wing328wing328 added this to the 4.2.3 milestone Jan 31, 2020
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset restored the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sebastien-rosset@spacether@wing328
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues - #4992

Merged
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample
Jan 21, 2020
Merged

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues#4992
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample

Conversation

@sebastien-rosset

@sebastien-rossetsebastien-rosset commented Jan 13, 2020

Copy link
Copy Markdown
Contributor
  1. Add openapiv3 samples for Python experimental.
  2. Fix PEP8 python formatting issues (line too long) which was observed when generating python-experimental against the openapiv3 test spec.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@spacether

Copy link
Copy Markdown
Contributor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset this looks good, thanks for creating it!
Can you add

What is the reason for the first line of the Makefile to be?

#!/bin/bash

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.
https://stackoverflow.com/questions/7123241/makefile-as-an-executable-script-with-shebang

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

I will remove it and check.

Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

It looks like a couple other files are missing, I am adding them:

bash ./test_python2_and_3.sh
bash: ./test_python2_and_3.sh: No such file or directory

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Getting formatting issues:

petstore_api/api/fake_api.py:622:100: E501 line too long (115 > 99 characters)
kwargs['file_schema_test_class_file_schema_test_class'] = file_schema_test_class_file_schema_test_class
^
petstore_api/api/fake_api.py:654:100: E501 line too long (115 > 99 characters)
'file_schema_test_class_file_schema_test_class': (file_schema_test_class.FileSchemaTestClass,),
^
petstore_api/models/enum_test.py:46:100: E501 line too long (106 > 99 characters)
outer_enum_integer_default_value = sys.modules['petstore_api.models.outer_enum_integer_default_value']
^
Makefile:19: recipe for target 'test-all' failed

I will update the python template to fix.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I also had to add # noqa: E501 in a couple lines in the python api.template because the generated line is too long in openapi3.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

@spacether

spacether commented Jan 15, 2020

Copy link
Copy Markdown
Contributor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

That is a great question. I don't know. My suggestion is to ask on Slack because the maintainers are the most responsive there. If any actions come out of it, then maybe making a feature request to capture it would be a traceable way to track it.

My hope is that in the future this can replace the python generator or we can port a bunch of these features into it. We are allowed to make breaking changes on these experimental generators which means we can make progress quickly and aggressively refactor but I don't know what our plan is going forward.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, the CircleCi failure is an unrelated Maven issue

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

This looks good, the CircleCi failure is an unrelated Maven issue

thanks. I saw the Maven issue you have raised.

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

Are all maven issues resolved?

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.codehaus.groovy:groovy-all:2.5.7.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.5.7/groovy-all-2.5.7.pom'. Received status code 501 from server: HTTPS Required
> Could not resolve io.github.http-builder-ng:http-builder-ng-core:1.0.3.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/io/github/http-builder-ng/http-builder-ng-core/1.0.3/http-builder-ng-core-1.0.3.pom'. Received status code 501 from server: HTTPS Required

I see the following error in this build, but I have synced from master. There are still many instances of "http://maven" in master.

grep -r "http://" . |grep maven

@spacether

Copy link
Copy Markdown
Contributor

My PR was an attempt at a maven fix. But I don't know Maven so they may still be unresolved.

@spacether

Copy link
Copy Markdown
Contributor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

thanks. One thing I don't understand is I committed a change this morning, after syncing from master (which has the maven fix). But it still failed with "http" connection to maven.

Add python-experimental-openapiv3-sample
Add missing files for the Python samples
Add python-experimental-petstore.bat for openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3. Address review comments
add missing files for test purpose
fix python formatting issues
fix python formatting issues
fix python formatting issues
Fix unit tests
fix python formatting issues
fix python formatting issues
fix python formatting issues
fix 'line too long' pep8 error
address PR comments for pep8 'line too long' problem
regenerate samples
execute samples scripts
dummy commit to retrigger circleci
Revert dummy commit, it didn't help.
@sebastien-rosset
sebastien-rossetforce-pushed the python-experimental-openapiv3-sample branch from 0d399dc to b381972CompareJanuary 17, 2020 00:51
@sebastien-rossetsebastien-rosset changed the title [Python] Add python experimental openapiv3 sample[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issuesJan 17, 2020
@spacether

Copy link
Copy Markdown
Contributor

I am looking forward to approving this, just waiting on the CI tests to pass.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I am looking forward to approving this, just waiting on the CI tests to pass.

Build is successful now. There were unrelated issues with circleCI, Jim and I fixed the issues.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Thank you!

@wing328wing328 added this to the 4.2.3 milestone Jan 31, 2020
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset restored the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sebastien-rosset@spacether@wing328
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues - #4992

Merged
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample
Jan 21, 2020
Merged

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues#4992
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample

Conversation

@sebastien-rosset

@sebastien-rossetsebastien-rosset commented Jan 13, 2020

Copy link
Copy Markdown
Contributor
  1. Add openapiv3 samples for Python experimental.
  2. Fix PEP8 python formatting issues (line too long) which was observed when generating python-experimental against the openapiv3 test spec.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@spacether

Copy link
Copy Markdown
Contributor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset this looks good, thanks for creating it!
Can you add

What is the reason for the first line of the Makefile to be?

#!/bin/bash

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.
https://stackoverflow.com/questions/7123241/makefile-as-an-executable-script-with-shebang

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

I will remove it and check.

Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

It looks like a couple other files are missing, I am adding them:

bash ./test_python2_and_3.sh
bash: ./test_python2_and_3.sh: No such file or directory

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Getting formatting issues:

petstore_api/api/fake_api.py:622:100: E501 line too long (115 > 99 characters)
kwargs['file_schema_test_class_file_schema_test_class'] = file_schema_test_class_file_schema_test_class
^
petstore_api/api/fake_api.py:654:100: E501 line too long (115 > 99 characters)
'file_schema_test_class_file_schema_test_class': (file_schema_test_class.FileSchemaTestClass,),
^
petstore_api/models/enum_test.py:46:100: E501 line too long (106 > 99 characters)
outer_enum_integer_default_value = sys.modules['petstore_api.models.outer_enum_integer_default_value']
^
Makefile:19: recipe for target 'test-all' failed

I will update the python template to fix.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I also had to add # noqa: E501 in a couple lines in the python api.template because the generated line is too long in openapi3.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

@spacether

spacether commented Jan 15, 2020

Copy link
Copy Markdown
Contributor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

That is a great question. I don't know. My suggestion is to ask on Slack because the maintainers are the most responsive there. If any actions come out of it, then maybe making a feature request to capture it would be a traceable way to track it.

My hope is that in the future this can replace the python generator or we can port a bunch of these features into it. We are allowed to make breaking changes on these experimental generators which means we can make progress quickly and aggressively refactor but I don't know what our plan is going forward.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, the CircleCi failure is an unrelated Maven issue

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

This looks good, the CircleCi failure is an unrelated Maven issue

thanks. I saw the Maven issue you have raised.

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

Are all maven issues resolved?

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.codehaus.groovy:groovy-all:2.5.7.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.5.7/groovy-all-2.5.7.pom'. Received status code 501 from server: HTTPS Required
> Could not resolve io.github.http-builder-ng:http-builder-ng-core:1.0.3.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/io/github/http-builder-ng/http-builder-ng-core/1.0.3/http-builder-ng-core-1.0.3.pom'. Received status code 501 from server: HTTPS Required

I see the following error in this build, but I have synced from master. There are still many instances of "http://maven" in master.

grep -r "http://" . |grep maven

@spacether

Copy link
Copy Markdown
Contributor

My PR was an attempt at a maven fix. But I don't know Maven so they may still be unresolved.

@spacether

Copy link
Copy Markdown
Contributor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

thanks. One thing I don't understand is I committed a change this morning, after syncing from master (which has the maven fix). But it still failed with "http" connection to maven.

Add python-experimental-openapiv3-sample
Add missing files for the Python samples
Add python-experimental-petstore.bat for openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3. Address review comments
add missing files for test purpose
fix python formatting issues
fix python formatting issues
fix python formatting issues
Fix unit tests
fix python formatting issues
fix python formatting issues
fix python formatting issues
fix 'line too long' pep8 error
address PR comments for pep8 'line too long' problem
regenerate samples
execute samples scripts
dummy commit to retrigger circleci
Revert dummy commit, it didn't help.
@sebastien-rosset
sebastien-rossetforce-pushed the python-experimental-openapiv3-sample branch from 0d399dc to b381972CompareJanuary 17, 2020 00:51
@sebastien-rossetsebastien-rosset changed the title [Python] Add python experimental openapiv3 sample[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issuesJan 17, 2020
@spacether

Copy link
Copy Markdown
Contributor

I am looking forward to approving this, just waiting on the CI tests to pass.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I am looking forward to approving this, just waiting on the CI tests to pass.

Build is successful now. There were unrelated issues with circleCI, Jim and I fixed the issues.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Thank you!

@wing328wing328 added this to the 4.2.3 milestone Jan 31, 2020
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset restored the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sebastien-rosset@spacether@wing328
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues - #4992

Merged
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample
Jan 21, 2020
Merged

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues#4992
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample

Conversation

@sebastien-rosset

@sebastien-rossetsebastien-rosset commented Jan 13, 2020

Copy link
Copy Markdown
Contributor
  1. Add openapiv3 samples for Python experimental.
  2. Fix PEP8 python formatting issues (line too long) which was observed when generating python-experimental against the openapiv3 test spec.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@spacether

Copy link
Copy Markdown
Contributor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset this looks good, thanks for creating it!
Can you add

What is the reason for the first line of the Makefile to be?

#!/bin/bash

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.
https://stackoverflow.com/questions/7123241/makefile-as-an-executable-script-with-shebang

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

I will remove it and check.

Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

It looks like a couple other files are missing, I am adding them:

bash ./test_python2_and_3.sh
bash: ./test_python2_and_3.sh: No such file or directory

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Getting formatting issues:

petstore_api/api/fake_api.py:622:100: E501 line too long (115 > 99 characters)
kwargs['file_schema_test_class_file_schema_test_class'] = file_schema_test_class_file_schema_test_class
^
petstore_api/api/fake_api.py:654:100: E501 line too long (115 > 99 characters)
'file_schema_test_class_file_schema_test_class': (file_schema_test_class.FileSchemaTestClass,),
^
petstore_api/models/enum_test.py:46:100: E501 line too long (106 > 99 characters)
outer_enum_integer_default_value = sys.modules['petstore_api.models.outer_enum_integer_default_value']
^
Makefile:19: recipe for target 'test-all' failed

I will update the python template to fix.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I also had to add # noqa: E501 in a couple lines in the python api.template because the generated line is too long in openapi3.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

@spacether

spacether commented Jan 15, 2020

Copy link
Copy Markdown
Contributor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

That is a great question. I don't know. My suggestion is to ask on Slack because the maintainers are the most responsive there. If any actions come out of it, then maybe making a feature request to capture it would be a traceable way to track it.

My hope is that in the future this can replace the python generator or we can port a bunch of these features into it. We are allowed to make breaking changes on these experimental generators which means we can make progress quickly and aggressively refactor but I don't know what our plan is going forward.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, the CircleCi failure is an unrelated Maven issue

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

This looks good, the CircleCi failure is an unrelated Maven issue

thanks. I saw the Maven issue you have raised.

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

Are all maven issues resolved?

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.codehaus.groovy:groovy-all:2.5.7.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.5.7/groovy-all-2.5.7.pom'. Received status code 501 from server: HTTPS Required
> Could not resolve io.github.http-builder-ng:http-builder-ng-core:1.0.3.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/io/github/http-builder-ng/http-builder-ng-core/1.0.3/http-builder-ng-core-1.0.3.pom'. Received status code 501 from server: HTTPS Required

I see the following error in this build, but I have synced from master. There are still many instances of "http://maven" in master.

grep -r "http://" . |grep maven

@spacether

Copy link
Copy Markdown
Contributor

My PR was an attempt at a maven fix. But I don't know Maven so they may still be unresolved.

@spacether

Copy link
Copy Markdown
Contributor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

thanks. One thing I don't understand is I committed a change this morning, after syncing from master (which has the maven fix). But it still failed with "http" connection to maven.

Add python-experimental-openapiv3-sample
Add missing files for the Python samples
Add python-experimental-petstore.bat for openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3. Address review comments
add missing files for test purpose
fix python formatting issues
fix python formatting issues
fix python formatting issues
Fix unit tests
fix python formatting issues
fix python formatting issues
fix python formatting issues
fix 'line too long' pep8 error
address PR comments for pep8 'line too long' problem
regenerate samples
execute samples scripts
dummy commit to retrigger circleci
Revert dummy commit, it didn't help.
@sebastien-rosset
sebastien-rossetforce-pushed the python-experimental-openapiv3-sample branch from 0d399dc to b381972CompareJanuary 17, 2020 00:51
@sebastien-rossetsebastien-rosset changed the title [Python] Add python experimental openapiv3 sample[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issuesJan 17, 2020
@spacether

Copy link
Copy Markdown
Contributor

I am looking forward to approving this, just waiting on the CI tests to pass.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I am looking forward to approving this, just waiting on the CI tests to pass.

Build is successful now. There were unrelated issues with circleCI, Jim and I fixed the issues.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Thank you!

@wing328wing328 added this to the 4.2.3 milestone Jan 31, 2020
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset restored the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sebastien-rosset@spacether@wing328
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues - #4992

Merged
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample
Jan 21, 2020
Merged

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues#4992
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample

Conversation

@sebastien-rosset

@sebastien-rossetsebastien-rosset commented Jan 13, 2020

Copy link
Copy Markdown
Contributor
  1. Add openapiv3 samples for Python experimental.
  2. Fix PEP8 python formatting issues (line too long) which was observed when generating python-experimental against the openapiv3 test spec.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@spacether

Copy link
Copy Markdown
Contributor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset this looks good, thanks for creating it!
Can you add

What is the reason for the first line of the Makefile to be?

#!/bin/bash

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.
https://stackoverflow.com/questions/7123241/makefile-as-an-executable-script-with-shebang

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

I will remove it and check.

Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

It looks like a couple other files are missing, I am adding them:

bash ./test_python2_and_3.sh
bash: ./test_python2_and_3.sh: No such file or directory

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Getting formatting issues:

petstore_api/api/fake_api.py:622:100: E501 line too long (115 > 99 characters)
kwargs['file_schema_test_class_file_schema_test_class'] = file_schema_test_class_file_schema_test_class
^
petstore_api/api/fake_api.py:654:100: E501 line too long (115 > 99 characters)
'file_schema_test_class_file_schema_test_class': (file_schema_test_class.FileSchemaTestClass,),
^
petstore_api/models/enum_test.py:46:100: E501 line too long (106 > 99 characters)
outer_enum_integer_default_value = sys.modules['petstore_api.models.outer_enum_integer_default_value']
^
Makefile:19: recipe for target 'test-all' failed

I will update the python template to fix.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I also had to add # noqa: E501 in a couple lines in the python api.template because the generated line is too long in openapi3.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

@spacether

spacether commented Jan 15, 2020

Copy link
Copy Markdown
Contributor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

That is a great question. I don't know. My suggestion is to ask on Slack because the maintainers are the most responsive there. If any actions come out of it, then maybe making a feature request to capture it would be a traceable way to track it.

My hope is that in the future this can replace the python generator or we can port a bunch of these features into it. We are allowed to make breaking changes on these experimental generators which means we can make progress quickly and aggressively refactor but I don't know what our plan is going forward.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, the CircleCi failure is an unrelated Maven issue

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

This looks good, the CircleCi failure is an unrelated Maven issue

thanks. I saw the Maven issue you have raised.

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

Are all maven issues resolved?

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.codehaus.groovy:groovy-all:2.5.7.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.5.7/groovy-all-2.5.7.pom'. Received status code 501 from server: HTTPS Required
> Could not resolve io.github.http-builder-ng:http-builder-ng-core:1.0.3.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/io/github/http-builder-ng/http-builder-ng-core/1.0.3/http-builder-ng-core-1.0.3.pom'. Received status code 501 from server: HTTPS Required

I see the following error in this build, but I have synced from master. There are still many instances of "http://maven" in master.

grep -r "http://" . |grep maven

@spacether

Copy link
Copy Markdown
Contributor

My PR was an attempt at a maven fix. But I don't know Maven so they may still be unresolved.

@spacether

Copy link
Copy Markdown
Contributor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

thanks. One thing I don't understand is I committed a change this morning, after syncing from master (which has the maven fix). But it still failed with "http" connection to maven.

Add python-experimental-openapiv3-sample
Add missing files for the Python samples
Add python-experimental-petstore.bat for openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3. Address review comments
add missing files for test purpose
fix python formatting issues
fix python formatting issues
fix python formatting issues
Fix unit tests
fix python formatting issues
fix python formatting issues
fix python formatting issues
fix 'line too long' pep8 error
address PR comments for pep8 'line too long' problem
regenerate samples
execute samples scripts
dummy commit to retrigger circleci
Revert dummy commit, it didn't help.
@sebastien-rosset
sebastien-rossetforce-pushed the python-experimental-openapiv3-sample branch from 0d399dc to b381972CompareJanuary 17, 2020 00:51
@sebastien-rossetsebastien-rosset changed the title [Python] Add python experimental openapiv3 sample[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issuesJan 17, 2020
@spacether

Copy link
Copy Markdown
Contributor

I am looking forward to approving this, just waiting on the CI tests to pass.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I am looking forward to approving this, just waiting on the CI tests to pass.

Build is successful now. There were unrelated issues with circleCI, Jim and I fixed the issues.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Thank you!

@wing328wing328 added this to the 4.2.3 milestone Jan 31, 2020
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset restored the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sebastien-rosset@spacether@wing328
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues - #4992

Merged
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample
Jan 21, 2020
Merged

[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issues#4992
wing328 merged 4 commits into
OpenAPITools:masterfrom
CiscoM31:python-experimental-openapiv3-sample

Conversation

@sebastien-rosset

@sebastien-rossetsebastien-rosset commented Jan 13, 2020

Copy link
Copy Markdown
Contributor
  1. Add openapiv3 samples for Python experimental.
  2. Fix PEP8 python formatting issues (line too long) which was observed when generating python-experimental against the openapiv3 test spec.

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before.
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.3.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@spacether

Copy link
Copy Markdown
Contributor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset this looks good, thanks for creating it!
Can you add

What is the reason for the first line of the Makefile to be?

#!/bin/bash

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

What is the reason for the first line of the Makefile to be?

#!/bin/bash

It tells which shell interpreter to invoke per http://www.linuxandubuntu.com/home/comments-in-bash-learn-bash-part-3

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.
https://stackoverflow.com/questions/7123241/makefile-as-an-executable-script-with-shebang

@spacether

spacether commented Jan 13, 2020

Copy link
Copy Markdown
Contributor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

But it's not a bash script, it's a makefile. In fact the shebang is ignored because there is an extra space.

Good point. If you delete it does it still work?

I will remove it and check.

Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
Comment threadsamples/openapi3/client/petstore/python-experimental/pom.xml Outdated
@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

It looks like a couple other files are missing, I am adding them:

bash ./test_python2_and_3.sh
bash: ./test_python2_and_3.sh: No such file or directory

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Getting formatting issues:

petstore_api/api/fake_api.py:622:100: E501 line too long (115 > 99 characters)
kwargs['file_schema_test_class_file_schema_test_class'] = file_schema_test_class_file_schema_test_class
^
petstore_api/api/fake_api.py:654:100: E501 line too long (115 > 99 characters)
'file_schema_test_class_file_schema_test_class': (file_schema_test_class.FileSchemaTestClass,),
^
petstore_api/models/enum_test.py:46:100: E501 line too long (106 > 99 characters)
outer_enum_integer_default_value = sys.modules['petstore_api.models.outer_enum_integer_default_value']
^
Makefile:19: recipe for target 'test-all' failed

I will update the python template to fix.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I also had to add # noqa: E501 in a couple lines in the python api.template because the generated line is too long in openapi3.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

@spacether

spacether commented Jan 15, 2020

Copy link
Copy Markdown
Contributor

As a side note, what is the plan to move python-experimental and go-experimental from "experimental" status? Is this going to replace the "python" and "go" generators? Or will there be two separate generators?

That is a great question. I don't know. My suggestion is to ask on Slack because the maintainers are the most responsive there. If any actions come out of it, then maybe making a feature request to capture it would be a traceable way to track it.

My hope is that in the future this can replace the python generator or we can port a bunch of these features into it. We are allowed to make breaking changes on these experimental generators which means we can make progress quickly and aggressively refactor but I don't know what our plan is going forward.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, the CircleCi failure is an unrelated Maven issue

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

This looks good, the CircleCi failure is an unrelated Maven issue

thanks. I saw the Maven issue you have raised.

@sebastien-rosset

sebastien-rosset commented Jan 16, 2020

Copy link
Copy Markdown
ContributorAuthor

Are all maven issues resolved?

* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.codehaus.groovy:groovy-all:2.5.7.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.5.7/groovy-all-2.5.7.pom'. Received status code 501 from server: HTTPS Required
> Could not resolve io.github.http-builder-ng:http-builder-ng-core:1.0.3.
Required by:
org.openapitools:groovy:1.0.0
> Could not GET 'http://repo1.maven.org/maven2/io/github/http-builder-ng/http-builder-ng-core/1.0.3/http-builder-ng-core-1.0.3.pom'. Received status code 501 from server: HTTPS Required

I see the following error in this build, but I have synced from master. There are still many instances of "http://maven" in master.

grep -r "http://" . |grep maven

@spacether

Copy link
Copy Markdown
Contributor

My PR was an attempt at a maven fix. But I don't know Maven so they may still be unresolved.

@spacether

Copy link
Copy Markdown
Contributor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

If you close and reopen the pr it will kick off ci again. No need for dummy commits

thanks. One thing I don't understand is I committed a change this morning, after syncing from master (which has the maven fix). But it still failed with "http" connection to maven.

Add python-experimental-openapiv3-sample
Add missing files for the Python samples
Add python-experimental-petstore.bat for openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3
Add python-experimental samples openapi v3. Address review comments
add missing files for test purpose
fix python formatting issues
fix python formatting issues
fix python formatting issues
Fix unit tests
fix python formatting issues
fix python formatting issues
fix python formatting issues
fix 'line too long' pep8 error
address PR comments for pep8 'line too long' problem
regenerate samples
execute samples scripts
dummy commit to retrigger circleci
Revert dummy commit, it didn't help.
@sebastien-rosset
sebastien-rossetforce-pushed the python-experimental-openapiv3-sample branch from 0d399dc to b381972CompareJanuary 17, 2020 00:51
@sebastien-rossetsebastien-rosset changed the title [Python] Add python experimental openapiv3 sample[Python] Add python experimental openapiv3 sample and fix PEP8 formatting issuesJan 17, 2020
@spacether

Copy link
Copy Markdown
Contributor

I am looking forward to approving this, just waiting on the CI tests to pass.

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

I am looking forward to approving this, just waiting on the CI tests to pass.

Build is successful now. There were unrelated issues with circleCI, Jim and I fixed the issues.

@spacetherspacether left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@sebastien-rosset

Copy link
Copy Markdown
ContributorAuthor

Thank you!

@wing328wing328 added this to the 4.2.3 milestone Jan 31, 2020
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset restored the python-experimental-openapiv3-sample branch May 23, 2020 19:23
@sebastien-rosset
sebastien-rosset deleted the python-experimental-openapiv3-sample branch May 23, 2020 19:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@sebastien-rosset@spacether@wing328