Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DDO-3848] Add Python client #639

Merged
merged 3 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions .github/workflows/sherlock-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,29 @@ jobs:
working-directory: sherlock-go-client
run: go mod tidy

- name: Delete existing Python client library code
# Just delete code, not config, so that no-longer-generated files will disappear
run: rm -rf sherlock-python-client/docs sherlock-python-client/sherlock_python_client sherlock-python-client/test

- name: Generate Python client library
run: |
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
-i /local/sherlock/docs/swagger.json \
-g python \
-o /local/sherlock-python-client \
--git-user-id broadinstitute \
--git-repo-id sherlock \
--additional-properties=disallowAdditionalPropertiesIfNotPresent=false \
--additional-properties=packageName=sherlock_python_client \
--additional-properties=packageUrl='git+https://github.com/broadinstitute/sherlock#subdirectory=sherlock-python-client' \
--additional-properties=packageVersion=${{ needs.generate-tag.outputs.tag }}

- name: Fix Python documentation
run: |
cat sherlock-python-client/README-header.md sherlock-python-client/README.md > temp
mv temp sherlock-python-client/README.md
cp sherlock-python-client/README.md sherlock-python-client/sherlock_python_client_README.md

- name: Delete existing Typescript client library code
# Just delete code, not config, so that no-longer-generated files will disappear
run: rm -rf sherlock-typescript-client/src
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@ gha-creds-*.json

# Ignore environment variable files
.env

# Ignore generated CI files from the Python client library
sherlock-python-client/.github/
sherlock-python-client/.gitlab-ci.yml
sherlock-python-client/.travis.yml
sherlock-python-client/git_push.sh
66 changes: 66 additions & 0 deletions sherlock-python-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.venv/
.python-version
.pytest_cache

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints
25 changes: 25 additions & 0 deletions sherlock-python-client/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

