Skip to content

Commit 9734c81

Browse files
authored
Merge pull request #1221 from EdmilsonRodrigues/jasyncio
#1221 #### Description *<I created a new file called _jasyncio, passed all functions from jasyncio to there, but maintained the jasyncio file with a deprecation warning. Then, I changed jasyncio to _jasyncio or asyncio in all files that it appeared.>* *<Fixes: Stopped using jasyncio and imported asynchronous functions directly from asyncio>* #### QA Steps *<Commands / tests / steps to run to verify that the change works: I do not know yet, this is my first contribution to an open source project, and I could use some guidance.>* ``` tox -e py3 -- tests/unit/... ``` ``` tox -e integration -- tests/integration/... ``` All CI tests need to pass. *<Please note that most likely an additional test will be required by the reviewers for any change that's not a one liner to land.>* #### Notes & Discussion *<This is my first time contributing and I am still learning how. Can you help me telling how can I test if the changes work, if I should do more smaller commits or only big commits, or any other guidance of how to work on this project?>*
2 parents b5f7a5a + 38280e0 commit 9734c81

73 files changed

Lines changed: 378 additions & 347 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/api/juju.loop.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/api/modules.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ Public APIs
22
===========
33

44
It is recommended that you start with :doc:`juju.model` or :doc:`juju.controller`.
5-
If you need helpers to manage the asyncio loop, try :doc:`juju.loop`.
65

76
.. toctree::
87

@@ -16,7 +15,6 @@ If you need helpers to manage the asyncio loop, try :doc:`juju.loop`.
1615
juju.errors
1716
juju.exceptions
1817
juju.juju
19-
juju.loop
2018
juju.machine
2119
juju.model
2220
juju.placement

examples/action.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
1111
"""
1212

13+
import asyncio
1314
import logging
1415

15-
from juju import jasyncio
1616
from juju.model import Model
1717

1818

@@ -50,4 +50,4 @@ async def main():
5050
logging.basicConfig(level=logging.DEBUG)
5151
ws_logger = logging.getLogger("websockets.protocol")
5252
ws_logger.setLevel(logging.INFO)
53-
jasyncio.run(main())
53+
asyncio.run(main())

examples/add_k8s.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
1111
"""
1212

13+
import asyncio
1314
import base64
1415
import logging
1516
import os
1617

1718
import yaml
1819

19-
from juju import jasyncio
2020
from juju.client import client
2121
from juju.controller import Controller
2222

@@ -58,4 +58,4 @@ async def main():
5858
logging.basicConfig(level=logging.DEBUG)
5959
ws_logger = logging.getLogger("websockets.protocol")
6060
ws_logger.setLevel(logging.INFO)
61-
jasyncio.run(main())
61+
asyncio.run(main())

examples/add_machine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
1212
"""
1313

14+
import asyncio
1415
import logging
1516

16-
from juju import jasyncio
1717
from juju.model import Model
1818

1919
MB = 1
@@ -69,4 +69,4 @@ async def main():
6969
ws_logger = logging.getLogger("websockets.protocol")
7070
ws_logger.setLevel(logging.INFO)
7171

72-
jasyncio.run(main())
72+
asyncio.run(main())

examples/add_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import uuid
1414
from logging import getLogger
1515

16-
from juju import jasyncio, utils
16+
from juju import utils
1717
from juju.controller import Controller
1818

1919
LOG = getLogger(__name__)
@@ -65,4 +65,4 @@ async def main():
6565

6666

6767
if __name__ == "__main__":
68-
jasyncio.run(main())
68+
asyncio.run(main())

examples/add_secrets_backend.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Copyright 2023 Canonical Ltd.
22
# Licensed under the Apache V2, see LICENCE file for details.
33

4+
import asyncio
5+
46
import hvac
57

6-
from juju import jasyncio
78
from juju.model import Model
89

910

@@ -75,4 +76,4 @@ async def main():
7576

7677

7778
if __name__ == "__main__":
78-
jasyncio.run(main())
79+
asyncio.run(main())

examples/allwatcher.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
1111
"""
1212

13+
import asyncio
1314
import logging
1415

15-
from juju import jasyncio
1616
from juju.client import client
1717
from juju.model import Model
1818

@@ -34,4 +34,4 @@ async def watch():
3434
ws_logger.setLevel(logging.INFO)
3535
# Run loop until the process is manually stopped (watch will loop
3636
# forever).
37-
jasyncio.run(watch())
37+
asyncio.run(watch())

examples/charmhub_deploy_k8s.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
1010
"""
1111

12-
from juju import jasyncio
12+
import asyncio
13+
1314
from juju.model import Model
1415

1516

@@ -40,4 +41,4 @@ async def main():
4041

4142

4243
if __name__ == "__main__":
43-
jasyncio.run(main())
44+
asyncio.run(main())

examples/charmhub_deploy_machine.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
1010
"""
1111

12-
from juju import jasyncio
12+
import asyncio
13+
1314
from juju.model import Model
1415

1516

@@ -37,4 +38,4 @@ async def main():
3738

3839

3940
if __name__ == "__main__":
40-
jasyncio.run(main())
41+
asyncio.run(main())

0 commit comments

Comments
 (0)