Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: GitHub Action for Flake8
uses: cclauss/GitHub-Action-for-Flake8@v0.5.0
6 changes: 3 additions & 3 deletions .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"

Expand All @@ -39,7 +39,7 @@ jobs:
- run: mkdocs build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
4 changes: 2 additions & 2 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ jobs:
max-parallel: 4
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -28,7 +29,7 @@ jobs:
run: tox

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

All notable changes to this project will be documented in this file.

## v1.5.0 (2025-06-24)

### Minor changes

- Add qcow2 as supported image import format.
- Drop support for Python <3.9.

### Bug fixes

- Fix some commands not showing up in certain configurations.

## v1.4.0 (2021-05-03)

### Minor Chages
### Minor changes

- Implemented interface support.

Expand Down
22 changes: 11 additions & 11 deletions cloudscale_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ def cli(ctx, profile, api_token, debug, output, verbose):
)


cli.add_command(custom_image)
cli.add_command(flavor)
cli.add_command(floating_ip)
cli.add_command(image)
cli.add_command(network)
cli.add_command(objects_user)
cli.add_command(region)
cli.add_command(server_group)
cli.add_command(server)
cli.add_command(subnet)
cli.add_command(volume)
cli.add_command(custom_image, name='custom-image')
cli.add_command(flavor, name='flavor')
cli.add_command(floating_ip, name='floating-ip')
cli.add_command(image, name='image')
cli.add_command(network, name='network')
cli.add_command(objects_user, name='objects-user')
cli.add_command(region, name='region')
cli.add_command(server_group, name='server-group')
cli.add_command(server, name='server')
cli.add_command(subnet, name='subnet')
cli.add_command(volume, name='volume')
2 changes: 1 addition & 1 deletion cloudscale_cli/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.4.0"
__version__ = "1.5.0"
7 changes: 7 additions & 0 deletions tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,11 @@
def test_list_commands():
runner = CliRunner()
result = runner.invoke(cli, [])

# Since click 8.2, the exit code is 2, when usage is invoked without
# -h/--help. Since we support older releases as well, it can be one of two.
assert result.exit_code in (0, 2)

# This can be avoided by asking for help
result = runner.invoke(cli, ['--help'])
assert result.exit_code == 0
5 changes: 3 additions & 2 deletions tests/test_custom_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def test_custom_images_delete():
status=200,
)
responses.add(
responses.DELETE, CLOUDSCALE_API_URL + "/custom-images/" + uuid, status=204
responses.DELETE,
CLOUDSCALE_API_URL + "/custom-images/" + uuid,
status=204,
)

