Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 2e43d9a

Browse files
authored
v2 fixes pyproject.toml (#141)
* Fixes pyproject.toml file * Samples regen * Reduces number of test fiels needed * Sample regen * Removes flake8
1 parent b99b00c commit 2e43d9a

File tree

34 files changed

+111
-110
lines changed

34 files changed

+111
-110
lines changed

modules/openapi-json-schema-generator/src/main/java/org/openapijsonschematools/codegen/languages/PythonClientCodegen.java

-1
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,6 @@ public void processOpts() {
612612
if (!generateSourceCodeOnly) {
613613
supportingFiles.add(new SupportingFile("tox.hbs", "", "tox.ini"));
614614
supportingFiles.add(new SupportingFile("test-requirements.hbs", "", "test-requirements.txt"));
615-
supportingFiles.add(new SupportingFile("requirements.hbs", "", "requirements.txt"));
616615

617616
supportingFiles.add(new SupportingFile("git_push.hbs", "", "git_push.sh"));
618617
supportingFiles.add(new SupportingFile("gitignore.hbs", "", ".gitignore"));

modules/openapi-json-schema-generator/src/main/resources/python/_helper_required_libraries.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
{{#if tornado}}
1313
{{#if quoted}}"{{/if}}tornado >= 4.2{{#if quoted}}",{{/if}}
1414
{{/if}}
15-
{{#if quoted}}"{{/if}}typing_extensions ~= 4.3.0{{#if quoted}}",{{/if}}
15+
{{#if quoted}}"{{/if}}typing_extensions ~= 4.5.0{{#if quoted}}",{{/if}}
1616
{{#if quoted}}"{{/if}}urllib3 ~= 2.0.a3{{#if quoted}}",{{/if}}
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
22

33
[build-system]
4-
requires = [
5-
{{> _helper_required_libraries quoted=true }}
6-
]
4+
requires = ["setuptools>=61.0"]
75
build-backend = "setuptools.build_meta"
86

97
[project]
108
name = "{{{projectName}}}"
119
version = "{{packageVersion}}"
12-
{{#with apiInfo}}
1310
authors = [
1411
{ name="{{#if infoName}}{{infoName}}{{else}}OpenAPI JSON Schema Generator community{{/if}}"{{#if infoEmail}}, email="{{infoEmail}}"{{/if}} },
1512
]
1613
description = "{{appName}}"
1714
readme = "README.md"
1815
requires-python = "{{{generatorLanguageVersion}}}"
16+
dependencies = [
17+
{{> _helper_required_libraries quoted=true }}
18+
]
1919
classifiers = [
2020
"Programming Language :: Python :: 3",
2121
{{#if licenseInfo}}"License :: {{licenseInfo}}",{{/if}}
@@ -28,4 +28,3 @@ classifiers = [
2828
{{#if packageUrl}}"Homepage" = "{{{packageUrl}}}"{{/if}}
2929
{{#if infoUrl}}"Bug Tracker" = "{{{infoUrl}}}"{{/if}}
3030
{{/or}}
31-
{{/with}}

modules/openapi-json-schema-generator/src/main/resources/python/requirements.hbs

-1
This file was deleted.

modules/openapi-json-schema-generator/src/main/resources/python/test-requirements.hbs

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ nose>=1.3.7
44
pluggy>=0.3.1
55
py>=1.4.31
66
randomize>=0.13
7+
{{else}}
8+
pytest ~= 7.2.0
9+
pytest-cov ~= 4.0.0
710
{{/if}}
8-
{{#unless useNose}}
9-
pytest~=4.6.7 # needed for python 3.4
10-
pytest-cov>=2.8.1
11-
pytest-randomly==1.2.3 # needed for python 3.4
12-
{{/unless}}
1311
{{#if hasHttpSignatureSecurityScheme}}
1412
pycryptodome>=3.9.0
1513
{{/if}}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[tox]
22
envlist = py37
3+
isolated_build = True
34

45
[testenv]
56
passenv = PYTHON_VERSION
6-
deps=-r{toxinidir}/requirements.txt
7-
-r{toxinidir}/test-requirements.txt
7+
deps=-r{toxinidir}/test-requirements.txt
88

99
commands=
1010
{{#unless useNose}}pytest --cov={{{packageName}}}{{/unless}}{{#if useNose}}nosetests{{/if}}

samples/openapi3/client/3_0_3_unit_test/python/.openapi-generator/FILES

-1
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,6 @@ git_push.sh
818818
migration_2_0_0.md
819819
migration_other_python_generators.md
820820
pyproject.toml
821-
requirements.txt
822821
src/unit_test_api/__init__.py
823822
src/unit_test_api/api_client.py
824823
src/unit_test_api/apis/__init__.py

samples/openapi3/client/3_0_3_unit_test/python/dev-requirements.txt

-2
This file was deleted.

samples/openapi3/client/3_0_3_unit_test/python/pyproject.toml

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
# Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
22

33
[build-system]
4-
requires = [
4+
requires = ["setuptools>=61.0"]
5+
build-backend = "setuptools.build_meta"
6+
7+
[project]
8+
name = "unit-test-api"
9+
version = "1.0.0"
10+
authors = [
11+
{ name="OpenAPI JSON Schema Generator community" },
12+
]
13+
description = "openapi 3.0.3 sample spec"
14+
readme = "README.md"
15+
requires-python = ">=3.7"
16+
dependencies = [
517
"certifi >= 14.5.14",
618
"frozendict ~= 2.3.4",
719
"python-dateutil ~= 2.7.0",
820
"setuptools >= 61.0",
9-
"typing_extensions ~= 4.3.0",
21+
"typing_extensions ~= 4.5.0",
1022
"urllib3 ~= 2.0.a3",
1123
]
12-
build-backend = "setuptools.build_meta"
24+
classifiers = [
25+
"Programming Language :: Python :: 3",
26+
27+
"Operating System :: OS Independent",
28+
"Topic :: Software Development :: Code Generators"
29+
]
1330

14-
[project]
15-
name = "unit-test-api"
16-
version = "1.0.0"

samples/openapi3/client/3_0_3_unit_test/python/requirements.txt

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
pytest~=4.6.7 # needed for python 3.4
2-
pytest-cov>=2.8.1
3-
pytest-randomly==1.2.3 # needed for python 3.4
1+
pytest ~= 7.2.0
2+
pytest-cov ~= 4.0.0

samples/openapi3/client/3_0_3_unit_test/python/test_python.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/bash
22

3-
REQUIREMENTS_FILE=dev-requirements.txt
4-
REQUIREMENTS_OUT=dev-requirements.txt.log
53
SETUP_OUT=*.egg-info
64
VENV=venv
75
DEACTIVE=false
@@ -17,7 +15,7 @@ if [ -z "$VENVV" ]; then
1715
fi
1816

1917
### install dependencies
20-
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
18+
pip install tox
2119
### locally install the package, needed for pycharm problem checking
2220
python -m pip install .
2321

Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[tox]
22
envlist = py37
3+
isolated_build = True
34

45
[testenv]
56
passenv = PYTHON_VERSION
6-
deps=-r{toxinidir}/requirements.txt
7-
-r{toxinidir}/test-requirements.txt
7+
deps=-r{toxinidir}/test-requirements.txt
88

99
commands=
1010
pytest --cov=unit_test_api

samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.openapi-generator/FILES

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ git_push.sh
1212
migration_2_0_0.md
1313
migration_other_python_generators.md
1414
pyproject.toml
15-
requirements.txt
1615
src/this_package/__init__.py
1716
src/this_package/api_client.py
1817
src/this_package/apis/__init__.py

samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/dev-requirements.txt

-2
This file was deleted.

samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/pyproject.toml

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
# Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
22

33
[build-system]
4-
requires = [
4+
requires = ["setuptools>=61.0"]
5+
build-backend = "setuptools.build_meta"
6+
7+
[project]
8+
name = "this-package"
9+
version = "1.0.0"
10+
authors = [
11+
{ name="OpenAPI JSON Schema Generator community" },
12+
]
13+
description = "discriminator-test"
14+
readme = "README.md"
15+
requires-python = ">=3.7"
16+
dependencies = [
517
"certifi >= 14.5.14",
618
"frozendict ~= 2.3.4",
719
"python-dateutil ~= 2.7.0",
820
"setuptools >= 61.0",
9-
"typing_extensions ~= 4.3.0",
21+
"typing_extensions ~= 4.5.0",
1022
"urllib3 ~= 2.0.a3",
1123
]
12-
build-backend = "setuptools.build_meta"
24+
classifiers = [
25+
"Programming Language :: Python :: 3",
26+
27+
"Operating System :: OS Independent",
28+
"Topic :: Software Development :: Code Generators"
29+
]
1330

14-
[project]
15-
name = "this-package"
16-
version = "1.0.0"

samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/requirements.txt

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
pytest~=4.6.7 # needed for python 3.4
2-
pytest-cov>=2.8.1
3-
pytest-randomly==1.2.3 # needed for python 3.4
1+
pytest ~= 7.2.0
2+
pytest-cov ~= 4.0.0

samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/test_python.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/bash
22

3-
REQUIREMENTS_FILE=dev-requirements.txt
4-
REQUIREMENTS_OUT=dev-requirements.txt.log
53
SETUP_OUT=*.egg-info
64
VENV=venv
75
DEACTIVE=false
@@ -17,7 +15,7 @@ if [ -z "$VENVV" ]; then
1715
fi
1816

1917
### install dependencies
20-
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
18+
pip install tox
2119
### locally install the package, needed for pycharm problem checking
2220
python -m pip install .
2321

Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[tox]
22
envlist = py37
3+
isolated_build = True
34

45
[testenv]
56
passenv = PYTHON_VERSION
6-
deps=-r{toxinidir}/requirements.txt
7-
-r{toxinidir}/test-requirements.txt
7+
deps=-r{toxinidir}/test-requirements.txt
88

99
commands=
1010
pytest --cov=this_package

samples/openapi3/client/features/security/python/.openapi-generator/FILES

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ git_push.sh
1515
migration_2_0_0.md
1616
migration_other_python_generators.md
1717
pyproject.toml
18-
requirements.txt
1918
src/this_package/__init__.py
2019
src/this_package/api_client.py
2120
src/this_package/apis/__init__.py

samples/openapi3/client/features/security/python/dev-requirements.txt

-2
This file was deleted.

samples/openapi3/client/features/security/python/pyproject.toml

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
# Generated by: https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
22

33
[build-system]
4-
requires = [
4+
requires = ["setuptools>=61.0"]
5+
build-backend = "setuptools.build_meta"
6+
7+
[project]
8+
name = "this-package"
9+
version = "1.0.0"
10+
authors = [
11+
{ name="OpenAPI JSON Schema Generator community" },
12+
]
13+
description = "security-test"
14+
readme = "README.md"
15+
requires-python = ">=3.7"
16+
dependencies = [
517
"certifi >= 14.5.14",
618
"frozendict ~= 2.3.4",
719
"python-dateutil ~= 2.7.0",
820
"setuptools >= 61.0",
9-
"typing_extensions ~= 4.3.0",
21+
"typing_extensions ~= 4.5.0",
1022
"urllib3 ~= 2.0.a3",
1123
]
12-
build-backend = "setuptools.build_meta"
24+
classifiers = [
25+
"Programming Language :: Python :: 3",
26+
27+
"Operating System :: OS Independent",
28+
"Topic :: Software Development :: Code Generators"
29+
]
1330

14-
[project]
15-
name = "this-package"
16-
version = "1.0.0"

samples/openapi3/client/features/security/python/requirements.txt

-6
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
pytest~=4.6.7 # needed for python 3.4
2-
pytest-cov>=2.8.1
3-
pytest-randomly==1.2.3 # needed for python 3.4
1+
pytest ~= 7.2.0
2+
pytest-cov ~= 4.0.0

samples/openapi3/client/features/security/python/test_python.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/bash
22

3-
REQUIREMENTS_FILE=dev-requirements.txt
4-
REQUIREMENTS_OUT=dev-requirements.txt.log
53
SETUP_OUT=*.egg-info
64
VENV=venv
75
DEACTIVE=false
@@ -17,7 +15,7 @@ if [ -z "$VENVV" ]; then
1715
fi
1816

1917
### install dependencies
20-
pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT
18+
pip install tox
2119
### locally install the package, needed for pycharm problem checking
2220
python -m pip install .
2321

Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[tox]
22
envlist = py37
3+
isolated_build = True
34

45
[testenv]
56
passenv = PYTHON_VERSION
6-
deps=-r{toxinidir}/requirements.txt
7-
-r{toxinidir}/test-requirements.txt
7+
deps=-r{toxinidir}/test-requirements.txt
88

99
commands=
1010
pytest --cov=this_package

samples/openapi3/client/petstore/python/.openapi-generator/FILES

-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ git_push.sh
233233
migration_2_0_0.md
234234
migration_other_python_generators.md
235235
pyproject.toml
236-
requirements.txt
237236
src/petstore_api/__init__.py
238237
src/petstore_api/api_client.py
239238
src/petstore_api/apis/__init__.py

samples/openapi3/client/petstore/python/dev-requirements.txt

-2
This file was deleted.

0 commit comments

Comments
 (0)