alpha-python 0.2.0__tar.gz → 0.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. {alpha_python-0.2.0 → alpha_python-0.2.2}/PKG-INFO +2 -2
  2. {alpha_python-0.2.0 → alpha_python-0.2.2}/pyproject.toml +5 -5
  3. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/cli.py +30 -17
  4. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/containers/container.py +2 -2
  5. alpha_python-0.2.2/src/alpha/handlers/gen-code.sh +28 -0
  6. alpha_python-0.2.2/src/alpha/handlers/run-api.sh +12 -0
  7. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha_python.egg-info/PKG-INFO +2 -2
  8. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha_python.egg-info/SOURCES.txt +28 -27
  9. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha_python.egg-info/requires.txt +3 -1
  10. alpha_python-0.2.0/src/alpha/utils/__init__.py +0 -0
  11. {alpha_python-0.2.0 → alpha_python-0.2.2}/LICENSE +0 -0
  12. {alpha_python-0.2.0 → alpha_python-0.2.2}/README.md +0 -0
  13. {alpha_python-0.2.0 → alpha_python-0.2.2}/setup.cfg +0 -0
  14. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/__init__.py +0 -0
  15. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/adapters/__init__.py +0 -0
  16. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/adapters/sqla_unit_of_work.py +0 -0
  17. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/containers/__init__.py +0 -0
  18. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/domain/__init__.py +0 -0
  19. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/domain/models/__init__.py +0 -0
  20. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/domain/models/base_model.py +0 -0
  21. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/domain/models/life_cycle_base.py +0 -0
  22. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/domain/models/user.py +0 -0
  23. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/encoder.py +0 -0
  24. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/exceptions.py +0 -0
  25. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/__init__.py +0 -0
  26. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/_type_conversion_matrix.py +0 -0
  27. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/_type_mapping.py +0 -0
  28. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/class_factories.py +0 -0
  29. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/default_field_factory.py +0 -0
  30. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/field_iterator.py +0 -0
  31. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/jwt_factory.py +0 -0
  32. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/logging_handler_factory.py +0 -0
  33. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/model_class_factory.py +0 -0
  34. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/models/__init__.py +0 -0
  35. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/models/factory_classes.py +0 -0
  36. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/request_factory.py +0 -0
  37. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/response_factory.py +0 -0
  38. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/factories/type_factories.py +0 -0
  39. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/handlers/__init__.py +0 -0
  40. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/api_generate_handler.py +0 -0
  41. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/api_run_handler.py +0 -0
  42. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/handlers/base_handler.py +0 -0
  43. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers/models}/__init__.py +0 -0
  44. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/handlers/models/argument.py +0 -0
  45. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/handlers/models/command.py +0 -0
  46. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/handlers/models/section.py +0 -0
  47. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/handlers/models/subparser.py +0 -0
  48. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/__init__.py +0 -0
  49. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/Dockerfile.mustache +0 -0
  50. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/README.mustache +0 -0
  51. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/__init__model.mustache +0 -0
  52. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/__init__test.mustache +0 -0
  53. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/__main__.mustache +0 -0
  54. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/base_model.mustache +0 -0
  55. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/controller.mustache +0 -0
  56. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/controller_test.mustache +0 -0
  57. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/dockerignore.mustache +0 -0
  58. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/encoder.mustache +0 -0
  59. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/git_push.sh.mustache +0 -0
  60. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/gitignore.mustache +0 -0
  61. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/model.mustache +0 -0
  62. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/openapi.mustache +0 -0
  63. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/param_type.mustache +0 -0
  64. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/requirements.mustache +0 -0
  65. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/security_controller_.mustache +0 -0
  66. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/setup.mustache +0 -0
  67. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/test-requirements.mustache +0 -0
  68. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/tox.mustache +0 -0
  69. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/travis.mustache +0 -0
  70. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/typing_utils.mustache +0 -0
  71. {alpha_python-0.2.0/src/alpha/handlers/api → alpha_python-0.2.2/src/alpha/handlers}/templates/python-flask/util.mustache +0 -0
  72. {alpha_python-0.2.0/src/alpha/handlers/models → alpha_python-0.2.2/src/alpha/infra}/__init__.py +0 -0
  73. {alpha_python-0.2.0/src/alpha/infra → alpha_python-0.2.2/src/alpha/infra/connectors}/__init__.py +0 -0
  74. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/infra/connectors/ldap_connector.py +0 -0
  75. {alpha_python-0.2.0/src/alpha/infra/connectors → alpha_python-0.2.2/src/alpha/infra/databases}/__init__.py +0 -0
  76. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/infra/databases/sql_alchemy.py +0 -0
  77. {alpha_python-0.2.0/src/alpha/infra/databases → alpha_python-0.2.2/src/alpha/infra/models}/__init__.py +0 -0
  78. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/infra/models/filter_operators.py +0 -0
  79. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/infra/models/json_patch.py +0 -0
  80. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/infra/models/order_by.py +0 -0
  81. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/infra/models/query_clause.py +0 -0
  82. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/infra/models/search_filter.py +0 -0
  83. {alpha_python-0.2.0/src/alpha/infra/models → alpha_python-0.2.2/src/alpha/interfaces}/__init__.py +0 -0
  84. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/attrs_instance.py +0 -0
  85. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/dataclass_instance.py +0 -0
  86. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/factories.py +0 -0
  87. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/handler.py +0 -0
  88. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/openapi_model.py +0 -0
  89. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/patchable.py +0 -0
  90. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/providers.py +0 -0
  91. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/pydantic_instance.py +0 -0
  92. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/sql_database.py +0 -0
  93. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/sql_mapper.py +0 -0
  94. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/sql_repository.py +0 -0
  95. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/token_factory.py +0 -0
  96. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/unit_of_work.py +0 -0
  97. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/interfaces/updateable.py +0 -0
  98. {alpha_python-0.2.0/src/alpha/interfaces → alpha_python-0.2.2/src/alpha/mixins}/__init__.py +0 -0
  99. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/mixins/jwt_provider.py +0 -0
  100. {alpha_python-0.2.0/src/alpha/mixins → alpha_python-0.2.2/src/alpha/providers}/__init__.py +0 -0
  101. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/providers/api_key_provider.py +0 -0
  102. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/providers/database_provider.py +0 -0
  103. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/providers/keycloak_provider.py +0 -0
  104. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/providers/ldap_provider.py +0 -0
  105. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/providers/local_provider.py +0 -0
  106. {alpha_python-0.2.0/src/alpha/providers → alpha_python-0.2.2/src/alpha/providers/models}/__init__.py +0 -0
  107. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/providers/models/credentials.py +0 -0
  108. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/providers/models/identity.py +0 -0
  109. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/providers/models/token.py +0 -0
  110. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/py.typed +0 -0
  111. {alpha_python-0.2.0/src/alpha/providers/models → alpha_python-0.2.2/src/alpha/repositories}/__init__.py +0 -0
  112. {alpha_python-0.2.0/src/alpha/repositories → alpha_python-0.2.2/src/alpha/repositories/models}/__init__.py +0 -0
  113. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/repositories/models/repository_model.py +0 -0
  114. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/repositories/sql_alchemy_repository.py +0 -0
  115. {alpha_python-0.2.0/src/alpha/repositories/models → alpha_python-0.2.2/src/alpha/services}/__init__.py +0 -0
  116. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/services/authentication_service.py +0 -0
  117. {alpha_python-0.2.0/src/alpha/services → alpha_python-0.2.2/src/alpha/utils}/__init__.py +0 -0
  118. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/utils/_http_codes.py +0 -0
  119. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/utils/is_attrs.py +0 -0
  120. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/utils/is_pydantic.py +0 -0
  121. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/utils/logging_configurator.py +0 -0
  122. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/utils/logging_level_checker.py +0 -0
  123. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/utils/response_object.py +0 -0
  124. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/utils/verify_identity.py +0 -0
  125. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha/utils/version_check.py +0 -0
  126. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha_python.egg-info/dependency_links.txt +0 -0
  127. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha_python.egg-info/entry_points.txt +0 -0
  128. {alpha_python-0.2.0 → alpha_python-0.2.2}/src/alpha_python.egg-info/top_level.txt +0 -0
  129. {alpha_python-0.2.0 → alpha_python-0.2.2}/tests/test_encoder.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alpha-python
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Alpha is intended to be the first dependency you need to add to your Python application. It is a Python library which contains standard building blocks that can be used in applications that are used as APIs and/or make use of database interaction.
5
5
  Author-email: Bart Reijling <bart@reijling.eu>
