Skip to content

Commit 256559a

Browse files
authored
build: merge v3.0.1 to main
2 parents 74d650e + e36dbb4 commit 256559a

File tree

14 files changed

+234
-386
lines changed

14 files changed

+234
-386
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,10 @@ updates:
1616
commit-message:
1717
prefix: "poetry"
1818
target-branch: "develop"
19+
20+
- package-ecosystem: "github-actions"
21+
directory: "/"
22+
schedule:
23+
interval: "weekly"
24+
time: "12:00"
25+
day: "friday"

.github/workflows/codeql.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
- develop
88

99
pull_request:
10-
# The branches below must be a subset of the branches above
1110
branches:
1211
- main
1312
- develop

.github/workflows/tox.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ on:
77
- develop
88

99
pull_request:
10-
# The branches below must be a subset of the branches above
1110
branches:
1211
- main
1312
- develop
1413

1514
jobs:
1615
tests:
17-
runs-on: ubuntu-latest
16+
runs-on: macos-latest
1817
strategy:
1918
matrix:
2019
python-version: [ '3.10', '3.11' ]

.pre-commit-config.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ default_stages:
33

44
repos:
55
- repo: https://github.com/commitizen-tools/commitizen
6-
rev: v2.42.1
6+
rev: v3.0.1
77
hooks:
88
- id: commitizen
99
name: Check Convenient Commits
@@ -23,14 +23,6 @@ repos:
2323
name: Run isort
2424
types: [ python ]
2525

26-
- repo: https://github.com/PyCQA/docformatter
27-
rev: v1.5.1
28-
hooks:
29-
- id: docformatter
30-
name: Run docformatter
31-
types: [ python ]
32-
args: [ --config=./pyproject.toml]
33-
3426
- repo: local
3527
hooks:
3628
- id: pytest
@@ -53,3 +45,10 @@ repos:
5345
pass_filenames: false
5446
types: [ python ]
5547
entry: poetry run ruff check .
48+
49+
- id: docformatter
50+
name: Run docformatter
51+
language: system
52+
pass_filenames: false
53+
types: [ python ]
54+
entry: poetry run docformatter -cr . --config ./pyproject.toml

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ $ mac-cleanup -h
106106
usage: mac-cleanup [-h] [-n] [-u] [-c] [-p]
107107
108108
A Mac Cleanup Utility in Python
109-
3.0.0
109+
3.0.1
110110
https://github.com/mac-cleanup/mac-cleanup-py
111111
112112
options:

SECURITY.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
Any version with :x: are no longer supported and may face issues in it.
66

7-
| Version | Supported |
8-
|---------| ------------------ |
9-
| 3.0.0 | :white_check_mark: |
10-
| < 3.0 | :x: |
7+
| Version | Supported |
8+
|-----------|--------------------|
9+
| \>= 3.0.0 | :white_check_mark: |
10+
| < 3.0.0 | :x: |
1111

1212
## Reporting a Vulnerability
1313

