Skip to content

Commit 2ba5a65

Browse files
authored
test python3.10 and black formatted (#49)
1 parent 19a0dea commit 2ba5a65

37 files changed

Lines changed: 2415 additions & 1849 deletions

.github/workflows/flake8.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
11-
- name: GitHub Action for Flake8
12-
uses: cclauss/GitHub-Action-for-Flake8@v0.5.0
10+
- uses: actions/checkout@v2
11+
- name: GitHub Action for Flake8
12+
uses: cclauss/GitHub-Action-for-Flake8@v0.5.0

.github/workflows/publish_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Publish Docs
22

3-
on:
3+
"on":
44
push:
55
branches:
66
- master
@@ -14,7 +14,7 @@ jobs:
1414
- name: Setup Python
1515
uses: actions/setup-python@v2
1616
with:
17-
python-version: '3.8'
17+
python-version: "3.8"
1818

1919
- name: Upgrade pip
2020
run: |

.github/workflows/publish_pypi.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
name: Upload Python Package
22

3-
on:
3+
"on":
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
77

88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- name: Set up Python
14-
uses: actions/setup-python@v2
15-
with:
16-
python-version: '3.x'
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip
20-
pip install -U setuptools wheel twine
21-
- name: Build and publish
22-
env:
23-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
24-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
25-
run: |
26-
python setup.py sdist bdist_wheel
27-
twine upload dist/*
12+
- uses: actions/checkout@v2
13+
- name: Set up Python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: "3.x"
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --upgrade pip
20+
pip install -U setuptools wheel twine
21+
- name: Build and publish
22+
env:
23+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
24+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
25+
run: |
26+
python setup.py sdist bdist_wheel
27+
twine upload dist/*

.github/workflows/test.yml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Python package
22

3-
on: [push]
3+
"on": [push]
44

55
jobs:
66
build:
@@ -12,25 +12,26 @@ jobs:
1212
- "3.6"
1313
- "3.7"
1414
- "3.8"
15+
- "3.10"
1516

1617
steps:
17-
- uses: actions/checkout@v1
18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v1
20-
with:
21-
python-version: ${{ matrix.python-version }}
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip
25-
pip install tox tox-gh-actions
26-
- name: Test with tox
27-
run: tox
18+
- uses: actions/checkout@v1
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install tox tox-gh-actions
27+
- name: Test with tox
28+
run: tox
2829

29-
- name: Upload coverage to Codecov
30-
uses: codecov/codecov-action@v1
31-
with:
32-
token: ${{ secrets.CODECOV_TOKEN }}
33-
file: ./coverage.xml
34-
flags: unittests
35-
name: codecov-umbrella
36-
yml: ./codecov.yml
30+
- name: Upload coverage to Codecov
31+
uses: codecov/codecov-action@v1
32+
with:
33+
token: ${{ secrets.CODECOV_TOKEN }}
34+
file: ./coverage.xml
35+
flags: unittests
36+
name: codecov-umbrella
37+
yml: ./codecov.yml

cloudscale_cli/cli.py

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,47 @@
11
import click
2-
from .version import __version__
3-
from .util import OrderedGroup
4-
from .commands import CloudscaleCommand, OUTPUT_FORMATS
5-
from .commands.server import server
6-
from .commands.server_group import server_group
2+
3+
from .commands import OUTPUT_FORMATS, CloudscaleCommand
4+
from .commands.custom_image import custom_image
75
from .commands.flavor import flavor
86
from .commands.floating_ip import floating_ip
97
from .commands.image import image
10-
from .commands.region import region
118
from .commands.network import network
9+
from .commands.objects_user import objects_user
10+
from .commands.region import region
11+
from .commands.server import server
12+
from .commands.server_group import server_group
1213
from .commands.subnet import subnet
1314
from .commands.volume import volume
14-
from .commands.objects_user import objects_user
15-
from .commands.custom_image import custom_image
15+
from .util import OrderedGroup
16+
from .version import __version__
17+
1618

17-
@click.group(cls=OrderedGroup, context_settings={
18-
'help_option_names': ['-h', '--help'],
19-
})
20-
@click.version_option(__version__, '--version')
21-
@click.option('--api-token', '-a', envvar='CLOUDSCALE_API_TOKEN', help="API token.")
22-
@click.option('--profile', '-p', envvar='CLOUDSCALE_PROFILE', help="Profile used in config file.")
23-
@click.option('--debug', envvar='CLOUDSCALE_DEBUG', is_flag=True, help='Enables debug log output.')
24-
@click.option('--output', '-o', envvar='CLOUDSCALE_OUTPUT', type=click.Choice(OUTPUT_FORMATS), default="table", help="Output format.", show_default=True)
25-
@click.option('--verbose', '-v', envvar='CLOUDSCALE_VERBOSE', is_flag=True, help='Verbose output.')
19+
@click.group(
20+
cls=OrderedGroup,
21+
context_settings={
22+
"help_option_names": ["-h", "--help"],
23+
},
24+
)
25+
@click.version_option(__version__, "--version")
26+
@click.option("--api-token", "-a", envvar="CLOUDSCALE_API_TOKEN", help="API token.")
27+
@click.option(
28+
"--profile", "-p", envvar="CLOUDSCALE_PROFILE", help="Profile used in config file."
29+
)
30+
@click.option(
31+
"--debug", envvar="CLOUDSCALE_DEBUG", is_flag=True, help="Enables debug log output."
32+
)
33+
@click.option(
34+
"--output",
35+
"-o",
36+
envvar="CLOUDSCALE_OUTPUT",
37+
type=click.Choice(OUTPUT_FORMATS),
38+
default="table",
39+
help="Output format.",
40+
show_default=True,
41+
)
42+
@click.option(
43+
"--verbose", "-v", envvar="CLOUDSCALE_VERBOSE", is_flag=True, help="Verbose output."
44+
)
2645
@click.pass_context
2746
def cli(ctx, profile, api_token, debug, output, verbose):
2847
ctx.obj = CloudscaleCommand(
@@ -34,14 +53,14 @@ def cli(ctx, profile, api_token, debug, output, verbose):
3453
)
3554

3655

37-
cli.add_command(server)
38-
cli.add_command(server_group)
39-
cli.add_command(floating_ip)
56+
cli.add_command(custom_image)
4057
cli.add_command(flavor)
58+
cli.add_command(floating_ip)
4159
cli.add_command(image)
42-
cli.add_command(region)
4360
cli.add_command(network)
61+
cli.add_command(objects_user)
62+
cli.add_command(region)
63+
cli.add_command(server_group)
64+
cli.add_command(server)
4465
cli.add_command(subnet)
4566
cli.add_command(volume)
46-
cli.add_command(objects_user)
47-
cli.add_command(custom_image)

0 commit comments

Comments
 (0)