6
6
  Requires-Python: >=3.11
@@ -18,7 +18,7 @@ Requires-Dist: sqlalchemy>=2.0.44
18
18
  Requires-Dist: requests>=2.28.1
19
19
  Requires-Dist: dependency-injector<5.0.0,>=4.48.3
20
20
  Provides-Extra: api-generator
21
- Requires-Dist: openapi-generator-cli==7.14.0; extra == "api-generator"
21
+ Requires-Dist: openapi-generator-cli==7.14.0; (python_version >= "3.11" and python_version < "4.0") and extra == "api-generator"
22
22
  Requires-Dist: jdk4py; extra == "api-generator"
23
23
  Provides-Extra: flask
24
24
  Requires-Dist: connexion[swagger-ui]<3,>=2.14.2; extra == "flask"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "alpha-python"
3
- version = "0.2.0"
3
+ version = "0.2.2"
4
4
  description = "Alpha is intended to be the first dependency you need to add to your Python application. It is a Python library which contains standard building blocks that can be used in applications that are used as APIs and/or make use of database interaction."
5
5
  readme = "README.md"
6
6
  authors = [
@@ -34,9 +34,9 @@ where = ["src"]
34
34
  include-package-data = true
35
35
 
36
36
  [tool.setuptools.package-data]
37
- "alpha.handlers.api.templates" = [
38
- "python-flask/*.mustache",
39
- "python-flask/**/*.mustache",
37
+ "alpha.handlers" = [
38
+ "**/*.mustache",
39
+ "*.sh",
40
40
  ]
41
41
 
42
42
  [build-system]
@@ -60,7 +60,7 @@ dev = [
60
60
 
61
61
  [project.optional-dependencies]
62
62
  api-generator = [
63
- "openapi-generator-cli==7.14.0",
63
+ "openapi-generator-cli==7.14.0 ; python_version >= '3.11' and python_version < '4.0'",
64
64
  "jdk4py"
65
65
  ]
66
66
  flask = [
@@ -1,6 +1,7 @@
1
1
  import argparse
2
2
  import os
3
3
  import sys
4
+ import tomllib
4
5
  from dependency_injector.wiring import Provide, inject
5
6
 
6
7
  from alpha.containers.container import Container
@@ -105,29 +106,41 @@ def main(sections: list[Section] = Provide[Container.sections]) -> None:
105
106
  return
106
107
 
107
108
 
108
- def _guess_current_package_name() -> str | None:
109
- """Guess the name of the package where you are generating the API for,
110
- finding the first (and only) folder in the 'src'-folder.
109
+ def _guess_current_package_name() -> str:
110
+ """Guess the name of the python package where you are generating the API
111
+ for. If a pyproject.toml file can be found the name is read from there. If
112
+ not, it looks for a subfolder which contains a python package.
111
113
 
112
114
  Returns
113
115
  -------
114
116
  str
115
- _description_
117
+ The guessed package name.
116
118
  """
119
+
117
120
  cwd = os.getcwd()
118
- package_location = f'{cwd}/src'
119
- if not os.path.isdir(package_location):
120
- return 'None'
121
- package_names = [
122
- name
123
- for name in os.listdir(package_location)
124
- if os.path.isdir(os.path.join(package_location, name))
125
- and not name.startswith('.')
126
- and not name.endswith('.egg-info')
127
- ]
128
- if len(package_names) == 0:
129
- return None
130
- return package_names[0]
121
+ pyproject_path = os.path.join(cwd, 'pyproject.toml')
122
+
123
+ # look for pyproject.toml file in subfolders
124
+ if not os.path.isfile(pyproject_path):
125
+ for entry in os.scandir(cwd):
126
+ if not entry.is_dir():
127
+ continue
128
+ possible_path = os.path.join(entry.path, 'pyproject.toml')
129
+ if os.path.isfile(possible_path):
130
+ pyproject_path = possible_path
131
+ break
132
+
133
+ if os.path.isfile(pyproject_path):
134
+ try:
135
+ with open(pyproject_path, 'rb') as f:
136
+ pyproject_data = tomllib.load(f)
137
+ return pyproject_data['project']['name'].replace('-', '_')
138
+ except Exception:
139
+ pass
140
+
141
+ # Fallback to use the current folder name
142
+ print('Could not find pyproject.toml, guessing package name from folder')
143
+ return os.path.basename(cwd)
131
144
 
132
145
 
133
146
  def init() -> None:
@@ -1,7 +1,7 @@
1
1
  from dependency_injector import containers, providers
2
2
 
3
- from alpha.handlers.api.api_generate_handler import ApiGenerateHandler
4
- from alpha.handlers.api.api_run_handler import ApiRunHandler
3
+ from alpha.handlers.api_generate_handler import ApiGenerateHandler
4
+ from alpha.handlers.api_run_handler import ApiRunHandler
5
5
  from alpha.handlers.models.command import Command
6
6
  from alpha.handlers.models.section import Section
7
7
  from alpha.handlers.models.argument import Argument
@@ -0,0 +1,28 @@
1
+ echo ${PACKAGE_NAME}
2
+
3
+ if ! command -v openapi-generator-cli 2>&1 >/dev/null
4
+ then
5
+ echo "The 'openapi-generator-cli' command could not be found"
6
+ echo "Please install it by installing alpha-python with the 'api-generator' extras:"
7
+ echo "eg. 'pip install alpha-python[api-generator]'"
8
+ exit 1
9
+ fi
10
+
11
+ # Validate spec
12
+ openapi-generator-cli validate \
13
+ --input-spec ${WORKING_DIR}/${SPEC_FILE}
14
+
15
+ # Generate code
16
+ openapi-generator-cli generate \
17
+ --input-spec ${WORKING_DIR}/${SPEC_FILE} \
18
+ --generator-name ${GENERATOR_NAME} \
19
+ --output ${WORKING_DIR}/api \
20
+ --template-dir ${WORKING_DIR}/templates \
21
+ --package-name ${PACKAGE_NAME} \
22
+ $RESERVED_WORDS_MAPPINGS \
23
+ --additional-properties featureCORS=true \
24
+ --additional-properties languageCode=en \
25
+ --additional-properties servicePackage=${SERVICE_PACKAGE} \
26
+ --additional-properties containerImport="${CONTAINER_IMPORT}" \
27
+ --additional-properties initContainerFrom="${INIT_CONTAINER_FROM}" \
28
+ --additional-properties initContainerFunction="${INIT_CONTAINER_FUNCTION}" \
@@ -0,0 +1,12 @@
1
+ #!/bin/bash
2
+
3
+ if ! pip show "connexion" > /dev/null 2>&1
4
+ then
5
+ echo "The 'connexion' package is not installed."
6
+ echo "Please install it by installing alpha-python with the 'flask' extras:"
7
+ echo "eg. 'pip install alpha-python[flask]'"
8
+ exit 1
9
+ fi
10
+
11
+ echo "Starting server on port ${PORT}..."
12
+ python ${API_LOCATION}/${PACKAGE_NAME}/__main__.py --port ${PORT}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: alpha-python
3
- Version: 0.2.0
3
+ Version: 0.2.2
4
4
  Summary: Alpha is intended to be the first dependency you need to add to your Python application. It is a Python library which contains standard building blocks that can be used in applications that are used as APIs and/or make use of database interaction.
5
5
  Author-email: Bart Reijling <bart@reijling.eu>
6
6
  Requires-Python: >=3.11
@@ -18,7 +18,7 @@ Requires-Dist: sqlalchemy>=2.0.44
18
18
  Requires-Dist: requests>=2.28.1
19
19
  Requires-Dist: dependency-injector<5.0.0,>=4.48.3
20
20
  Provides-Extra: api-generator
21
- Requires-Dist: openapi-generator-cli==7.14.0; extra == "api-generator"
21
+ Requires-Dist: openapi-generator-cli==7.14.0; (python_version >= "3.11" and python_version < "4.0") and extra == "api-generator"
22
22
  Requires-Dist: jdk4py; extra == "api-generator"
23
23
  Provides-Extra: flask
24
24
  Requires-Dist: connexion[swagger-ui]<3,>=2.14.2; extra == "flask"
@@ -30,39 +30,40 @@ src/alpha/factories/type_factories.py
30
30
  src/alpha/factories/models/__init__.py
31
31
  src/alpha/factories/models/factory_classes.py
32
32
  src/alpha/handlers/__init__.py
33
+ src/alpha/handlers/api_generate_handler.py
34
+ src/alpha/handlers/api_run_handler.py
33
35
  src/alpha/handlers/base_handler.py
34
- src/alpha/handlers/api/__init__.py
35
- src/alpha/handlers/api/api_generate_handler.py
36
- src/alpha/handlers/api/api_run_handler.py
37
- src/alpha/handlers/api/templates/__init__.py
38
- src/alpha/handlers/api/templates/python-flask/Dockerfile.mustache
39
- src/alpha/handlers/api/templates/python-flask/README.mustache
40
- src/alpha/handlers/api/templates/python-flask/__init__model.mustache
41
- src/alpha/handlers/api/templates/python-flask/__init__test.mustache
42
- src/alpha/handlers/api/templates/python-flask/__main__.mustache
43
- src/alpha/handlers/api/templates/python-flask/base_model.mustache
44
- src/alpha/handlers/api/templates/python-flask/controller.mustache
45
- src/alpha/handlers/api/templates/python-flask/controller_test.mustache
46
- src/alpha/handlers/api/templates/python-flask/dockerignore.mustache
47
- src/alpha/handlers/api/templates/python-flask/encoder.mustache
48
- src/alpha/handlers/api/templates/python-flask/git_push.sh.mustache
49
- src/alpha/handlers/api/templates/python-flask/gitignore.mustache
50
- src/alpha/handlers/api/templates/python-flask/model.mustache
51
- src/alpha/handlers/api/templates/python-flask/openapi.mustache
52
- src/alpha/handlers/api/templates/python-flask/param_type.mustache
53
- src/alpha/handlers/api/templates/python-flask/requirements.mustache
54
- src/alpha/handlers/api/templates/python-flask/security_controller_.mustache
55
- src/alpha/handlers/api/templates/python-flask/setup.mustache
56
- src/alpha/handlers/api/templates/python-flask/test-requirements.mustache
57
- src/alpha/handlers/api/templates/python-flask/tox.mustache
58
- src/alpha/handlers/api/templates/python-flask/travis.mustache
59
- src/alpha/handlers/api/templates/python-flask/typing_utils.mustache
60
- src/alpha/handlers/api/templates/python-flask/util.mustache
36
+ src/alpha/handlers/gen-code.sh
37
+ src/alpha/handlers/run-api.sh
61
38
  src/alpha/handlers/models/__init__.py
62
39
  src/alpha/handlers/models/argument.py
63
40
  src/alpha/handlers/models/command.py
64
41
  src/alpha/handlers/models/section.py
65
42
  src/alpha/handlers/models/subparser.py
43
+ src/alpha/handlers/templates/__init__.py
44
+ src/alpha/handlers/templates/python-flask/Dockerfile.mustache
45
+ src/alpha/handlers/templates/python-flask/README.mustache
46
+ src/alpha/handlers/templates/python-flask/__init__model.mustache
47
+ src/alpha/handlers/templates/python-flask/__init__test.mustache
48
+ src/alpha/handlers/templates/python-flask/__main__.mustache
49
+ src/alpha/handlers/templates/python-flask/base_model.mustache
50
+ src/alpha/handlers/templates/python-flask/controller.mustache
51
+ src/alpha/handlers/templates/python-flask/controller_test.mustache
52
+ src/alpha/handlers/templates/python-flask/dockerignore.mustache
53
+ src/alpha/handlers/templates/python-flask/encoder.mustache
54
+ src/alpha/handlers/templates/python-flask/git_push.sh.mustache
55
+ src/alpha/handlers/templates/python-flask/gitignore.mustache
56
+ src/alpha/handlers/templates/python-flask/model.mustache
57
+ src/alpha/handlers/templates/python-flask/openapi.mustache
58
+ src/alpha/handlers/templates/python-flask/param_type.mustache
59
+ src/alpha/handlers/templates/python-flask/requirements.mustache
60
+ src/alpha/handlers/templates/python-flask/security_controller_.mustache
61
+ src/alpha/handlers/templates/python-flask/setup.mustache
62
+ src/alpha/handlers/templates/python-flask/test-requirements.mustache
63
+ src/alpha/handlers/templates/python-flask/tox.mustache
64
+ src/alpha/handlers/templates/python-flask/travis.mustache
65
+ src/alpha/handlers/templates/python-flask/typing_utils.mustache
66
+ src/alpha/handlers/templates/python-flask/util.mustache
66
67
  src/alpha/infra/__init__.py
67
68
  src/alpha/infra/connectors/__init__.py
68
69
  src/alpha/infra/connectors/ldap_connector.py
@@ -11,9 +11,11 @@ requests>=2.28.1
11
11
  dependency-injector<5.0.0,>=4.48.3
12
12
 
13
13
  [api-generator]
14
- openapi-generator-cli==7.14.0
15
14
  jdk4py
16
15
 
16
+ [api-generator:python_version >= "3.11" and python_version < "4.0"]
17
+ openapi-generator-cli==7.14.0
18
+
17
19
  [flask]
18
20
  connexion[swagger-ui]<3,>=2.14.2
19
21
  swagger-ui-bundle>=0.0.2
File without changes
File without changes
File without changes
File without changes