14-
To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/mac-cleanup/mac-cleanup-py/security/advisories/new) tab.
14+
To report a security issue, please use [GitHub Issues](https://github.com/Drugsosos/mac-cleanup-py/issues/new/choose).

mac_cleanup/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def _count_dry(self) -> float:
204204
from mac_cleanup.progress import ProgressBar
205205

206206
# Extract all modules
207-
all_modules = list(chain(*[unit.modules for unit in self._execute_list]))
207+
all_modules = list(chain.from_iterable([unit.modules for unit in self._execute_list]))
208208

209209
# Filter modules based on Path
210210
path_modules: list[Path] = list(filter(partial(self.__filter_modules, filter_type=Path), all_modules))

poetry.lock

Lines changed: 186 additions & 309 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "mac_cleanup"
3-
version = "3.0.0"
3+
version = "3.0.1"
44
description = "Python cleanup script for macOS"
55
license = "Apache-2.0"
66
authors = [ "Drugsosos" ]
@@ -31,7 +31,7 @@ exclude = [ "mac_cleanup/__main__.py", "mac_cleanup/py.typed" ]
3131
[tool.poetry.dependencies]
3232
python = ">=3.10,<3.12"
3333
rich = "^13.3.4"
34-
attrs = "^22.2.0"
34+
attrs = "^23.1.0"
3535
inquirer = "^3.1.3"
3636
toml = "^0.10.2"
3737
beartype = "^0.13.1"
@@ -40,29 +40,20 @@ beartype = "^0.13.1"
4040
mac-cleanup = "mac_cleanup:main"
4141

4242
[tool.poetry.group.test.dependencies]
43-
tox = "^4.4.11"
44-
pytest = "^7.3.0"
43+
tox = "^4.5.0"
44+
pytest = "^7.3.1"
4545
pytest-cov = "^4.0.0"
46-
pyright = "^1.1.302"
47-
ruff = "^0.0.261"
48-
flake8-bugbear = "^23.3.23"
49-
flake8-comprehensions = "^3.12.0"
50-
flake8-print = "^5.0.0"
51-
flake8-quotes = "^3.3.2"
52-
flake8-builtins = "^2.1.0"
53-
flake8-pytest-style = "^1.7.2"
54-
flake8-blind-except = "^0.2.1"
55-
flake8-no-pep420 = "^2.3.0"
56-
flake8-simplify = "^0.20.0"
46+
pyright = "^1.1.304"
47+
ruff = "^0.0.263"
5748

5849
[tool.poetry.group.dev.dependencies]
59-
commitizen = "^2.42.1"
50+
commitizen = "^3.0.1"
6051
pre-commit = "^3.2.2"
6152

6253
[tool.poetry.group.lint.dependencies]
6354
black = "^23.3.0"
6455
isort = "^5.12.0"
65-
docformatter = "1.5.1"
56+
docformatter = "^1.6.3"
6657

6758
[build-system]
6859
requires = [ "poetry-core>=1.0.0" ]
@@ -135,12 +126,11 @@ select = [
135126
"SIM", # simplify
136127
]
137128

138-
139129
[tool.ruff.flake8-quotes]
140130
inline-quotes = "double"
141131
multiline-quotes = "double"
142132

143133
[tool.pytest.ini_options]
144-
minversion = "7.2.2"
134+
minversion = "7.3.1"
145135
addopts = "--cov=mac_cleanup"
146136
testpaths = [ "tests" ]

tests/conftest.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
from _pytest.monkeypatch import MonkeyPatch
33

44

5-
@pytest.fixture(scope="session", autouse=False)
6-
def get_current_os() -> str:
7-
import platform
8-
9-
return platform.system()
10-
11-
125
@pytest.fixture()
136
def _command_with_root(monkeypatch: MonkeyPatch) -> None: # pyright: ignore [reportUnusedFunction]
147
"""Simulate user has root."""

tests/test_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_actions_empty(self, get_namespace: Args):
4646
parser.parse_args(namespace=get_namespace)
4747

4848
# Check there is no attrs
49-
assert not any([getattr(get_namespace, attr) for attr in self.get_all_args_from_namespace(get_namespace)])
49+
assert not any(getattr(get_namespace, attr) for attr in self.get_all_args_from_namespace(get_namespace))
5050

5151
@pytest.mark.parametrize(
5252
"is_short_name",
@@ -66,4 +66,4 @@ def test_actions(self, is_short_name: bool, get_namespace: Args, get_parser_acti
6666
parser.parse_args(args=action_list, namespace=get_namespace)
6767

6868
# Check all attrs are set
69-
assert all([getattr(get_namespace, attr) for attr in self.get_all_args_from_namespace(get_namespace)])
69+
assert all(getattr(get_namespace, attr) for attr in self.get_all_args_from_namespace(get_namespace))

tests/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_cmd(command: str | int, ignore_errors: bool, output: str):
4545
(123, None),
4646
],
4747
)
48-
def test_expanduser(str_path: str | int, output: Optional[str], get_current_os: str):
48+
def test_expanduser(str_path: str | int, output: Optional[str]):
4949
"""Test wrapper of :meth:`pathlib.Path.expanduser` in :meth:`mac_cleanup.utils.expanduser`"""
5050

5151
from mac_cleanup.utils import expanduser
@@ -56,7 +56,7 @@ def test_expanduser(str_path: str | int, output: Optional[str], get_current_os:
5656
return
5757

5858
if output is None:
59-
assert expanduser(str_path=str_path).startswith("/Users/" if get_current_os == "Darwin" else "/home/runner")
59+
assert expanduser(str_path=str_path).startswith("/Users/")
6060
return
6161

6262
assert expanduser(str_path=str_path) == "."

tox.ini

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,32 @@
11
[tox]
2-
minversion = 4.4.11
3-
envlist = python3.10, python3.11, pyright, ruff, black, isort, docformatter
2+
minversion = 4.5.0
3+
envlist = py310, py311, pyright, ruff, black, isort, docformatter
44
isolated_build = True
55

66
[gh-actions]
77
python =
8-
3.10: python3.10, pyright, ruff, black, isort, docformatter
9-
3.11: python3.11
8+
3.10: py310, pyright, ruff, black, isort, docformatter
9+
3.11: py311
1010

1111
[testenv]
12-
skip_install = true
13-
allowlist_externals = poetry
14-
deps =
15-
poetry
16-
commands_pre =
17-
poetry install --without dev,lint --no-root -v
12+
basepython =
13+
py310, pyright, ruff, black, isort, docformatter: python3.10
14+
py311: python3.11
1815
setenv =
1916
PYTHONPATH = {toxinidir}
20-
commands =
21-
poetry run pytest
22-
23-
[testenv:{pyright, ruff}]
17+
py310, py311: GROUP = main,test
18+
pyright, ruff: GROUP = main,test
19+
black, isort, docformatter: GROUP = lint
2420
skip_install = true
2521
allowlist_externals = poetry
2622
deps =
2723
poetry
2824
commands_pre =
29-
poetry install --without dev,lint --no-root -v
30-
setenv =
31-
PYTHONPATH = {toxinidir}
25+
poetry install --only "{env:GROUP}" --no-root -v
3226
commands =
27+
py310, py311: poetry run pytest
3328
pyright: poetry run pyright
3429
ruff: poetry run ruff check .
35-
36-
[testenv:{black, isort, docformatter}]
37-
skip_install = true
38-
allowlist_externals = poetry
39-
deps =
40-
poetry
41-
commands_pre =
42-
poetry install --only lint --no-root -v
43-
setenv =
44-
PYTHONPATH = {toxinidir}
45-
commands =
4630
black: poetry run black . --check
4731
isort: poetry run isort . -c
4832
docformatter: poetry run docformatter -cr . --config ./pyproject.toml

0 commit comments

Comments
 (0)