Skip to content

Commit 56577f1

Browse files
committed
uv, drop py 3.8
1 parent fc8e49e commit 56577f1

19 files changed

+436
-88
lines changed

.github/workflows/test-lint.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
strategy:
1717
matrix:
1818
python-version:
19-
- '3.8'
2019
- '3.9'
2120
- '3.10'
2221
- '3.11'
2322
- '3.12'
23+
- '3.13'
2424

2525
steps:
2626
- name: Checkout code
@@ -31,16 +31,16 @@ jobs:
3131
with:
3232
python-version: ${{ matrix.python-version }}
3333

34-
- name: Install Poetry
34+
- name: Install UV
3535
run: |
36-
curl -sSL https://install.python-poetry.org | python3 -
36+
curl -LsSf https://astral.sh/uv/install.sh | sh
3737
3838
- name: Install dependencies
39-
run: poetry install
39+
run: uv sync
4040

4141
- name: Run pytest
42-
run: poetry run pytest ./tests/platform_independent
42+
run: uv run pytest
4343

4444
- name: Run ruff
45-
run: poetry run ruff check --output-format=github
45+
run: uv run ruff check --output-format=github
4646
continue-on-error: true

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
requirements_optional.txt
1+
!test
2+
uv.lock
3+
profile.*
4+
5+
# DepHell stuff
26
poetry.lock
3-
*.~lock*
4-
*.sqlite
5-
tests/data/test_main_tc*.*
6-
!tests/data/test_main_tc*_expected.*
77

88
# Byte-compiled / optimized / DLL files
99
__pycache__/

.pre-commit-config.yaml

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.3.3
3+
rev: v0.9.6
44
hooks:
55
- id: ruff
66
args: [ --fix ]
77
- id: ruff-format
88

99
- repo: https://github.com/RobertCraigie/pyright-python
10-
rev: v1.1.354
10+
rev: v1.1.394
1111
hooks:
1212
- id: pyright
1313

14-
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
15-
rev: v1.3.3
14+
- repo: local
1615
hooks:
17-
- id: python-safety-dependencies-check
18-
files: pyproject.toml
16+
- id: generate requirements
17+
name: generate requirements
18+
entry: uv export --no-hashes --no-emit-project --no-dev -o requirements.txt
19+
language: system
20+
pass_filenames: false
21+
- id: safety
22+
name: safety
23+
entry: uv run safety
24+
language: system
25+
pass_filenames: false
26+
- id: make docs
27+
name: make docs
28+
entry: uv run handsdown --cleanup -o documentation/reference
29+
language: system
30+
pass_filenames: false
31+
- id: build package
32+
name: build package
33+
entry: uv build
34+
language: system
35+
pass_filenames: false
36+
- id: pytest
37+
name: pytest
38+
entry: uv run pytest
39+
language: system
40+
pass_filenames: false
1941

2042
- repo: https://github.com/pre-commit/pre-commit-hooks
21-
rev: v4.5.0
43+
rev: v5.0.0
2244
hooks:
2345
- id: trailing-whitespace
2446
- id: end-of-file-fixer
@@ -35,7 +57,7 @@ repos:
3557
- id: mixed-line-ending
3658

3759
- repo: https://github.com/boidolr/pre-commit-images
38-
rev: v1.5.2
60+
rev: v1.8.4
3961
hooks:
4062
- id: optimize-jpg
4163
- id: optimize-png

licensecheck/packageinfo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def getMyPackageMetadata() -> dict[str, Any]:
162162

163163
if Path("pyproject.toml").exists():
164164
pyproject = tomli.loads(Path("pyproject.toml").read_text(encoding="utf-8"))
165-
tool = pyproject.get("tool",{})
165+
tool = pyproject.get("tool", {})
166166
if "poetry" in tool:
167167
return tool["poetry"]
168168
if "flit" in tool:
@@ -188,7 +188,7 @@ def getMyPackageLicense() -> ucstr:
188188
if "license" in metaData:
189189
if isinstance(metaData["license"], dict) and metaData["license"].get("text") is not None:
190190
return ucstr(metaData["license"].get("text", UNKNOWN))
191-
return ucstr(f'{metaData["license"]}')
191+
return ucstr(f"{metaData['license']}")
192192
return ucstr(input("Enter the project license\n>"))
193193

