Skip to content

Commit 25e8541

Browse files
committed
refactor(project): Initial buildsystem replacement
Signed-off-by: Helio Chissini de Castro <helio.chissini.de.castro@cariad.technology>
1 parent 4ab8b2f commit 25e8541

13 files changed

Lines changed: 2758 additions & 511 deletions

File tree

.VERSION

Lines changed: 0 additions & 3 deletions
This file was deleted.

.gitattributes

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/docs.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,36 @@
11
name: generate Documentation
22

3-
on: [push, pull_request]
3+
on: [ push, pull_request ]
44

55
jobs:
66
build:
7-
runs-on: ubuntu-22.04
7+
runs-on: ubuntu-24.04
88
permissions:
99
contents: read
1010

1111
strategy:
1212
max-parallel: 4
1313
matrix:
14-
python-version: [3.12]
14+
python-version: [ 3.13 ]
1515

1616
steps:
17-
- name: Checkout code
18-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19-
20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
17+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18+
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
2219
with:
20+
activate-environment: true
2321
python-version: ${{ matrix.python-version }}
22+
enable-cache: true
2423

25-
- name: Give permission to run scripts
26-
run: chmod +x ./docs/scripts/doc8_style_check.sh
27-
28-
- name: Install Dependencies
29-
working-directory: ./docs
30-
run: pip install -r requirements.txt
24+
- shell: bash
25+
run: |
26+
uv sync
3127
3228
- name: Check Sphinx Documentation build minimally
33-
working-directory: ./docs
34-
run: sphinx-build -b linkcheck -EW source build
29+
working-directory: docs
30+
run: |
31+
hatch run docs:check_build
3532
3633
- name: Check for documentation style errors
37-
working-directory: ./docs
38-
run: ./scripts/doc8_style_check.sh
34+
working-directory: docs
35+
run: |
36+
hatch run docs:check_style

.github/workflows/main.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: run tests
22

3-
on: [push, pull_request]
4-
3+
on: [ push, pull_request ]
54

65
env:
76
DB_NAME: vulnerablecode
@@ -10,7 +9,7 @@ env:
109

1110
jobs:
1211
build:
13-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1413
permissions:
1514
contents: read
1615

@@ -22,38 +21,32 @@ jobs:
2221
POSTGRES_USER: ${{ env.DB_USER }}
2322
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
2423
options: >-
25-
--health-cmd pg_isready
26-
--health-interval 10s
27-
--health-timeout 5s
28-
--health-retries 5
24+
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2925
ports:
3026
- 5432:5432
3127

3228
strategy:
3329
max-parallel: 4
3430
matrix:
35-
python-version: ["3.12", "3.13"]
31+
python-version: [ "3.13" ]
3632

3733
steps:
38-
- name: Checkout code
39-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
40-
41-
- name: Set up Python ${{ matrix.python-version }}
42-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
34+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
35+
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
4336
with:
37+
activate-environment: true
4438
python-version: ${{ matrix.python-version }}
45-
39+
cache: true
4640

47-
- name: Install dependencies
48-
run: make dev envfile
49-
# Disable codestyle checks until we have cleaned up the code
50-
# - name: Validate code format
51-
# run: make check
41+
- shell: bash
42+
run: |
43+
uv sync
5244
5345
- name: Run tests
54-
run: make test
46+
run: |
47+
pytest -vvs -m "not webtest" --disable-warnings
5548
env:
56-
GH_TOKEN: 1
49+
GH_TOKEN: 1
5750
POSTGRES_HOST: localhost
5851
POSTGRES_PORT: 5432
5952
VULNERABLECODE_DB_NAME: ${{ env.DB_NAME }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,8 @@ tcl
119119

120120
# Ignore Jupyter Notebook related temp files
121121
.ipynb_checkpoints/
122+
123+
# Ignore old setup tools
124+
setup.py
125+
setup.cfg
126+
MANIFEST.in

prek.toml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Configuration file for `prek`, a git hook framework written in Rust.
2+
# See https://prek.j178.dev for more information.
3+
#:schema https://www.schemastore.org/prek.json
4+
5+
default_language_version.python = "3.13"
6+
default_install_hook_types = ["pre-commit", "commit-msg"]
7+
8+
[[repos]]
9+
repo = "https://github.com/pre-commit/pre-commit-hooks"
10+
rev = "v6.0.0"
11+
hooks = [
12+
{ id = "trailing-whitespace" },
13+
{ id = "end-of-file-fixer" },
14+
{ id = "check-yaml" },
15+
{ id = "check-added-large-files" },
16+
{ id = "check-symlinks" },
17+
{
18+
id = "mixed-line-ending",
19+
args = ["--fix=lf"]
20+
}
21+
]
22+
23+
[[repos]]
24+
repo = "https://github.com/astral-sh/ruff-pre-commit"
25+
rev = "v0.15.9"
26+
hooks = [
27+
{
28+
id = "ruff",
29+
args = ["--fix"]
30+
},
31+
{ id = "ruff-format" }
32+
]
33+
34+
[[repos]]
35+
repo = "https://github.com/compilerla/conventional-pre-commit"
36+
rev = "v4.4.0"
37+
hooks = [
38+
{
39+
id = "conventional-pre-commit",
40+
stages = ["commit-msg"]
41+
}
42+
]
43+
44+
[[repos]]
45+
repo = "https://github.com/astral-sh/uv-pre-commit"
46+
rev = "0.11.3"
47+
hooks = [
48+
{ id = "uv-lock" }
49+
]
50+
51+
[[repos]]
52+
repo = "https://github.com/codespell-project/codespell"
53+
rev = "v2.4.2"
54+
hooks = [
55+
{ id = "codespell" }
56+
]
57+
58+
[[repos]]
59+
repo = "https://github.com/allganize/ty-pre-commit"
60+
rev = "v0.0.29"
61+
hooks = [
62+
{
63+
id = "ty-check",
64+
args = [
65+
"--output-format=full"
66+
],
67+
additional_dependencies = [
68+
"click",
69+
"deprecated",
70+
"jira",
71+
"python-magic",
72+
"pyartifactory",
73+
"pydantic",
74+
"pytest",
75+
"python-optima",
76+
"pyyaml",
77+
"rich",
78+
"tenacity",
79+
"toml",
80+
"slack_sdk",
81+
"jinja2",
82+
"requests"
83+
]
84+
}
85+
]

0 commit comments

Comments
 (0)