|
13 | 13 | # See the License for the specific language governing permissions and
|
14 | 14 | # limitations under the License.
|
15 | 15 | #
|
16 |
| - |
| 16 | +import os |
17 | 17 | import pathlib
|
18 | 18 | import shutil
|
19 | 19 |
|
|
28 | 28 | },
|
29 | 29 | "api/connection.md": {
|
30 | 30 | "connection_create": ["hopsworks.connection.Connection.connection"],
|
31 |
| - "connection_properties": keras_autodoc.get_properties("hopsworks.connection.Connection"), |
| 31 | + "connection_properties": keras_autodoc.get_properties( |
| 32 | + "hopsworks.connection.Connection" |
| 33 | + ), |
32 | 34 | "connection_methods": keras_autodoc.get_methods(
|
33 | 35 | "hopsworks.connection.Connection", exclude=["from_response_json", "json"]
|
34 | 36 | ),
|
|
56 | 58 | "api/executions.md": {
|
57 | 59 | "execution_create": ["hopsworks.job.Job.run"],
|
58 | 60 | "execution_get": ["hopsworks.job.Job.get_executions"],
|
59 |
| - "execution_properties": keras_autodoc.get_properties("hopsworks.execution.Execution"), |
| 61 | + "execution_properties": keras_autodoc.get_properties( |
| 62 | + "hopsworks.execution.Execution" |
| 63 | + ), |
60 | 64 | "execution_methods": keras_autodoc.get_methods(
|
61 |
| - "hopsworks.execution.Execution", exclude=["from_response_json", "json", "update_from_response_json"] |
| 65 | + "hopsworks.execution.Execution", |
| 66 | + exclude=["from_response_json", "json", "update_from_response_json"], |
62 | 67 | ),
|
63 | 68 | },
|
64 | 69 | "api/flink_cluster.md": {
|
65 | 70 | "flink_api_handle": ["hopsworks.project.Project.get_flink_cluster_api"],
|
66 |
| - "setup_cluster": ["hopsworks.core.flink_cluster_api.FlinkClusterApi.setup_cluster"], |
| 71 | + "setup_cluster": [ |
| 72 | + "hopsworks.core.flink_cluster_api.FlinkClusterApi.setup_cluster" |
| 73 | + ], |
67 | 74 | "get_cluster": ["hopsworks.core.flink_cluster_api.FlinkClusterApi.get_cluster"],
|
68 | 75 | "start_cluster": ["hopsworks.flink_cluster.FlinkCluster.start"],
|
69 | 76 | "submit_job_to_cluster": ["hopsworks.flink_cluster.FlinkCluster.submit_job"],
|
70 |
| - "flink_cluster_properties": keras_autodoc.get_properties("hopsworks.flink_cluster.FlinkCluster"), |
| 77 | + "flink_cluster_properties": keras_autodoc.get_properties( |
| 78 | + "hopsworks.flink_cluster.FlinkCluster" |
| 79 | + ), |
71 | 80 | "flink_cluster_methods": keras_autodoc.get_methods(
|
72 |
| - "hopsworks.flink_cluster.FlinkCluster", exclude=["from_response_json", "json"] |
| 81 | + "hopsworks.flink_cluster.FlinkCluster", |
| 82 | + exclude=["from_response_json", "json"], |
73 | 83 | ),
|
74 | 84 | },
|
75 | 85 | "api/environment.md": {
|
76 | 86 | "env_api_handle": ["hopsworks.project.Project.get_environment_api"],
|
77 |
| - "env_create": ["hopsworks.core.environment_api.EnvironmentApi.create_environment"], |
| 87 | + "env_create": [ |
| 88 | + "hopsworks.core.environment_api.EnvironmentApi.create_environment" |
| 89 | + ], |
78 | 90 | "env_get": ["hopsworks.core.environment_api.EnvironmentApi.get_environment"],
|
79 | 91 | "env_methods": keras_autodoc.get_methods(
|
80 | 92 | "hopsworks.environment.Environment", exclude=["from_response_json", "json"]
|
|
85 | 97 | "git_repo_clone": ["hopsworks.core.git_api.GitApi.clone"],
|
86 | 98 | "git_repo_get": ["hopsworks.core.git_api.GitApi.get_repo"],
|
87 | 99 | "git_repo_get_all": ["hopsworks.core.git_api.GitApi.get_repos"],
|
88 |
| - "git_repo_properties": keras_autodoc.get_properties("hopsworks.git_repo.GitRepo"), |
| 100 | + "git_repo_properties": keras_autodoc.get_properties( |
| 101 | + "hopsworks.git_repo.GitRepo" |
| 102 | + ), |
89 | 103 | "git_repo_methods": keras_autodoc.get_methods(
|
90 | 104 | "hopsworks.git_repo.GitRepo", exclude=["from_response_json", "json"]
|
91 | 105 | ),
|
|
95 | 109 | "git_provider_create": ["hopsworks.core.git_api.GitApi.set_provider"],
|
96 | 110 | "git_provider_get": ["hopsworks.core.git_api.GitApi.get_provider"],
|
97 | 111 | "git_provider_get_all": ["hopsworks.core.git_api.GitApi.get_providers"],
|
98 |
| - "git_provider_properties": keras_autodoc.get_properties("hopsworks.git_provider.GitProvider"), |
| 112 | + "git_provider_properties": keras_autodoc.get_properties( |
| 113 | + "hopsworks.git_provider.GitProvider" |
| 114 | + ), |
99 | 115 | "git_provider_methods": keras_autodoc.get_methods(
|
100 | 116 | "hopsworks.git_provider.GitProvider", exclude=["from_response_json", "json"]
|
101 | 117 | ),
|
|
105 | 121 | "git_remote_create": ["hopsworks.git_repo.GitRepo.add_remote"],
|
106 | 122 | "git_remote_get": ["hopsworks.git_repo.GitRepo.get_remote"],
|
107 | 123 | "git_remote_get_all": ["hopsworks.git_repo.GitRepo.get_remotes"],
|
108 |
| - "git_remote_properties": keras_autodoc.get_properties("hopsworks.git_remote.GitRemote"), |
| 124 | + "git_remote_properties": keras_autodoc.get_properties( |
| 125 | + "hopsworks.git_remote.GitRemote" |
| 126 | + ), |
109 | 127 | "git_remote_methods": keras_autodoc.get_methods(
|
110 | 128 | "hopsworks.git_remote.GitRemote", exclude=["from_response_json", "json"]
|
111 | 129 | ),
|
|
122 | 140 | "kafka_topic_create": ["hopsworks.core.kafka_api.KafkaApi.create_topic"],
|
123 | 141 | "kafka_topic_get": ["hopsworks.core.kafka_api.KafkaApi.get_topic"],
|
124 | 142 | "kafka_topic_get_all": ["hopsworks.core.kafka_api.KafkaApi.get_topics"],
|
125 |
| - "kafka_topic_properties": keras_autodoc.get_properties("hopsworks.kafka_topic.KafkaTopic"), |
| 143 | + "kafka_topic_properties": keras_autodoc.get_properties( |
| 144 | + "hopsworks.kafka_topic.KafkaTopic" |
| 145 | + ), |
126 | 146 | "kafka_topic_methods": keras_autodoc.get_methods(
|
127 |
| - "hopsworks.kafka_topic.KafkaTopic", exclude=["from_response_json", "json", "update_from_response_json"] |
| 147 | + "hopsworks.kafka_topic.KafkaTopic", |
| 148 | + exclude=["from_response_json", "json", "update_from_response_json"], |
128 | 149 | ),
|
129 | 150 | },
|
130 | 151 | "api/kafka_schema.md": {
|
|
133 | 154 | "kafka_schema_get": ["hopsworks.core.kafka_api.KafkaApi.get_schema"],
|
134 | 155 | "kafka_schema_get_all": ["hopsworks.core.kafka_api.KafkaApi.get_schemas"],
|
135 | 156 | "kafka_schema_get_subjects": ["hopsworks.core.kafka_api.KafkaApi.get_subjects"],
|
136 |
| - "kafka_schema_properties": keras_autodoc.get_properties("hopsworks.kafka_schema.KafkaSchema"), |
| 157 | + "kafka_schema_properties": keras_autodoc.get_properties( |
| 158 | + "hopsworks.kafka_schema.KafkaSchema" |
| 159 | + ), |
137 | 160 | "kafka_schema_methods": keras_autodoc.get_methods(
|
138 |
| - "hopsworks.kafka_schema.KafkaSchema", exclude=["from_response_json", "json", "update_from_response_json"] |
| 161 | + "hopsworks.kafka_schema.KafkaSchema", |
| 162 | + exclude=["from_response_json", "json", "update_from_response_json"], |
139 | 163 | ),
|
140 | 164 | },
|
141 | 165 | "api/secrets.md": {
|
|
157 | 181 | }
|
158 | 182 |
|
159 | 183 | hw_dir = pathlib.Path(__file__).resolve().parents[0]
|
| 184 | +if "GITHUB_SHA" in os.environ: |
| 185 | + commit_sha = os.environ["GITHUB_SHA"] |
| 186 | + project_url = ( |
| 187 | + f"https://github.com/logicalclocks/feature-store-api/tree/{commit_sha}/python" |
| 188 | + ) |
| 189 | +else: |
| 190 | + branch_name = os.environ.get("GITHUB_BASE_REF", "master") |
| 191 | + project_url = ( |
| 192 | + f"https://github.com/logicalclocks/feature-store-api/blob/{branch_name}/python" |
| 193 | + ) |
160 | 194 |
|
161 | 195 |
|
162 | 196 | def generate(dest_dir):
|
163 | 197 | doc_generator = keras_autodoc.DocumentationGenerator(
|
164 | 198 | PAGES,
|
165 |
| - project_url="https://github.com/logicalclocks/hopsworks-api/blob/master/python", |
| 199 | + project_url=project_url, |
166 | 200 | template_dir="./docs/templates",
|
167 | 201 | titles_size="###",
|
168 | 202 | extra_aliases={},
|
|
0 commit comments