Skip to content

Commit 8e1f271

Browse files
committed
Switch to ruff; bump requirements
1 parent b8fb136 commit 8e1f271

File tree

6 files changed

+63
-72
lines changed

6 files changed

+63
-72
lines changed

.pre-commit-config.yaml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,20 @@ default_language_version:
44
# force all unspecified python hooks to run python3
55
python: python3
66
repos:
7-
- repo: https://github.com/psf/black
8-
rev: 24.3.0
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.6.1
99
hooks:
10-
- id: black
10+
# Run the linter.
11+
- id: ruff
12+
args:
13+
- --fix
14+
# Run the formatter.
15+
- id: ruff-format
1116
- repo: https://github.com/pre-commit/pre-commit-hooks
12-
rev: v4.5.0
17+
rev: v4.6.0
1318
hooks:
1419
- id: trailing-whitespace
1520
- id: end-of-file-fixer
1621
- id: check-json
1722
- id: pretty-format-json
1823
args: [--autofix, --no-ensure-ascii, --indent=4]
19-
- repo: https://github.com/pycqa/flake8
20-
rev: 7.0.0
21-
hooks:
22-
- id: flake8
23-
args: [--max-line-length=120, "--ignore=E203,W503"]
24-
additional_dependencies: [flake8-bugbear]
25-
- repo: https://github.com/pycqa/isort
26-
rev: 5.13.2
27-
hooks:
28-
- id: isort
29-
name: isort (python)
30-
args: ["--profile", "black", "--filter-files"]

dev-requirements.txt

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#
55
# pip-compile --extra=dev --no-emit-index-url --output-file=dev-requirements.txt
66
#
7-
backports-tarfile==1.1.1
7+
backports-tarfile==1.2.0
88
# via jaraco-context
99
build==1.2.1
1010
# via domdiv (pyproject.toml)
11-
certifi==2024.2.2
11+
certifi==2024.7.4
1212
# via requests
1313
cfgv==3.4.0
1414
# via pre-commit
@@ -26,15 +26,15 @@ docutils==0.21.2
2626
# via readme-renderer
2727
doit==0.36.0
2828
# via domdiv (pyproject.toml)
29-
exceptiongroup==1.2.1
29+
exceptiongroup==1.2.2
3030
# via pytest
31-
filelock==3.14.0
31+
filelock==3.15.4
3232
# via virtualenv
33-
identify==2.5.36
33+
identify==2.6.0
3434
# via pre-commit
3535
idna==3.7
3636
# via requests
37-
importlib-metadata==7.1.0
37+
importlib-metadata==8.2.0
3838
# via
3939
# build
4040
# doit
@@ -46,55 +46,55 @@ jaraco-classes==3.4.0
4646
# via keyring
4747
jaraco-context==5.3.0
4848
# via keyring
49-
jaraco-functools==4.0.1
49+
jaraco-functools==4.0.2
5050
# via keyring
51-
keyring==25.2.0
51+
keyring==25.3.0
5252
# via twine
5353
loguru==0.7.2
5454
# via domdiv (pyproject.toml)
5555
markdown-it-py==3.0.0
5656
# via rich
5757
mdurl==0.1.2
5858
# via markdown-it-py
59-
more-itertools==10.2.0
59+
more-itertools==10.4.0
6060
# via
6161
# jaraco-classes
6262
# jaraco-functools
63-
nh3==0.2.17
63+
nh3==0.2.18
6464
# via readme-renderer
65-
nodeenv==1.8.0
65+
nodeenv==1.9.1
6666
# via pre-commit
67-
packaging==24.0
67+
packaging==24.1
6868
# via
6969
# build
7070
# pytest
71-
pillow==10.3.0
71+
pillow==10.4.0
7272
# via
7373
# domdiv (pyproject.toml)
7474
# reportlab
7575
pkginfo==1.10.0
7676
# via twine
77-
platformdirs==4.2.1
77+
platformdirs==4.2.2
7878
# via virtualenv
7979
pluggy==1.5.0
8080
# via pytest
81-
pre-commit==3.7.0
81+
pre-commit==3.8.0
8282
# via domdiv (pyproject.toml)
83-
pygments==2.17.2
83+
pygments==2.18.0
8484
# via
8585
# readme-renderer
8686
# rich
8787
pyproject-hooks==1.1.0
8888
# via build
89-
pytest==8.2.0
89+
pytest==8.3.2
9090
# via domdiv (pyproject.toml)
91-
pyyaml==6.0.1
91+
pyyaml==6.0.2
9292
# via pre-commit
93-
readme-renderer==43.0
93+
readme-renderer==44.0
9494
# via twine
95-
reportlab==4.2.0
95+
reportlab==4.2.2
9696
# via domdiv (pyproject.toml)
97-
requests==2.31.0
97+
requests==2.32.3
9898
# via
9999
# requests-toolbelt
100100
# twine
@@ -108,16 +108,13 @@ tomli==2.0.1
108108
# via
109109
# build
110110
# pytest
111-
twine==5.0.0
111+
twine==5.1.1
112112
# via domdiv (pyproject.toml)
113-
urllib3==2.2.1
113+
urllib3==2.2.2
114114
# via
115115
# requests
116116
# twine
117-
virtualenv==20.26.1
117+
virtualenv==20.26.3
118118
# via pre-commit
119-
zipp==3.18.1
119+
zipp==3.20.0
120120
# via importlib-metadata
121-
122-
# The following packages are considered to be unsafe in a requirements file:
123-
# setuptools

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ domdiv_dedupe_cards = "domdiv.tools.cleanup_language_dupes:main"
3131
[tool.setuptools_scm]
3232
# doing this break CI as the version file gets written when just `get_version` is called
3333
# version_file = "src/domdiv/_version.py"
34+
35+
[tool.ruff.lint]
36+
select = ["I"]

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ configargparse==1.7
1010
# via domdiv (pyproject.toml)
1111
loguru==0.7.2
1212
# via domdiv (pyproject.toml)
13-
pillow==10.3.0
13+
pillow==10.4.0
1414
# via
1515
# domdiv (pyproject.toml)
1616
# reportlab
17-
reportlab==4.2.0
17+
reportlab==4.2.2
1818
# via domdiv (pyproject.toml)