runner = CliRunner()
Expand Down Expand Up @@ -255,7 +257,6 @@ def test_custom_images_update():
responses.add(
responses.PATCH,
CLOUDSCALE_API_URL + "/custom-images/" + uuid,
json=CUSTOM_IMAGE_RESP,
status=204,
)
responses.add(
Expand Down
12 changes: 10 additions & 2 deletions tests/test_flavor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@
@responses.activate
def test_flavor_get_all():
responses.add(
responses.GET, CLOUDSCALE_API_URL + "/flavors", json=[FLAVOR_RESP], status=200
responses.GET,
CLOUDSCALE_API_URL + "/flavors",
json=[FLAVOR_RESP],
status=200,
)
responses.add(
responses.GET,
CLOUDSCALE_API_URL + "/flavors",
json={},
status=500,
)
responses.add(responses.GET, CLOUDSCALE_API_URL + "/flavors", json={}, status=500)

runner = CliRunner()
result = runner.invoke(
Expand Down
10 changes: 7 additions & 3 deletions tests/test_floating_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def test_floating_ip_get_all():
status=200,
)
responses.add(
responses.GET, CLOUDSCALE_API_URL + "/floating-ips", json={}, status=500
responses.GET,
CLOUDSCALE_API_URL + "/floating-ips",
json={},
status=500,
)

runner = CliRunner()
Expand Down Expand Up @@ -105,7 +108,9 @@ def test_floating_ip_delete():
status=200,
)
responses.add(
responses.DELETE, CLOUDSCALE_API_URL + "/floating-ips/" + network_id, status=204
responses.DELETE,
CLOUDSCALE_API_URL + "/floating-ips/" + network_id,
status=204,
)
responses.add(
responses.DELETE,
Expand Down Expand Up @@ -222,7 +227,6 @@ def test_floating_ip_update():
responses.add(
responses.PATCH,
CLOUDSCALE_API_URL + "/floating-ips/" + network_id,
json=FLOATING_IP_RESP,
status=204,
)
responses.add(
Expand Down
12 changes: 10 additions & 2 deletions tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,17 @@
@responses.activate
def test_image_get_all():
responses.add(
responses.GET, CLOUDSCALE_API_URL + "/images", json=[IMAGE_RESP], status=200
responses.GET,
CLOUDSCALE_API_URL + "/images",
json=[IMAGE_RESP],
status=200,
)
responses.add(
responses.GET,
CLOUDSCALE_API_URL + "/images",
json={},
status=500,
)
responses.add(responses.GET, CLOUDSCALE_API_URL + "/images", json={}, status=500)

runner = CliRunner()
result = runner.invoke(
Expand Down
38 changes: 30 additions & 8 deletions tests/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,17 @@
@responses.activate
def test_network_get_all():
responses.add(
responses.GET, CLOUDSCALE_API_URL + "/networks", json=[NETWORK_RESP], status=200
responses.GET,
CLOUDSCALE_API_URL + "/networks",
json=[NETWORK_RESP],
status=200,
)
responses.add(
responses.GET,
CLOUDSCALE_API_URL + "/networks",
json={},
status=500,
)
responses.add(responses.GET, CLOUDSCALE_API_URL + "/networks", json={}, status=500)

runner = CliRunner()
result = runner.invoke(
Expand Down Expand Up @@ -61,7 +69,10 @@ def test_network_get_by_uuid():
status=200,
)
responses.add(
responses.GET, CLOUDSCALE_API_URL + "/networks/" + uuid, json={}, status=500
responses.GET,
CLOUDSCALE_API_URL + "/networks/" + uuid,
json={},
status=500,
)

runner = CliRunner()
Expand Down Expand Up @@ -105,7 +116,9 @@ def test_network_delete():
status=200,
)
responses.add(
responses.DELETE, CLOUDSCALE_API_URL + "/networks/" + uuid, status=204
responses.DELETE,
CLOUDSCALE_API_URL + "/networks/" + uuid,
status=204,
)
responses.add(
responses.DELETE,
Expand Down Expand Up @@ -158,9 +171,17 @@ def test_network_create():
name = "my-network-name"

responses.add(
responses.POST, CLOUDSCALE_API_URL + "/networks", json=NETWORK_RESP, status=201
responses.POST,
CLOUDSCALE_API_URL + "/networks",
json=NETWORK_RESP,
status=201,
)
responses.add(
responses.POST,
CLOUDSCALE_API_URL + "/networks",
json={},
status=500,
)
responses.add(responses.POST, CLOUDSCALE_API_URL + "/networks", json={}, status=500)

runner = CliRunner()
result = runner.invoke(
Expand Down Expand Up @@ -196,7 +217,6 @@ def test_network_update():
responses.add(
responses.PATCH,
CLOUDSCALE_API_URL + "/networks/" + uuid,
json=NETWORK_RESP,
status=204,
)
responses.add(
Expand All @@ -206,7 +226,9 @@ def test_network_update():
status=200,
)
responses.add(
responses.PATCH, CLOUDSCALE_API_URL + "/networks/" + uuid, json={}, status=500
responses.PATCH,
CLOUDSCALE_API_URL + "/networks/" + uuid,
status=500,
)

runner = CliRunner()
Expand Down
21 changes: 15 additions & 6 deletions tests/test_objects_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def test_objects_user_get_all():
status=200,
)
responses.add(
responses.GET, CLOUDSCALE_API_URL + "/objects-users", json={}, status=500
responses.GET,
CLOUDSCALE_API_URL + "/objects-users",
json={},
status=500,
)

runner = CliRunner()
Expand Down Expand Up @@ -128,7 +131,9 @@ def test_objects_user_delete():
status=200,
)
responses.add(
responses.DELETE, CLOUDSCALE_API_URL + "/objects-users/" + uuid, status=204
responses.DELETE,
CLOUDSCALE_API_URL + "/objects-users/" + uuid,
status=204,
)
responses.add(
responses.DELETE,
Expand Down Expand Up @@ -186,7 +191,10 @@ def test_objects_user_create():
status=201,
)
responses.add(
responses.POST, CLOUDSCALE_API_URL + "/objects-users", json={}, status=500
responses.POST,
CLOUDSCALE_API_URL + "/objects-users",
json={},
status=500,
)
responses.add(
responses.POST,
Expand All @@ -195,7 +203,10 @@ def test_objects_user_create():
status=201,
)
responses.add(
responses.POST, CLOUDSCALE_API_URL + "/objects-users", json={}, status=500
responses.POST,
CLOUDSCALE_API_URL + "/objects-users",
json={},
status=500,
)

runner = CliRunner()
Expand Down Expand Up @@ -232,7 +243,6 @@ def test_objects_user_update():
responses.add(
responses.PATCH,
CLOUDSCALE_API_URL + "/objects-users/" + uuid,
json=OBJECTS_USER_RESP,
status=204,
)
responses.add(
Expand All @@ -244,7 +254,6 @@ def test_objects_user_update():
responses.add(
responses.PATCH,
CLOUDSCALE_API_URL + "/objects-users/unknown",
json={},
status=404,
)

Expand Down
12 changes: 10 additions & 2 deletions tests/test_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
@responses.activate
def test_region_get_all():
responses.add(
responses.GET, CLOUDSCALE_API_URL + "/regions", json=[REGION_RESP], status=200
responses.GET,
CLOUDSCALE_API_URL + "/regions",
json=[REGION_RESP],
status=200,
)
responses.add(
responses.GET,
CLOUDSCALE_API_URL + "/regions",
json={},
status=500,
)
responses.add(responses.GET, CLOUDSCALE_API_URL + "/regions", json={}, status=500)

runner = CliRunner()
result = runner.invoke(
Expand Down
Loading
Loading