194194

pyproject.toml

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
[tool.poetry]
1+
[project]
22
name = "licensecheck"
33
version = "2024.3"
4-
license = "mit"
54
description = "Output the licenses used by dependencies and check if these are compatible with the project license"
6-
authors = ["FredHappyface"]
5+
authors = [{ name = "FredHappyface" }]
6+
requires-python = ">=3.9"
7+
readme = "README.md"
8+
license = "mit"
79
classifiers = [
810
"Environment :: Console",
911
"Environment :: MacOS X",
@@ -16,41 +18,39 @@ classifiers = [
1618
"Programming Language :: Python :: Implementation :: CPython",
1719
"Topic :: Security",
1820
"Topic :: Software Development :: Libraries :: Python Modules",
19-
"Topic :: Utilities"
21+
"Topic :: Utilities",
22+
]
23+
dependencies = [
24+
"appdirs>=1.4.4",
25+
"fhconfparser>=2024.1",
26+
"loguru>=0.7.3",
27+
"markdown>=3.7",
28+
"packaging>=24.2",
29+
"requests>=2.32.3",
30+
"requests-cache>=1.2.1",
31+
"requirements-parser>=0.11.0",
32+
"rich>=13.9.4",
33+
"tomli>=2.2.1",
34+
"uv>=0.6.2",
2035
]
21-
homepage = "https://github.com/FHPythonUtils/LicenseCheck"
22-
repository = "https://github.com/FHPythonUtils/LicenseCheck"
23-
documentation = "https://github.com/FHPythonUtils/LicenseCheck/blob/master/README.md"
24-
readme = "README.md"
25-
26-
[tool.poetry.scripts]
27-
licensecheck = 'licensecheck:cli'
2836

29-
[tool.poetry.dependencies]
30-
python = "^3.8"
31-
requests = "<3,>=2.31.0"
32-
fhconfparser = "<2026,>=2024.1"
33-
tomli = "<3,>=2.0.1"
34-
rich = "<14,>=13.7.1"
35-
requests-cache = "<2,>=1.2.0"
36-
packaging = "<25,>=24.0"
37-
loguru = "<2,>=0.7.2"
38-
appdirs = "<2,>=1.4.4"
39-
markdown = "<4,>=3.6"
40-
uv = "<2,>=0.3.3"
41-
requirements-parser = "<2,>=0.11.0"
37+
[project.urls]
38+
Homepage = "https://github.com/FHPythonUtils/LicenseCheck"
39+
Repository = "https://github.com/FHPythonUtils/LicenseCheck"
40+
Documentation = "https://github.com/FHPythonUtils/LicenseCheck/blob/master/README.md"
4241

43-
[tool.poetry.group.dev.dependencies]
44-
pytest = "^8.1.1"
45-
handsdown = "^2.1.0"
46-
coverage = "^7.4.4"
47-
ruff = "^0.3.3"
48-
pyright = "^1.1.354"
49-
pytest-loguru = "^0.3.0"
42+
[project.scripts]
43+
licensecheck = "licensecheck:cli"
5044

51-
[build-system]
52-
requires = ["poetry-core"]
53-
build-backend = "poetry.core.masonry.api"
45+
[dependency-groups]
46+
dev = [
47+
"coverage>=7.6.1",
48+
"handsdown>=2.1.0",
49+
"pyright>=1.1.394",
50+
"pytest>=8.3.4",
51+
"pytest-loguru>=0.4.0",
52+
"ruff>=0.9.7",
53+
]
5454

5555
[tool.ruff]
5656
line-length = 100
@@ -60,7 +60,6 @@ target-version = "py38"
6060
[tool.ruff.lint]
6161
select = ["ALL"]
6262
ignore = [
63-
"ANN101", # type annotation for self in method
6463
"COM812", # enforce trailing comma
6564
"D2", # pydocstyle formatting
6665
"ISC001",
@@ -87,8 +86,6 @@ venvPath = "."
8786
venv = ".venv"
8887

8988
[tool.licensecheck]
90-
# using = "requirements:requirements.txt;requirements_optional.txt"
91-
# format = "json"
9289

9390
[tool.tox]
9491
legacy_tox_ini = """
@@ -103,3 +100,7 @@ env_list =
103100
deps = pytest
104101
commands = pytest tests
105102
"""
103+
104+
[build-system]
105+
requires = ["hatchling"]
106+
build-backend = "hatchling.build"

requirements.txt

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
1-
appdirs<2,>=1.4.4
2-
fhconfparser<2026,>=2024.1
3-
loguru<2,>=0.7.2
4-
markdown<4,>=3.6
5-
packaging<25,>=24.0
6-
requests-cache<2,>=1.2.0
7-
requests<3,>=2.31.0
8-
requirements-parser<2,>=0.11.0
9-
rich<14,>=13.7.1
10-
tomli<3,>=2.0.1
11-
uv<2,>=0.3.3
1+
# This file was autogenerated by uv via the following command:
2+
# uv export --no-hashes --no-emit-project --no-dev -o requirements.txt
3+
appdirs==1.4.4
4+
attrs==23.2.0
5+
cattrs==24.1.2
6+
certifi==2025.1.31
7+
charset-normalizer==3.4.1
8+
colorama==0.4.6 ; sys_platform == 'win32'
9+
exceptiongroup==1.2.2 ; python_full_version < '3.11'
10+
fhconfparser==2024.1
11+
idna==3.10
12+
importlib-metadata==8.6.1 ; python_full_version < '3.10'
13+
loguru==0.7.3
14+
markdown==3.7
15+
markdown-it-py==3.0.0
16+
mdurl==0.1.2
17+
packaging==24.2
18+
platformdirs==4.3.6
19+
pygments==2.19.1
20+
requests==2.32.3
21+
requests-cache==1.2.1
22+
requirements-parser==0.11.0
23+
rich==13.9.4
24+
six==1.17.0
25+
tomli==2.2.1
26+
types-setuptools==75.8.0.20250210
27+
typing-extensions==4.12.2 ; python_full_version < '3.11'
28+
url-normalize==1.4.3
29+
urllib3==2.3.0
30+
uv==0.6.2
31+
win32-setctime==1.2.0 ; sys_platform == 'win32'
32+
zipp==3.21.0 ; python_full_version < '3.10'

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
_ = _caplog
1010

1111

12-
@pytest.fixture()
12+
@pytest.fixture
1313
def caplog(_caplog: LogCaptureFixture) -> Generator[LogCaptureFixture, None, None]:
1414
"""Wrapper over caplog fixture to fix loguru logs.
1515

tests/data/test_main_tc1.txt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
Info
3+
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
4+
┃ Item ┃ Value ┃
5+
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
6+
│ program │ licensecheck │
7+
│ version │ dev │
8+
│ license │ MIT LICENSE │
9+
│ project_license │ MIT LICENSE │
10+
└─────────────────┴──────────────┘
11+
12+
List Of Packages
13+
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
14+
┃ Compatible ┃ Package ┃ License(s) ┃
15+
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
16+
│ ✔ │ Markdown │ BSD LICENSE │
17+
│ ✔ │ Pygments │ BSD LICENSE │
18+
│ ✔ │ appdirs │ MIT LICENSE │
19+
│ ✔ │ attrs │ MIT LICENSE │
20+
│ ✔ │ cattrs │ MIT LICENSE │
21+
│ ✔ │ certifi │ MOZILLA PUBLIC LICENSE 2.0 (MPL 2.0) │
22+
│ ✔ │ charset-normalizer │ MIT LICENSE │
23+
│ ✔ │ colorama │ BSD LICENSE │
24+
│ ✔ │ fhconfparser │ MIT LICENSE │
25+
│ ✔ │ idna │ BSD LICENSE │
26+
│ ✔ │ loguru │ MIT LICENSE │
27+
│ ✔ │ markdown-it-py │ MIT LICENSE │
28+
│ ✔ │ mdurl │ MIT LICENSE │
29+
│ ✔ │ packaging │ APACHE SOFTWARE LICENSE;; BSD LICENSE │
30+
│ ✔ │ platformdirs │ MIT LICENSE │
31+
│ ✔ │ requests │ APACHE SOFTWARE LICENSE │
32+
│ ✔ │ requests-cache │ BSD LICENSE │
33+
│ ✔ │ requirements-parser │ APACHE SOFTWARE LICENSE │
34+
│ ✔ │ rich │ MIT LICENSE │
35+
│ ✔ │ six │ MIT LICENSE │
36+
│ ✔ │ tomli │ MIT LICENSE │
37+
│ ✔ │ types-setuptools │ APACHE SOFTWARE LICENSE │
38+
│ ✔ │ url-normalize │ MIT LICENSE │
39+
│ ✔ │ urllib3 │ MIT LICENSE │
40+
│ ✔ │ uv │ MIT LICENSE;; APACHE SOFTWARE LICENSE │
41+
│ ✔ │ win32_setctime │ MIT LICENSE │
42+
└────────────┴─────────────────────┴───────────────────────────────────────┘
43+

tests/data/test_main_tc3.txt

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
Info
3+
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
4+
┃ Item ┃ Value ┃
5+
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━┩
6+
│ program │ licensecheck │
7+
│ version │ dev │
8+
│ license │ MIT LICENSE │
9+
│ project_license │ BSD LICENSE │
10+
└─────────────────┴──────────────┘
11+
12+
List Of Packages
13+
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
14+
┃ Compatible ┃ Package ┃ License(s) ┃
15+
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
16+
│ ✔ │ Markdown │ BSD LICENSE │
17+
│ ✔ │ Pygments │ BSD LICENSE │
18+
│ ✔ │ appdirs │ MIT LICENSE │
19+
│ ✔ │ attrs │ MIT LICENSE │
20+
│ ✔ │ cattrs │ MIT LICENSE │
21+
│ ✔ │ certifi │ MOZILLA PUBLIC LICENSE 2.0 (MPL 2.0) │
22+
│ ✔ │ charset-normalizer │ MIT LICENSE │
23+
│ ✔ │ colorama │ BSD LICENSE │
24+
│ ✔ │ fhconfparser │ MIT LICENSE │
25+
│ ✔ │ idna │ BSD LICENSE │
26+
│ ✔ │ loguru │ MIT LICENSE │
27+
│ ✔ │ markdown-it-py │ MIT LICENSE │
28+
│ ✔ │ mdurl │ MIT LICENSE │
29+
│ ✔ │ packaging │ APACHE SOFTWARE LICENSE;; BSD LICENSE │
30+
│ ✔ │ platformdirs │ MIT LICENSE │
31+
│ ✔ │ requests │ APACHE SOFTWARE LICENSE │
32+
│ ✔ │ requests-cache │ BSD LICENSE │
33+
│ ✔ │ requirements-parser │ APACHE SOFTWARE LICENSE │
34+
│ ✔ │ rich │ MIT LICENSE │
35+
│ ✔ │ six │ MIT LICENSE │
36+
│ ✔ │ tomli │ MIT LICENSE │
37+
│ ✔ │ types-setuptools │ APACHE SOFTWARE LICENSE │
38+
│ ✔ │ url-normalize │ MIT LICENSE │
39+
│ ✔ │ urllib3 │ MIT LICENSE │
40+
│ ✔ │ uv │ MIT LICENSE;; APACHE SOFTWARE LICENSE │
41+
│ ✔ │ win32_setctime │ MIT LICENSE │
42+
└────────────┴─────────────────────┴───────────────────────────────────────┘
43+

0 commit comments

Comments
 (0)