src/domdiv/draw.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,7 @@ def __init__(self, canvas, x=0, y=0, cropmarkLength=-1, cropmarkSpacing=-1):
378378
self.NO_LINE,
379379
self.DOT,
380380
self.DEBUG,
381-
) = range(
382-
1, 9
383-
) # Constants
381+
) = range(1, 9) # Constants
384382
if cropmarkLength < 0:
385383
cropmarkLength = 0.2
386384
if cropmarkSpacing < 0:
@@ -852,7 +850,9 @@ def drawPanelOutline(
852850
line = (
853851
plotter.LINE
854852
if lineType.lower() == "line"
855-
else plotter.DOT if lineType.lower() == "dot" else NO_LINE
853+
else plotter.DOT
854+
if lineType.lower() == "dot"
855+
else NO_LINE
856856
)
857857
# lines ending at a midpoint (no dots)
858858
midline = NO_LINE if line == plotter.DOT else line
@@ -1076,7 +1076,9 @@ def tabHeight(panelStyle, panelHeight):
10761076
return (
10771077
panelHeight
10781078
if panelStyle in ["tab", "strap"]
1079-
else item.tabHeight if panelStyle == "folder" else 0.0
1079+
else item.tabHeight
1080+
if panelStyle == "folder"
1081+
else 0.0
10801082
)
10811083

10821084
headTabHeight = tabHeight(self.options.head, headHeight)

src/domdiv/main.py

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,7 @@ def by_cost_sort_key(self, card):
124124
)
125125

126126
def get_card_name_sort_key(self, c):
127-
if (
128-
self.collator
129-
): # If the PyICU collator attribute has been set up, get the collator based sort key
127+
if self.collator: # If the PyICU collator attribute has been set up, get the collator based sort key
130128
return self.collator.getSortKey(c)
131129
else: # Default method: strip the card name character accents
132130
return self.strip_accents(c)
@@ -338,21 +336,21 @@ def filter_sort_cards(cards, options):
338336
if card.group_top:
339337
# this is a designated card to represent the group, so update important data
340338
group_cards[(card.group_tag, card.cardset_tag)].cost = card.cost
341-
group_cards[(card.group_tag, card.cardset_tag)].potcost = (
342-
card.potcost
343-
)
344-
group_cards[(card.group_tag, card.cardset_tag)].debtcost = (
345-
card.debtcost
346-
)
347-
group_cards[(card.group_tag, card.cardset_tag)].types = (
348-
card.types
349-
)
350-
group_cards[(card.group_tag, card.cardset_tag)].randomizer = (
351-
card.randomizer
352-
)
353-
group_cards[(card.group_tag, card.cardset_tag)].image = (
354-
card.image
355-
)
339+
group_cards[
340+
(card.group_tag, card.cardset_tag)
341+
].potcost = card.potcost
342+
group_cards[
343+
(card.group_tag, card.cardset_tag)
344+
].debtcost = card.debtcost
345+
group_cards[
346+
(card.group_tag, card.cardset_tag)
347+
].types = card.types
348+
group_cards[
349+
(card.group_tag, card.cardset_tag)
350+
].randomizer = card.randomizer
351+
group_cards[
352+
(card.group_tag, card.cardset_tag)
353+
].image = card.image
356354

357355
group_cards[(card.group_tag, card.cardset_tag)].addCardCount(
358356
card.count
@@ -394,9 +392,7 @@ def filter_sort_cards(cards, options):
394392

395393
# Split out Official and Fan set information
396394
Official_sets = set() # Will hold official sets
397-
Official_search = (
398-
[]
399-
) # Will hold official sets for searching, both set key and set_name
395+
Official_search = [] # Will hold official sets for searching, both set key and set_name
400396
Fan_sets = set() # Will hold fan sets
401397
Fan_search = [] # Will hold fan sets for searching, both set key and set_name
402398
wantedSets = set() # Will hold all the sets requested for printing

0 commit comments

Comments
 (0)