Skip to content

Commit 2ae3e3f

Browse files
authored
Merge pull request #24 from sisp/python-versions
Drop support for Python 3.6/3.7 and extend test matrix to Python 3.11/3.12
2 parents e571cc8 + 1bffdbb commit 2ae3e3f

File tree

3 files changed

+38
-36
lines changed

3 files changed

+38
-36
lines changed

.github/workflows/cicd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on: [push, pull_request]
44

55
jobs:
66
ci:
7-
runs-on: ${{ matrix.python-version == '3.6' && 'ubuntu-20.04' || 'ubuntu-latest' }}
7+
runs-on: ubuntu-latest
88
strategy:
99
fail-fast: false
1010
max-parallel: 4
1111
matrix:
12-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
12+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1313

1414
steps:
1515
- uses: actions/checkout@v1
@@ -35,7 +35,7 @@ jobs:
3535
if: startsWith(github.event.ref, 'refs/tags')
3636
uses: actions/setup-python@v2
3737
with:
38-
python-version: "3.10"
38+
python-version: "3.12"
3939
- run: pip install -U pip poetry
4040
- name: Publish package
4141
if: startsWith(github.event.ref, 'refs/tags')

examples/naval.py

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,57 +17,59 @@ def ship():
1717
"""Manages ships."""
1818

1919

20-
@ship.command('new')
21-
@click.argument('name')
20+
@ship.command("new")
21+
@click.argument("name")
2222
def ship_new(name):
2323
"""Creates a new ship."""
24-
click.echo('Created ship %s' % name)
24+
click.echo("Created ship %s" % name)
2525

2626

27-
@ship.command('move')
28-
@click.argument('ship')
29-
@click.argument('x', type=float)
30-
@click.argument('y', type=float)
31-
@click.option('--speed', metavar='KN', default=10,
32-
help='Speed in knots.')
27+
@ship.command("move")
28+
@click.argument("ship")
29+
@click.argument("x", type=float)
30+
@click.argument("y", type=float)
31+
@click.option("--speed", metavar="KN", default=10, help="Speed in knots.")
3332
def ship_move(ship, x, y, speed):
3433
"""Moves SHIP to the new location X,Y."""
35-
click.echo('Moving ship %s to %s,%s with speed %s' % (ship, x, y, speed))
34+
click.echo("Moving ship %s to %s,%s with speed %s" % (ship, x, y, speed))
3635

3736

38-
@ship.command('shoot')
39-
@click.argument('ship')
40-
@click.argument('x', type=float)
41-
@click.argument('y', type=float)
37+
@ship.command("shoot")
38+
@click.argument("ship")
39+
@click.argument("x", type=float)
40+
@click.argument("y", type=float)
4241
def ship_shoot(ship, x, y):
4342
"""Makes SHIP fire to X,Y."""
44-
click.echo('Ship %s fires to %s,%s' % (ship, x, y))
43+
click.echo("Ship %s fires to %s,%s" % (ship, x, y))
4544

4645

47-
@cli.group('mine', cls=DYMGroup)
46+
@cli.group("mine", cls=DYMGroup)
4847
def mine():
4948
"""Manages mines."""
5049

5150

52-
@mine.command('set')
53-
@click.argument('x', type=float)
54-
@click.argument('y', type=float)
55-
@click.option('ty', '--moored', flag_value='moored',
56-
default=True,
57-
help='Moored (anchored) mine. Default.')
58-
@click.option('ty', '--drifting', flag_value='drifting',
59-
help='Drifting mine.')
51+
@mine.command("set")
52+
@click.argument("x", type=float)
53+
@click.argument("y", type=float)
54+
@click.option(
55+
"ty",
56+
"--moored",
57+
flag_value="moored",
58+
default=True,
59+
help="Moored (anchored) mine. Default.",
60+
)
61+
@click.option("ty", "--drifting", flag_value="drifting", help="Drifting mine.")
6062
def mine_set(x, y, ty):
6163
"""Sets a mine at a specific coordinate."""
62-
click.echo('Set %s mine at %s,%s' % (ty, x, y))
64+
click.echo("Set %s mine at %s,%s" % (ty, x, y))
6365

6466

65-
@mine.command('remove')
66-
@click.argument('x', type=float)
67-
@click.argument('y', type=float)
67+
@mine.command("remove")
68+
@click.argument("x", type=float)
69+
@click.argument("y", type=float)
6870
def mine_remove(x, y):
6971
"""Removes a mine at a specific coordinate."""
70-
click.echo('Removed mine at %s,%s' % (x, y))
72+
click.echo("Removed mine at %s,%s" % (x, y))
7173

7274

7375
if __name__ == "__main__":

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ repository = "https://github.com/click-contrib/click-didyoumean"
99
readme = "README.rst"
1010

1111
[tool.poetry.dependencies]
12-
python = ">=3.6.2"
12+
python = ">=3.8"
1313
click = ">=7"
1414

1515
[tool.poetry.dev-dependencies]
1616
pytest = "^6.2.5"
17-
black = "^21.9b0"
18-
isort = {version = "^5.9.3", python = "<4"}
19-
flake8 = "^3.9.2"
17+
black = "^24.3.0"
18+
isort = "^5.9.3"
19+
flake8 = {version = "^7.0.0", python = ">=3.8.1"}
2020
mypy = "^0.910"
2121

2222
[build-system]

0 commit comments

Comments
 (0)