diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c3a2a036..dcfa1e56 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.11' - name: Init python poetry action uses: abatilo/actions-poetry@v3.0.0 with: diff --git a/.gitignore b/.gitignore index 68fdf24e..ac3aa17f 100644 --- a/.gitignore +++ b/.gitignore @@ -144,4 +144,4 @@ cython_debug/ .pytest_cache # pycharm -.idea \ No newline at end of file +.idea diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 15b8d6da..a9c1bf8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,11 @@ repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-toml + - id: check-added-large-files - repo: local hooks: - id: black @@ -31,4 +38,4 @@ repos: - id: ruff args: - --fix - exclude: ^(tests/.*|examples/.*|docs/.*)$ \ No newline at end of file + exclude: ^(tests/.*|examples/.*|docs/.*)$ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c6d8e7a0..a01c83ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,19 +1,19 @@ # Contributing When contributing to this repository, please first discuss the change you wish to make via issue, -email, or any other method with the owners of this repository before making a change. +email, or any other method with the owners of this repository before making a change. Please note we have a code of conduct, please follow it in all your interactions with the project. ## Pull Request Process -1. Ensure any install or build dependencies are removed before the end of the layer when doing a +1. Ensure any install or build dependencies are removed before the end of the layer when doing a build. -2. Update the README.md with details of changes to the interface, this includes new environment +2. Update the README.md with details of changes to the interface, this includes new environment variables, useful file locations etc. 3. Increase the version numbers in any examples files and the README.md to the new version that this Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). -4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you +4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you do not have permission to do that, you may request the second reviewer to merge it for you. ## Code of Conduct diff --git a/docs/channels.rst b/docs/channels.rst index cb47d982..b9ed5fac 100644 --- a/docs/channels.rst +++ b/docs/channels.rst @@ -6,19 +6,19 @@ In order to instantiate a ZeebeWorker or ZeebeClient you will need to provide an This Channel can be configured with the parameters `channel_credentials` and `channel_options`. .. seealso:: - + `Python Channel Options `_ Documentation of the available Python `grpc.aio.Channel` `options` (channel_arguments). .. note:: - + By default, channel_options is defined so that the grpc.keepalive_time_ms option is always set to 45_000 (45 seconds). Reference Camunda Docs `keep alive intervals `_. You can override the default `channel_options` by passing e.g. `channel_options = (("grpc.keepalive_time_ms", 60_000),)` - for a keepalive time of 60 seconds. - + Pyzeebe provides a couple standard ways to achieve this: @@ -81,7 +81,7 @@ Oauth2 Client Credentials Channel .. autofunction:: pyzeebe.channel.oauth_channel.create_oauth2_client_credentials_channel -.. warning:: +.. warning:: Some arguments are Optional and are highly dependent on your Authentication Server configuration, `scope` is usually required and is often optional `audience` . @@ -181,5 +181,5 @@ Example: from pyzeebe.channel.camunda_cloud_channel import create_camunda_cloud_channel - + channel = create_camunda_cloud_channel("client_id", "client_secret", "cluster_id") diff --git a/docs/credentials.rst b/docs/credentials.rst index fa06f38a..0265bbbd 100644 --- a/docs/credentials.rst +++ b/docs/credentials.rst @@ -9,7 +9,7 @@ Oauth2 Client Credentials Plugin :members: :special-members: :private-members: - + Example: .. code-block:: python @@ -54,4 +54,4 @@ Internal (Deprecated) .. autoclass:: pyzeebe.CamundaIdentityCredentials :members: - :undoc-members: \ No newline at end of file + :undoc-members: diff --git a/docs/worker_quickstart.rst b/docs/worker_quickstart.rst index 1fd6b724..264134af 100644 --- a/docs/worker_quickstart.rst +++ b/docs/worker_quickstart.rst @@ -27,11 +27,11 @@ Run using event loop .. warning:: Calling ``worker.work`` directly using ``asyncio.run`` will not work. When you create an async grpc channel a new event loop will automatically be created, which causes problems when running the worker (see: https://github.com/camunda-community-hub/pyzeebe/issues/198). - + An easy workaround: .. code-block:: python - + async def main(): channel = create_insecure_channel() worker = ZeebeWorker(channel) @@ -86,4 +86,3 @@ To stop a running worker: # Trigger this on some event (SIGTERM for example) async def shutdown(): await worker.stop() - diff --git a/docs/worker_tasks.rst b/docs/worker_tasks.rst index 42183194..5098499b 100644 --- a/docs/worker_tasks.rst +++ b/docs/worker_tasks.rst @@ -31,7 +31,7 @@ Tasks can be regular or async functions. If given a regular function, pyzeebe wi .. note:: Make sure not to call any blocking function in an async task. This would slow the entire worker down. - + Do: .. code-block:: python @@ -87,7 +87,7 @@ This tells Zeebe that the job failed. The job will then be retried (if configure .. note:: The exception handler can also be set via :py:class:`pyzeebe.ZeebeWorker` or :py:class:`pyzeebe.ZeebeTaskRouter`. - Pyzeebe will try to find the exception handler in the following order: + Pyzeebe will try to find the exception handler in the following order: ``Worker`` -> ``Router`` -> ``Task`` -> :py:func:`pyzeebe.default_exception_handler` diff --git a/pyproject.toml b/pyproject.toml index d317a4da..c61c1a4b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,9 +50,9 @@ strict = true [[tool.mypy.overrides]] module = [ - "grpc", - "zeebe_grpc.gateway_pb2", - "zeebe_grpc.gateway_pb2_grpc", + "grpc", + "zeebe_grpc.gateway_pb2", + "zeebe_grpc.gateway_pb2_grpc", ] ignore_missing_imports = true