README-header.md
184 changes: 184 additions & 0 deletions sherlock-python-client/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
.github/workflows/python.yml
.gitignore
.gitlab-ci.yml
.travis.yml
README.md
docs/AppVersionsApi.md
docs/ChangesetsApi.md
docs/ChartReleasesApi.md
docs/ChartVersionsApi.md
docs/ChartsApi.md
docs/CiIdentifiersApi.md
docs/CiRunsApi.md
docs/ClustersApi.md
docs/DatabaseInstancesApi.md
docs/DeployHooksApi.md
docs/EnvironmentsApi.md
docs/ErrorsErrorResponse.md
docs/GitCommitsApi.md
docs/GithubActionsJobsApi.md
docs/IncidentsApi.md
docs/MiscApi.md
docs/MiscConnectionCheckResponse.md
docs/MiscStatusResponse.md
docs/MiscVersionResponse.md
docs/PagerdutyAlertSummary.md
docs/PagerdutyIntegrationsApi.md
docs/PagerdutySendAlertResponse.md
docs/RoleAssignmentsApi.md
docs/RolesApi.md
docs/SherlockAppVersionV3.md
docs/SherlockAppVersionV3ChangelogResponse.md
docs/SherlockAppVersionV3Create.md
docs/SherlockAppVersionV3Edit.md
docs/SherlockChangesetV3.md
docs/SherlockChangesetV3PlanRequest.md
docs/SherlockChangesetV3PlanRequestChartReleaseEntry.md
docs/SherlockChangesetV3PlanRequestEnvironmentEntry.md
docs/SherlockChartReleaseV3.md
docs/SherlockChartReleaseV3Create.md
docs/SherlockChartReleaseV3Edit.md
docs/SherlockChartV3.md
docs/SherlockChartV3Create.md
docs/SherlockChartV3Edit.md
docs/SherlockChartVersionV3.md
docs/SherlockChartVersionV3ChangelogResponse.md
docs/SherlockChartVersionV3Create.md
docs/SherlockChartVersionV3Edit.md
docs/SherlockCiIdentifierV3.md
docs/SherlockCiRunV3.md
docs/SherlockCiRunV3Upsert.md
docs/SherlockClusterV3.md
docs/SherlockClusterV3Create.md
docs/SherlockClusterV3Edit.md
docs/SherlockDatabaseInstanceV3.md
docs/SherlockDatabaseInstanceV3Create.md
docs/SherlockDatabaseInstanceV3Edit.md
docs/SherlockEnvironmentV3.md
docs/SherlockEnvironmentV3Create.md
docs/SherlockEnvironmentV3Edit.md
docs/SherlockGitCommitV3.md
docs/SherlockGitCommitV3Upsert.md
docs/SherlockGithubActionsDeployHookTestRunRequest.md
docs/SherlockGithubActionsDeployHookTestRunResponse.md
docs/SherlockGithubActionsDeployHookV3.md
docs/SherlockGithubActionsDeployHookV3Create.md
docs/SherlockGithubActionsDeployHookV3Edit.md
docs/SherlockGithubActionsJobV3.md
docs/SherlockGithubActionsJobV3Create.md
docs/SherlockIncidentV3.md
docs/SherlockIncidentV3Create.md
docs/SherlockIncidentV3Edit.md
docs/SherlockPagerdutyIntegrationV3.md
docs/SherlockPagerdutyIntegrationV3Create.md
docs/SherlockPagerdutyIntegrationV3Edit.md
docs/SherlockRoleAssignmentV3.md
docs/SherlockRoleAssignmentV3Edit.md
docs/SherlockRoleV3.md
docs/SherlockRoleV3Edit.md
docs/SherlockSlackDeployHookTestRunRequest.md
docs/SherlockSlackDeployHookTestRunResponse.md
docs/SherlockSlackDeployHookV3.md
docs/SherlockSlackDeployHookV3Create.md
docs/SherlockSlackDeployHookV3Edit.md
docs/SherlockUserV3.md
docs/SherlockUserV3Upsert.md
docs/UsersApi.md
git_push.sh
pyproject.toml
requirements.txt
setup.cfg
setup.py
sherlock_python_client/__init__.py
sherlock_python_client/api/__init__.py
sherlock_python_client/api/app_versions_api.py
sherlock_python_client/api/changesets_api.py
sherlock_python_client/api/chart_releases_api.py
sherlock_python_client/api/chart_versions_api.py
sherlock_python_client/api/charts_api.py
sherlock_python_client/api/ci_identifiers_api.py
sherlock_python_client/api/ci_runs_api.py
sherlock_python_client/api/clusters_api.py
sherlock_python_client/api/database_instances_api.py
sherlock_python_client/api/deploy_hooks_api.py
sherlock_python_client/api/environments_api.py
sherlock_python_client/api/git_commits_api.py
sherlock_python_client/api/github_actions_jobs_api.py
sherlock_python_client/api/incidents_api.py
sherlock_python_client/api/misc_api.py
sherlock_python_client/api/pagerduty_integrations_api.py
sherlock_python_client/api/role_assignments_api.py
sherlock_python_client/api/roles_api.py
sherlock_python_client/api/users_api.py
sherlock_python_client/api_client.py
sherlock_python_client/api_response.py
sherlock_python_client/configuration.py
sherlock_python_client/exceptions.py
sherlock_python_client/models/__init__.py
sherlock_python_client/models/errors_error_response.py
sherlock_python_client/models/misc_connection_check_response.py
sherlock_python_client/models/misc_status_response.py
sherlock_python_client/models/misc_version_response.py
sherlock_python_client/models/pagerduty_alert_summary.py
sherlock_python_client/models/pagerduty_send_alert_response.py
sherlock_python_client/models/sherlock_app_version_v3.py
sherlock_python_client/models/sherlock_app_version_v3_changelog_response.py
sherlock_python_client/models/sherlock_app_version_v3_create.py
sherlock_python_client/models/sherlock_app_version_v3_edit.py
sherlock_python_client/models/sherlock_changeset_v3.py
sherlock_python_client/models/sherlock_changeset_v3_plan_request.py
sherlock_python_client/models/sherlock_changeset_v3_plan_request_chart_release_entry.py
sherlock_python_client/models/sherlock_changeset_v3_plan_request_environment_entry.py
sherlock_python_client/models/sherlock_chart_release_v3.py
sherlock_python_client/models/sherlock_chart_release_v3_create.py
sherlock_python_client/models/sherlock_chart_release_v3_edit.py
sherlock_python_client/models/sherlock_chart_v3.py
sherlock_python_client/models/sherlock_chart_v3_create.py
sherlock_python_client/models/sherlock_chart_v3_edit.py
sherlock_python_client/models/sherlock_chart_version_v3.py
sherlock_python_client/models/sherlock_chart_version_v3_changelog_response.py
sherlock_python_client/models/sherlock_chart_version_v3_create.py
sherlock_python_client/models/sherlock_chart_version_v3_edit.py
sherlock_python_client/models/sherlock_ci_identifier_v3.py
sherlock_python_client/models/sherlock_ci_run_v3.py
sherlock_python_client/models/sherlock_ci_run_v3_upsert.py
sherlock_python_client/models/sherlock_cluster_v3.py
sherlock_python_client/models/sherlock_cluster_v3_create.py
sherlock_python_client/models/sherlock_cluster_v3_edit.py
sherlock_python_client/models/sherlock_database_instance_v3.py
sherlock_python_client/models/sherlock_database_instance_v3_create.py
sherlock_python_client/models/sherlock_database_instance_v3_edit.py
sherlock_python_client/models/sherlock_environment_v3.py
sherlock_python_client/models/sherlock_environment_v3_create.py
sherlock_python_client/models/sherlock_environment_v3_edit.py
sherlock_python_client/models/sherlock_git_commit_v3.py
sherlock_python_client/models/sherlock_git_commit_v3_upsert.py
sherlock_python_client/models/sherlock_github_actions_deploy_hook_test_run_request.py
sherlock_python_client/models/sherlock_github_actions_deploy_hook_test_run_response.py
sherlock_python_client/models/sherlock_github_actions_deploy_hook_v3.py
sherlock_python_client/models/sherlock_github_actions_deploy_hook_v3_create.py
sherlock_python_client/models/sherlock_github_actions_deploy_hook_v3_edit.py
sherlock_python_client/models/sherlock_github_actions_job_v3.py
sherlock_python_client/models/sherlock_github_actions_job_v3_create.py
sherlock_python_client/models/sherlock_incident_v3.py
sherlock_python_client/models/sherlock_incident_v3_create.py
sherlock_python_client/models/sherlock_incident_v3_edit.py
sherlock_python_client/models/sherlock_pagerduty_integration_v3.py
sherlock_python_client/models/sherlock_pagerduty_integration_v3_create.py
sherlock_python_client/models/sherlock_pagerduty_integration_v3_edit.py
sherlock_python_client/models/sherlock_role_assignment_v3.py
sherlock_python_client/models/sherlock_role_assignment_v3_edit.py
sherlock_python_client/models/sherlock_role_v3.py
sherlock_python_client/models/sherlock_role_v3_edit.py
sherlock_python_client/models/sherlock_slack_deploy_hook_test_run_request.py
sherlock_python_client/models/sherlock_slack_deploy_hook_test_run_response.py
sherlock_python_client/models/sherlock_slack_deploy_hook_v3.py
sherlock_python_client/models/sherlock_slack_deploy_hook_v3_create.py
sherlock_python_client/models/sherlock_slack_deploy_hook_v3_edit.py
sherlock_python_client/models/sherlock_user_v3.py
sherlock_python_client/models/sherlock_user_v3_upsert.py
sherlock_python_client/py.typed
sherlock_python_client/rest.py
test-requirements.txt
test/__init__.py
tox.ini
1 change: 1 addition & 0 deletions sherlock-python-client/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.8.0
17 changes: 17 additions & 0 deletions sherlock-python-client/README-header.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
> [!IMPORTANT]
>
> The README is autogenerated and it's wrong in a few places.
>
> Use the following to install the library:
>
> ```python
> python -m pip install git+https://github.com/broadinstitute/sherlock#subdirectory=sherlock-python-client
> ```
>
> You'll need to authenticate through Identity Aware Proxy. Consider using [Thelma](https://github.com/broadinstitute/thelma) ([installation](https://github.com/broadinstitute/terra-helmfile/blob/master/bin/install-thelma)) to provide a bearer token:
>
> ```shell
> thelma auth iap --echo
> ```
>

Loading
Loading