[SYNPY-1798]: updated black to 26.3.1 and reran pre-commit#1341
[SYNPY-1798]: updated black to 26.3.1 and reran pre-commit#1341
Conversation
| 7. Delete wiki pages | ||
|
|
||
| """ | ||
|
|
There was a problem hiding this comment.
This is going to cause the line numbers in the tutorial to be incorrect by 1 line.
BryanFauble
left a comment
There was a problem hiding this comment.
Thanks for the updates. I didn't see any logic changes, just formatting updates. LGTM!
|
@linglp Should we put min version of back in the |
I think if you just do |
|
Wait for 4.12 release to be completed to merge |
There was a problem hiding this comment.
Pull request overview
Updates the repository’s formatting/tooling baseline by bumping the black pre-commit hook to 26.3.1, regenerating the Pipenv lockfile, and applying the resulting reformatting across code, tests, and docs.
Changes:
- Bumped
blackin.pre-commit-config.yamlto26.3.1. - Updated
Pipfile.lockto reflect the new formatter dependency set. - Ran pre-commit/black across the repo, producing mostly whitespace/format-only diffs (plus a few incidental code edits).
Reviewed changes
Copilot reviewed 82 out of 83 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/synapseutils/unit_test_synapseutils_walk.py | Reformatted multi-patch contexts |
| tests/unit/synapseutils/unit_test_synapseutils_sync.py | Reformatted multi-patch contexts |
| tests/unit/synapseutils/unit_test_synapseutils_monitor.py | Reformatted multi-patch contexts |
| tests/unit/synapseutils/unit_test_synapseutils_migrate.py | Reformatted SQL triple-quote usage |
| tests/unit/synapseutils/unit_test_synapseutils_describe.py | Reformatted multi-patch contexts |
| tests/unit/synapseutils/unit_test_synapseutils_copy.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/unit_test_tables.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/unit_test_get_permissions.py | Added blank line after docstring |
| tests/unit/synapseclient/unit_test_Entity.py | Tuple-unpacking style cleanup |
| tests/unit/synapseclient/unit_test_commandline.py | Docstring normalization |
| tests/unit/synapseclient/services/unit_test_json_schema.py | Added blank line after docstring |
| tests/unit/synapseclient/operations/unit_test_utility_operations.py | Added blank line after docstring |
| tests/unit/synapseclient/models/unit_test_entityview.py | Added blank line after docstring |
| tests/unit/synapseclient/models/synchronous/unit_test_docker.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/models/async/unit_test_wiki_async.py | Reformatted multi-patch/raises contexts |
| tests/unit/synapseclient/models/async/unit_test_submission_bundle_async.py | Reformatted async-for binding |
| tests/unit/synapseclient/models/async/unit_test_submission_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/models/async/unit_test_schema_organization_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/models/async/unit_test_recordset_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/models/async/unit_test_project_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/models/async/unit_test_link_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/models/async/unit_test_form_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/models/async/unit_test_folder_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/models/async/unit_test_file_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/models/async/unit_test_evaluation_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/models/async/unit_test_docker_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/models/async/unit_test_curation_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/extensions/unit_test_create_json_schema.py | Reformatted nested open() contexts |
| tests/unit/synapseclient/extensions/test_schema_management.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/core/upload/unit_test_multipart_upload.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/core/unit_test_version_check.py | Removed extra blank line |
| tests/unit/synapseclient/core/unit_test_sts_transfer.py | Reformatted conditional expression |
| tests/unit/synapseclient/core/unit_test_remote_storage_file_wrappers.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/core/unit_test_doze.py | Added blank line after module docstring |
| tests/unit/synapseclient/core/unit_test_Cache.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/core/multithread_download/unit_test_download_threads.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/core/download/unit_test_download_async.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/core/credentials/unit_test_cred_provider.py | Reformatted multi-patch contexts |
| tests/unit/synapseclient/api/unit_test_web_services.py | Added blank line after docstring |
| tests/unit/synapseclient/api/unit_test_entity_services.py | Added blank line after docstring |
| tests/test_utils.py | Trailing comma in signature |
| tests/integration/synapseclient/test_command_line_client.py | Reformatted multi-patch contexts |
| tests/integration/synapseclient/operations/async/test_utility_operations_async.py | Added blank line after docstring |
| tests/integration/synapseclient/operations/async/test_delete_operations_async.py | Added blank line after docstring |
| tests/integration/synapseclient/models/async/test_submission_bundle_async.py | Reformatted async-for binding |
| tests/integration/synapseclient/models/async/test_schema_organization_async.py | Added blank line after docstring |
| tests/integration/synapseclient/models/async/test_form_async.py | Added blank line after docstring |
| tests/integration/synapseclient/integration_test.py | Reformatted nested string writes |
| tests/integration/synapseclient/extensions/curator/test_schema_management.py | Added blank line after docstring |
| tests/integration/synapseclient/core/upload/test_multipart_upload.py | Tuple-unpacking style cleanup |
| tests/integration/synapseclient/core/upload/test_multipart_upload_async.py | Tuple-unpacking style cleanup |
| tests/integration/synapseclient/core/test_external_storage.py | Reformatted multi-patch contexts |
| synapseutils/sync.py | Formatting-only line wrapping |
| synapseutils/migrate_functions.py | Formatting-only SQL string wrapping |
| synapseclient/models/schema_organization.py | Trailing comma in signature |
| synapseclient/models/recordset.py | Formatting-only ternary wrapping |
| synapseclient/models/protocols/docker_protocol.py | Added blank line after docstring |
| synapseclient/models/mixins/table_components.py | Formatting-only line wrapping |
| synapseclient/models/link.py | Formatting-only ternary wrapping |
| synapseclient/models/file.py | Formatting-only ternary wrapping |
| synapseclient/models/entityview.py | Formatting-only ternary wrapping |
| synapseclient/models/curation.py | Trailing comma in signature |
| synapseclient/models/annotations.py | Signature formatting |
| synapseclient/models/agent.py | Formatting-only line wrapping |
| synapseclient/extensions/curator/schema_generation.py | Type-ignore spacing & commas |
| synapseclient/extensions/curator/record_based_metadata_task.py | Added blank line after docstring |
| synapseclient/core/utils.py | Trailing commas in signatures |
| synapseclient/core/transfer_bar.py | Added blank line after docstring |
| synapseclient/core/otel_config.py | Added blank line after docstring |
| synapseclient/core/models/custom_json.py | Added blank line after docstring |
| synapseclient/core/dozer.py | Added blank line after docstring |
| synapseclient/core/download/download_functions.py | Formatting-only await wrapping |
| synapseclient/client.py | Formatting-only line wrapping |
| synapseclient/api/file_services.py | Tuple-unpacking style cleanup |
| synapseclient/api/docker_commit_services.py | Added blank line after docstring |
| synapseclient/activity.py | Formatting-only line wrapping |
| Pipfile.lock | Updated lock for black 26.3.1 |
| docs/tutorials/python/wiki.md | Adjusted snippet line range |
| docs/tutorials/python/tutorial_scripts/wiki.py | Added blank line after docstring |
| docs/tutorials/python/tutorial_scripts/upload_data_in_bulk.py | Formatting-only line wrapping |
| docs/scripts/object_orientated_programming_poc/synapse_project.py | Added blank line after docstring |
| .pre-commit-config.yaml | Bumped black rev to 26.3.1 |
Comments suppressed due to low confidence (1)
tests/integration/synapseclient/test_command_line_client.py:947
- The call to
run(...)passes"synapse" "--skip-checks"which Python concatenates into a single argument ("synapse--skip-checks"). Sincerun()setssys.argvdirectly from these items, this will prevent argparse from seeing--skip-checksand likely makes the test fail. Pass these as separate arguments (e.g.,"synapse", "--skip-checks", ...).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| with ( | ||
| patch.object(self.syn, "get", return_value=self.file_ent) as patch_syn_get, | ||
| patch.object( | ||
| self.syn, "restGET", side_effects=[permissions, access_requirements] | ||
| ) as patch_rest_get, |
There was a problem hiding this comment.
In this patch context, patch.object(..., side_effects=[...]) uses an invalid keyword argument (side_effects). unittest.mock.patch expects side_effect, so this will raise a TypeError and the test will fail.
| file_handle_result: Dict[str, str] = ( | ||
| await get_file_handle_for_download_async( | ||
| file_handle_id=file_handle_id, | ||
| synapse_id=synapse_id, | ||
| entity_type=entity_type, |
There was a problem hiding this comment.
The type annotation for file_handle_result is incorrect: get_file_handle_for_download_async(...) returns a nested dict (e.g., containing a fileHandle dict), not Dict[str, str]. This annotation is misleading and will break static type checking; consider using Dict[str, Any] / Mapping[str, Any] (or a TypedDict) instead.
* [SYNPY-1798]: updated black to 26.3.1 and reran pre-commit (#1341) * update black to 26.3.1 and rerun pre-commit * update the tutorial line --------- Co-authored-by: Lingling Peng <lpeng@w290.local> Co-authored-by: Lingling Peng <lpeng@Mac.SageCorpWiFi> * [SYNPY-1764] Add Trivy container vulnerability scanning (#1346) * [SYNPY-1764] Add Trivy container vulnerability scanning to Docker build Add Trivy scanning to gate Docker image publication on GHCR. Both release and develop Docker jobs now follow a build→scan→push pattern where images are only pushed if no Critical/High unfixed vulnerabilities are found. New workflows: - trivy.yml: reusable Trivy scanning workflow with SARIF upload to GitHub Security tab - docker_build.yml: reusable build/scan/push workflow for image rebuilds - trivy_periodic_scan.yml: daily rescan of latest published image with auto-remediation * Address PR review feedback from linglp and jaymedina - Fix push jobs to load scanned tar instead of rebuilding (build.yml) - Pin trivy-action to SHA for v0.35.0 to address supply chain attack - Fix env.repo_name output using $GITHUB_OUTPUT (trivy_periodic_scan.yml) - Pin all third-party actions to commit SHAs - Remove unnecessary permissions on get-image-reference job - Use !cancelled() for SARIF upload condition (trivy.yml) - Use LOCAL_IMAGE_TAG env var instead of hardcoded string (docker_build.yml) - Fix IMAGE_REFERENCES YAML line continuation * Prevent infinite rebuild loop in periodic Trivy scan Restructure trivy_periodic_scan.yml so the git tag is only created after a successful rebuild (not before). If the rebuild still has vulnerabilities, a GitHub issue is opened for manual triage instead of looping endlessly. - Rename bump-tag → compute-next-version (dry_run: true) - Add create-tag job gated on update-image success - Add alert-on-failure job that opens a GitHub issue with duplicate prevention when remediation fails * pre-commit * Update Trivy scan workflow to use previous tag and adjust image references * Address PR review feedback - Pin codeql-action/upload-sarif to SHA and upgrade to v3.35.1 - Guard update-image job on compute-next-version success - Use absolute URL for Security tab link in auto-created issues * Add actions read permission for Trivy scan job (#1355) * Add optional ARTIFACT_NAME_SUFFIX input to Trivy workflow and update artifact naming (#1357) * remove sort --------- Co-authored-by: Lingling <55448354+linglp@users.noreply.github.com> Co-authored-by: Lingling Peng <lpeng@w290.local> Co-authored-by: Lingling Peng <lpeng@Mac.SageCorpWiFi> Co-authored-by: BryanFauble <17128019+BryanFauble@users.noreply.github.com>
Problem:
There's a high security risk of black

23.3.0. I updated black to the latest version of26.3.1see: https://github.com/Sage-Bionetworks/synapsePythonClient/security/dependabot/42
Solution:
blackin pre-commit to26.3.1black