Skip to content

Commit f6efcf7

Browse files
committed
Merge branch 'chore-lighter-tox' into chore-type-hints-for-wait-for-idle
2 parents e2740a1 + 39ca34c commit f6efcf7

6 files changed

Lines changed: 46 additions & 56 deletions

File tree

.readthedocs.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ version: 2
22

33
python:
44
install:
5-
- requirements: docs/requirements.txt
5+
- method: pip
6+
path: .
7+
extra_requirements:
8+
- dev
9+
- docs
610

711
build:
8-
os: ubuntu-22.04
12+
os: ubuntu-24.04
913
tools:
10-
python: "3.10"
14+
# Older Shpinx uses imghdr that was removed in Python 3.13
15+
# See e.g. https://github.com/python/cpython/issues/104818
16+
python: "3.12"
1117

1218
sphinx:
1319
configuration: docs/conf.py

docs/requirements.txt

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

pyproject.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,19 @@ dependencies = [
3434
"hvac",
3535
"packaging",
3636
"typing-extensions>=4.5.0",
37-
"backports.strenum>=1.3.1",
37+
'backports.strenum>=1.3.1; python_version < "3.11"',
38+
]
39+
[project.optional-dependencies]
40+
dev = [
41+
"typing-inspect",
42+
"pytest",
43+
"pytest-asyncio",
44+
"Twine",
45+
]
46+
docs = [
47+
"sphinx==5.3.0",
48+
"sphinxcontrib-asyncio",
49+
"sphinx_rtd_theme",
3850
]
3951

4052
[project.urls]

setup.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,16 @@
3232
"hvac",
3333
"packaging",
3434
"typing-extensions>=4.5.0",
35-
"backports.strenum",
35+
'backports.strenum>=1.3.1; python_version < "3.11"',
3636
],
37+
extras_require={
38+
"dev": [
39+
"typing-inspect",
40+
"pytest",
41+
"pytest-asyncio",
42+
"Twine",
43+
]
44+
},
3745
include_package_data=True,
3846
maintainer="Juju Ecosystem Engineering",
3947
maintainer_email="juju@lists.ubuntu.com",

tests/integration/test_model.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from unittest import mock
1111

1212
import paramiko
13-
import pylxd
1413
import pytest
1514

1615
from juju import jasyncio, tag, url
@@ -29,6 +28,11 @@
2928
from ..utils import GB, INTEGRATION_TEST_DIR, MB, OVERLAYS_DIR, SSH_KEY, TESTS_DIR
3029

3130

31+
@pytest.fixture
32+
def pylxd():
33+
return pytest.importorskip("pylxd")
34+
35+
3236
@base.bootstrapped
3337
async def test_model_name():
3438
model = Model()
@@ -532,7 +536,7 @@ async def test_add_machine():
532536
assert len(model.machines) == 0
533537

534538

535-
async def add_manual_machine_ssh(is_root=False):
539+
async def add_manual_machine_ssh(pylxd, is_root=False):
536540
# Verify controller is localhost
537541
async with base.CleanController() as controller:
538542
cloud = await controller.get_cloud()
@@ -677,7 +681,7 @@ def wait_for_network(container, timeout=30):
677681

678682

679683
@base.bootstrapped
680-
async def test_add_manual_machine_ssh():
684+
async def test_add_manual_machine_ssh(pylxd):
681685
"""Test manual machine provisioning with a non-root user.
682686
683687
Tests manual machine provisioning using a randomized username with
@@ -687,9 +691,9 @@ async def test_add_manual_machine_ssh():
687691

688692

689693
@base.bootstrapped
690-
async def test_add_manual_machine_ssh_root():
694+
async def test_add_manual_machine_ssh_root(pylxd):
691695
"""Test manual machine provisioning with the root user."""
692-
await add_manual_machine_ssh(is_root=True)
696+
await add_manual_machine_ssh(pylxd, is_root=True)
693697

694698

695699
@base.bootstrapped

tox.ini

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,35 +9,19 @@ envlist = py3,py38,py39,py310,py311,docs
99
skipsdist=True
1010

1111
[testenv]
12-
usedevelop=True
13-
commands =
14-
pip install urllib3<2
15-
pip install pylxd
16-
pytest --tb native -s -k 'not integration' -m 'not serial' {posargs}
12+
use_develop = True
13+
# This should work, but doesn't. Hence the deps= below
14+
# extras = dev
15+
deps =
16+
.[dev]
1717
passenv =
1818
HOME
1919
TEST_AGENTS
2020
LXD_DIR
21-
# FIXME would it be easier to `pip install -e .`?
22-
deps =
23-
macaroonbakery
24-
toposort
25-
typing-inspect
26-
paramiko
27-
ipdb
28-
pytest
29-
pytest-asyncio
30-
Twine
31-
websockets<14.0
32-
kubernetes<31.0.0
33-
hvac
34-
packaging
35-
setuptools
36-
backports.strenum
3721

3822
[testenv:docs]
3923
deps =
40-
-r docs/requirements.txt
24+
.[dev,docs]
4125

4226
allowlist_externals = rm
4327
commands =
@@ -47,8 +31,6 @@ commands =
4731
[testenv:integration]
4832
envdir = {toxworkdir}/py3
4933
commands =
50-
pip install urllib3<2
51-
pip install pylxd
5234
pytest \
5335
--tb native \
5436
-k 'integration' \
@@ -60,8 +42,6 @@ commands =
6042
[testenv:integration-quarantine]
6143
envdir = {toxworkdir}/py3
6244
commands =
63-
pip install urllib3<2
64-
pip install pylxd
6545
pytest \
6646
--tb native \
6747
-m 'not serial' \
@@ -72,8 +52,6 @@ commands =
7252
[testenv:unit]
7353
envdir = {toxworkdir}/py3
7454
commands =
75-
pip install urllib3<2
76-
pip install pylxd
7755
pytest {toxinidir}/tests/unit {posargs}
7856

7957
[testenv:serial]
@@ -82,8 +60,6 @@ commands =
8260
# it doesn't get run in CI
8361
envdir = {toxworkdir}/py3
8462
commands =
85-
pip install urllib3<2
86-
pip install pylxd
8763
pytest --tb native -s {posargs:-m 'serial'}
8864

8965
[testenv:validate]

0 commit comments

Comments
 (0)