Skip to content

Commit 3947073

Browse files
Merge branch 'master' into bug/bundle/channel-default-value
2 parents df726c8 + 3186b78 commit 3947073

50 files changed

Lines changed: 628 additions & 1070 deletions

Some content is hidden

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

.github/workflows/tox.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python: [3.5, 3.6, 3.7, 3.8, 3.9]
11+
python:
12+
- "3.5"
13+
- "3.6"
14+
- "3.7"
15+
- "3.8"
16+
- "3.9"
17+
- "3.10"
1218
steps:
1319
- name: Check out code
1420
uses: actions/checkout@v2
@@ -25,7 +31,13 @@ jobs:
2531
runs-on: ubuntu-latest
2632
strategy:
2733
matrix:
28-
python: [3.5, 3.6, 3.7, 3.8, 3.9]
34+
python:
35+
- "3.5"
36+
- "3.6"
37+
- "3.7"
38+
- "3.8"
39+
- "3.9"
40+
- "3.10"
2941
steps:
3042
- uses: actions/checkout@v2
3143
- name: Setup Python

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.9.8
1+
2.9.10

docs/changelog.rst

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
11
Changelog
22
---------
33

4+
2.9.10
5+
^^^^^^
6+
7+
Thursday June 9 2022
8+
9+
## What's Changed
10+
11+
* [JUJU-1155] Avoid incorrectly setting `series: kubernetes` for sidecar charms in k8s bundles by @cderici in https://github.com/juju/python-libjuju/pull/679
12+
* [JUJU-1172] Visiting the pylibjuju CI by @cderici in https://github.com/juju/python-libjuju/pull/681
13+
* [JUJU-1124] Avoid sending path across the wire for local resource file name by @cderici in https://github.com/juju/python-libjuju/pull/678
14+
15+
2.9.9
16+
^^^^^
17+
18+
Wednesday April 26 2022
19+
20+
* [JUJU-835] Avoid ignoring asyncio exceptions in coroutines by @cderici in https://github.com/juju/python-libjuju/pull/658
21+
* [JUJU-843] Attach-resource to check if given binary file by @cderici in https://github.com/juju/python-libjuju/pull/659
22+
* [JUJU-858] Add quality of life feature ensure application removal at return by @cderici in https://github.com/juju/python-libjuju/pull/665
23+
* [JUJU-965] Add a bit of client side constraint validation by @cderici in https://github.com/juju/python-libjuju/pull/666
24+
* support python3.10 with later versions of websockets by @addyess in https://github.com/juju/python-libjuju/pull/673
25+
* Revert "Avoid ignoring asyncio exceptions in coroutines" by @simskij in https://github.com/juju/python-libjuju/pull/672
26+
* [JUJU-796] Add relate method and deprecate add-relation by @jack-w-shaw in https://github.com/juju/python-libjuju/pull/660
27+
* [JUJU-981] Get series from deployed app instead of metadata when charm upgrade by @cderici in https://github.com/juju/python-libjuju/pull/671
28+
429
2.9.8
530
^^^^^
631

732
Monday March 21 2022
833

9-
## What's Changed
10-
1134
* [JUJU-567] Use ModelManager instead of ControllerFacade to list available models by @cderici in https://github.com/juju/python-libjuju/pull/632
1235
* [JUJU-573] Fix charm resolution for Juju 2.8.11 by @cderici in https://github.com/juju/python-libjuju/pull/633
1336
* [JUJU-704] Remove non-implemented (stuıb) functions by @cderici in https://github.com/juju/python-libjuju/pull/646
@@ -17,7 +40,6 @@ Monday March 21 2022
1740
* [JUJU-769] Facade schemas for 2.9.27 by @cderici in https://github.com/juju/python-libjuju/pull/652
1841
* [JUJU-771] Auto switch to scale from add_unit on container based models by @cderici in https://github.com/juju/python-libjuju/pull/653
1942

20-
2143
2.9.7
2244
^^^^^
2345

docs/narrative/application.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ application. The `mysql_app` object is an instance of
9595
9696
Adding and Removing Relations
9797
-----------------------------
98-
The :meth:`juju.application.Application.add_relation` method returns a
98+
The :meth:`juju.application.Application.relate` method returns a
9999
:class:`juju.relation.Relation` instance.
100100

101101
.. code:: python
@@ -122,7 +122,7 @@ The :meth:`juju.application.Application.add_relation` method returns a
122122
)
123123
124124
# Add the master-slave relation
125-
relation = await mysql_master.add_relation(
125+
relation = await mysql_master.relate(
126126
# Name of the relation on the local (mysql-master) side
127127
'master',
128128
# Name of the app:relation on the remote side

docs/readme.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Installation
3636
3737
Quickstart
3838
----------
39+
3940
Here's a simple example that shows basic usage of the library. The example
4041
connects to the currently active Juju model, deploys a single unit of the
4142
ubuntu charm, then exits:
@@ -48,7 +49,7 @@ ubuntu charm, then exits:
4849
import logging
4950
import sys
5051
51-
from juju import loop
52+
from juju import jasyncio
5253
from juju.model import Model
5354
5455
@@ -87,7 +88,7 @@ ubuntu charm, then exits:
8788
8889
# Run the deploy coroutine in an asyncio event loop, using a helper
8990
# that abstracts loop creation and teardown.
90-
loop.run(deploy())
91+
jasyncio.run(deploy())
9192
9293
9394
if __name__ == '__main__':
@@ -103,6 +104,25 @@ example, to run ``examples/connect_current_model.py``, use:
103104
tox -e example -- examples/connect_current_model.py
104105
105106
107+
REPL
108+
^^^^
109+
110+
To experiment with the library in a REPL, launch python in asyncio mode
111+
112+
.. code:: bash
113+
114+
$ python3 -m asyncio
115+
116+
and then, to connect to the current model and fetch status:
117+
118+
.. code::
119+
120+
>>> from juju.model import Model
121+
>>> model = Model()
122+
>>> await model.connect_current()
123+
>>> status = await model.get_status()
124+
125+
106126
Versioning
107127
----------
108128

examples/charms/onos.charm

3.85 MB
Binary file not shown.

examples/charms/ubuntu/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
venv/
2+
build/
3+
*.charm
4+
5+
.coverage
6+
__pycache__/
7+
*.py[cod]

examples/charms/ubuntu/.jujuignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/venv
2+
*.py[cod]
3+
*.charm
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# ubuntu
2+
3+
## Developing
4+
5+
Create and activate a virtualenv with the development requirements:
6+
7+
virtualenv -p python3 venv
8+
source venv/bin/activate
9+
pip install -r requirements-dev.txt
10+
11+
## Code overview
12+
13+
TEMPLATE-TODO:
14+
One of the most important things a consumer of your charm (or library)
15+
needs to know is what set of functionality it provides. Which categories
16+
does it fit into? Which events do you listen to? Which libraries do you
17+
consume? Which ones do you export and how are they used?
18+
19+
## Intended use case
20+
21+
TEMPLATE-TODO:
22+
Why were these decisions made? What's the scope of your charm?
23+
24+
## Roadmap
25+
26+
If this Charm doesn't fulfill all of the initial functionality you were
27+
hoping for or planning on, please add a Roadmap or TODO here
28+
29+
## Testing
30+
31+
The Python operator framework includes a very nice harness for testing
32+
operator behaviour without full deployment. Just `run_tests`:
33+
34+
./run_tests

0 commit comments

Comments
 (0)