diaspora-event-sdk 0.3.1__py3-none-any.whl → 0.3.4__py3-none-any.whl

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.
@@ -26,15 +26,25 @@ def get_diaspora_config(extra_configs: Dict[str, Any] = {}) -> Dict[str, Any]:
26
26
  Retrieve default Diaspora event fabric connection configurations for Kafka clients.
27
27
  Merges default configurations with custom ones provided.
28
28
  """
29
+
30
+ bootstrap_servers = None
29
31
  try:
30
- keys = Client().retrieve_key()
31
- os.environ["AWS_ACCESS_KEY_ID"] = keys["access_key"]
32
- os.environ["AWS_SECRET_ACCESS_KEY"] = keys["secret_key"]
32
+ if (
33
+ "OCTOPUS_AWS_ACCESS_KEY_ID" not in os.environ
34
+ and "OCTOPUS_AWS_SECRET_ACCESS_KEY" not in os.environ
35
+ and "OCTOPUS_BOOTSTRAP_SERVERS" not in os.environ
36
+ ):
37
+ keys = Client().retrieve_key()
38
+ os.environ["OCTOPUS_AWS_ACCESS_KEY_ID"] = keys["access_key"]
39
+ os.environ["OCTOPUS_AWS_SECRET_ACCESS_KEY"] = keys["secret_key"]
40
+ bootstrap_servers = keys["endpoint"]
41
+ else:
42
+ bootstrap_servers = os.environ["OCTOPUS_BOOTSTRAP_SERVERS"]
33
43
  except Exception as e:
34
44
  raise RuntimeError("Failed to retrieve Kafka keys") from e
35
45
 
36
46
  conf = {
37
- "bootstrap_servers": keys["endpoint"],
47
+ "bootstrap_servers": bootstrap_servers,
38
48
  "security_protocol": "SASL_SSL",
39
49
  "sasl_mechanism": "OAUTHBEARER",
40
50
  "api_version": (3, 5, 1),
@@ -1 +1 @@
1
- __version__ = "0.3.1"
1
+ __version__ = "0.3.4"
@@ -0,0 +1,65 @@
1
+ Metadata-Version: 2.1
2
+ Name: diaspora-event-sdk
3
+ Version: 0.3.4
4
+ Summary: Diaspora Event Fabric SDK
5
+ Home-page: https://github.com/globus-labs/diaspora-event-sdk
6
+ License: Apache 2.0
7
+ Classifier: Development Status :: 5 - Production/Stable
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: License :: OSI Approved :: Apache Software License
10
+ Classifier: Programming Language :: Python
11
+ Classifier: Programming Language :: Python :: 3.7
12
+ Classifier: Programming Language :: Python :: 3.8
13
+ Classifier: Programming Language :: Python :: 3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: globus-sdk<4,>=3.20.1
20
+ Provides-Extra: kafka-python
21
+ Requires-Dist: kafka-python; extra == "kafka-python"
22
+ Provides-Extra: test
23
+ Requires-Dist: pytest; extra == "test"
24
+ Requires-Dist: pytest-cov; extra == "test"
25
+ Requires-Dist: coverage; extra == "test"
26
+ Requires-Dist: mypy; extra == "test"
27
+ Requires-Dist: tox; extra == "test"
28
+ Requires-Dist: check-manifest; extra == "test"
29
+ Requires-Dist: pre-commit; extra == "test"
30
+
31
+ # Diaspora Event Fabric SDK
32
+
33
+ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/globus-labs/diaspora-event-sdk/main.svg)](https://results.pre-commit.ci/latest/github/globus-labs/diaspora-event-sdk/main)
34
+ [![Tests](https://github.com/globus-labs/diaspora-event-sdk/actions/workflows/tests.yml/badge.svg)](https://github.com/globus-labs/diaspora-event-sdk/actions/workflows/tests.yml)
35
+ [![Release](https://github.com/globus-labs/diaspora-event-sdk/actions/workflows/release.yml/badge.svg)](https://github.com/globus-labs/diaspora-event-sdk/actions/workflows/release.yml)
36
+ [![GitHub Release](https://img.shields.io/github/v/release/globus-labs/diaspora-event-sdk?color=teal)](https://github.com/globus-labs/diaspora-event-sdk/releases)
37
+ [![PyPI Version](https://img.shields.io/pypi/v/diaspora-event-sdk?color=teal)](https://pypi.org/project/diaspora-event-sdk/)
38
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
39
+ [![Python Versions](https://img.shields.io/pypi/pyversions/diaspora-event-sdk.svg)](https://pypi.org/project/diaspora-event-sdk/)
40
+
41
+
42
+ ## Installation Guide
43
+ ### Recommended Method: With `kafka-python`
44
+ To integrate with Diaspora Event Fabric using `KafkaProducer` and `KafkaConsumer`, install the SDK with `kafka-python`:
45
+ ```bash
46
+ pip install "diaspora-event-sdk[kafka-python]"
47
+ ```
48
+
49
+ ### Alternative Installation: Without Kafka Client Library
50
+ For other Kafka client libraries (e.g., `confluent-kafka-python`, `aiokafka`), install the SDK without `kafka-python`:
51
+ ```bash
52
+ pip install diaspora-event-sdk
53
+ ```
54
+ Note: This does not include `KafkaProducer` and `KafkaConsumer` dependencies.
55
+
56
+ ## Using Diaspora Event Fabric SDK
57
+ Check our [Notebook](DiasporaDemo.ipynb) for a quickstart and demonstration.
58
+
59
+ <!-- **Getting Started**: Visit our [QuickStart Guide](docs/quickstart.md) for details on using the SDK with the kafka-python library and instructions for other Kafka clients.
60
+
61
+ **Troubleshooting and Credential Management**: Consult our [TrobleShooting Guide](docs/troubleshooting.md) for solving common issues and tips on managing keys effectively. -->
62
+
63
+ <!-- **Advanced Consumers with Faust**: Explore the [Faust Streaming Guide](docs/faust_weather_app.md) for advanced event streaming with Faust. -->
64
+
65
+ <!-- **Advanced Consumer Functions**: See our [Colab example](https://colab.research.google.com/drive/1tPKfxU2qPsLvNTreF6nKINU62k7pQWxa?usp=sharing) for demonstration. -->
@@ -1,11 +1,11 @@
1
1
  diaspora_event_sdk/__init__.py,sha256=x5A69JeA_iNi0i1XK3T2wuSTiOLxRhNdGYN4G39wtFw,455
2
- diaspora_event_sdk/version.py,sha256=r4xAFihOf72W9TD-lpMi6ntWSTKTP2SlzKP1ytkjRbI,22
2
+ diaspora_event_sdk/version.py,sha256=oYLGMpySamd16KLiaBTfRyrAS7_oyp-TOEHmzmeumwg,22
3
3
  diaspora_event_sdk/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  diaspora_event_sdk/sdk/_environments.py,sha256=lrdUaBCmlv6kESLi3O9EN6cMGXEylO8zWQX7NQ8OKCQ,684
5
5
  diaspora_event_sdk/sdk/aws_iam_msk.py,sha256=VMQpA-20fFWaAzzv9TyBpDK8dcMHS4tijjjsYhTJF74,3892
6
6
  diaspora_event_sdk/sdk/client.py,sha256=Mzsd8WDyaAGMkNDDjpzrWMLPwyC6JoeFVYb0YERrBrk,8774
7
7
  diaspora_event_sdk/sdk/decorators.py,sha256=Gel8AyhIjbf4-FNintTNcOqvC9hHH_YwbOH257Nfmf0,884
8
- diaspora_event_sdk/sdk/kafka_client.py,sha256=ZwNf83gahsLVRHert8YeiruioWAoEIOSTSKZOY-A2PY,4271
8
+ diaspora_event_sdk/sdk/kafka_client.py,sha256=iFTSmV24_hLWhqF16j44gkyk5psYKz8hX3nY6ChIWyE,4675
9
9
  diaspora_event_sdk/sdk/web_client.py,sha256=mc6OvYgq8Cl-irjOW5FfhU_1fl1nRF8OKlPPmaQc0zo,4992
10
10
  diaspora_event_sdk/sdk/botocore/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  diaspora_event_sdk/sdk/botocore/auth.py,sha256=QXwCNMzM0wAqD64RlFd-K27atRpixti73VKConpb1kk,18699
@@ -25,10 +25,10 @@ diaspora_event_sdk/sdk/login_manager/tokenstore.py,sha256=ImncC8EIxoAuGtDiZIwdtU
25
25
  diaspora_event_sdk/sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  diaspora_event_sdk/sdk/utils/uuid_like.py,sha256=xbxf0YXpDhdii16lwPLWRN21qFekHrNrqODSToMPtCg,470
27
27
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- tests/unit/apis_test.py,sha256=S_6JjHU-YAcz6nITveN5qzkINkWrrgDcIPR8Ik8JNf4,4365
28
+ tests/unit/apis_test.py,sha256=fgDUgDUzC7lMmCX6gHAUHU2AFLcHDJ5u0oKDH0x5GhU,4445
29
29
  tests/unit/client_test.py,sha256=sJUtPmnNGnohnP38RQrwcJ4D5j3-g1WFQ6gaKf520AQ,3019
30
- diaspora_event_sdk-0.3.1.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
31
- diaspora_event_sdk-0.3.1.dist-info/METADATA,sha256=WolDkvsp9WLY5fn9miVBx8I5cxdHDjRTjozPj3ZT4LE,2101
32
- diaspora_event_sdk-0.3.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
33
- diaspora_event_sdk-0.3.1.dist-info/top_level.txt,sha256=OVun-67t3fkLFEIwvJuNINgFFvAc--bClYhXjLhMmvs,25
34
- diaspora_event_sdk-0.3.1.dist-info/RECORD,,
30
+ diaspora_event_sdk-0.3.4.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
31
+ diaspora_event_sdk-0.3.4.dist-info/METADATA,sha256=GztAbJ_bNHmuucrmur2H7W6jTVaYJUSovBKSYBp07eY,3631
32
+ diaspora_event_sdk-0.3.4.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
33
+ diaspora_event_sdk-0.3.4.dist-info/top_level.txt,sha256=OVun-67t3fkLFEIwvJuNINgFFvAc--bClYhXjLhMmvs,25
34
+ diaspora_event_sdk-0.3.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.43.0)
2
+ Generator: bdist_wheel (0.44.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
tests/unit/apis_test.py CHANGED
@@ -18,6 +18,9 @@ def setup():
18
18
  client_id = os.environ["DIASPORA_SDK_CLIENT_ID"]
19
19
  client_secret = os.environ["DIASPORA_SDK_CLIENT_SECRET"]
20
20
  requested_scopes = os.environ["CLIENT_SCOPE"]
21
+ # assert client_id
22
+ # assert client_secret
23
+ # assert requested_scopes
21
24
 
22
25
  ca = ConfidentialAppAuthClient(
23
26
  client_id=client_id,
@@ -1,46 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: diaspora-event-sdk
3
- Version: 0.3.1
4
- Summary: SDK of Diaspora Event Fabric: Resilience-enabling services for science from HPC to edge
5
- Home-page: https://github.com/globus-labs/diaspora-event-sdk
6
- License: Apache 2.0
7
- Description-Content-Type: text/markdown
8
- License-File: LICENSE
9
- Requires-Dist: globus-sdk <4,>=3.20.1
10
- Provides-Extra: kafka-python
11
- Requires-Dist: kafka-python ; extra == 'kafka-python'
12
- Provides-Extra: test
13
- Requires-Dist: pytest ; extra == 'test'
14
- Requires-Dist: pytest-cov ; extra == 'test'
15
- Requires-Dist: coverage ; extra == 'test'
16
- Requires-Dist: mypy ; extra == 'test'
17
- Requires-Dist: tox ; extra == 'test'
18
- Requires-Dist: check-manifest ; extra == 'test'
19
- Requires-Dist: pre-commit ; extra == 'test'
20
-
21
- # Diaspora Event Fabric SDK
22
-
23
- ## Installation Guide
24
- ### Recommended Method: With `kafka-python`
25
- To integrate with Diaspora Event Fabric using `KafkaProducer` and `KafkaConsumer`, install the SDK with `kafka-python`:
26
- ```bash
27
- pip install "diaspora-event-sdk[kafka-python]"
28
- ```
29
-
30
- ### Alternative Installation: Without Kafka Client Library
31
- For other Kafka client libraries (e.g., `confluent-kafka-python`, `aiokafka`), install the SDK without `kafka-python`:
32
- ```bash
33
- pip install diaspora-event-sdk
34
- ```
35
- Note: This does not include `KafkaProducer` and `KafkaConsumer` dependencies.
36
-
37
- ## Using Diaspora Event Fabric SDK
38
- Check our [Notebook](DiasporaDemo.ipynb) for a quickstart and demonstration.
39
-
40
- <!-- **Getting Started**: Visit our [QuickStart Guide](docs/quickstart.md) for details on using the SDK with the kafka-python library and instructions for other Kafka clients.
41
-
42
- **Troubleshooting and Credential Management**: Consult our [TrobleShooting Guide](docs/troubleshooting.md) for solving common issues and tips on managing keys effectively. -->
43
-
44
- <!-- **Advanced Consumers with Faust**: Explore the [Faust Streaming Guide](docs/faust_weather_app.md) for advanced event streaming with Faust. -->
45
-
46
- <!-- **Advanced Consumer Functions**: See our [Colab example](https://colab.research.google.com/drive/1tPKfxU2qPsLvNTreF6nKINU62k7pQWxa?usp=sharing) for demonstration. -->