Skip to content

Commit b214f42

Browse files
authored
Merge pull request #99 from baszalmstra/ruff
feat(ci): add format, lint and testing and remove handling of REQUIRE_OPENGL and REQUIRE_GL magic values in deps
2 parents f6bc66d + 74cb15f commit b214f42

File tree

11 files changed

+147
-286
lines changed

11 files changed

+147
-286
lines changed

.flake8

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

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
fail-fast: false
16+
17+
steps:
18+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
19+
20+
- name: Setup Pixi
21+
uses: prefix-dev/setup-pixi@28eb668aafebd9dede9d97c4ba1cd9989a4d0004 # v0.9.2
22+
with:
23+
pixi-version: latest
24+
cache: true
25+
26+
- name: Check formatting
27+
run: pixi run fmt-check
28+
29+
- name: Run linter
30+
run: pixi run lint-check
31+
32+
- name: Run tests
33+
run: pixi run test

.github/workflows/enforce-sha.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
on:
2+
push:
3+
branches: [ main, master ]
4+
pull_request:
5+
6+
name: Security
7+
8+
permissions: read-all
9+
10+
jobs:
11+
ensure-pinned-actions:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
16+
- name: Ensure SHA pinned actions
17+
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@9e9574ef04ea69da568d6249bd69539ccc704e74 # v4

pixi.lock

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

pixi.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ version = "0.1.0"
99
test = "pytest vinca/"
1010

1111
# Code quality
12-
format = "black --safe --quiet ."
13-
lint = "flake8 vinca/"
12+
fmt = "ruff format ."
13+
fmt-check = "ruff format --check ."
14+
lint = "ruff check --fix ."
15+
lint-check = "ruff check ."
1416

1517
[dependencies]
1618
python = ">=3.14.0,<3.15"
@@ -28,8 +30,7 @@ license-expression = ">=30.0.0"
2830

2931
# Development dependencies
3032
pytest = "*"
31-
black = "*"
32-
flake8 = "*"
33+
ruff = "*"
3334

3435
[pypi-dependencies]
3536
vinca = { path = ".", editable = true}

ruff.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
line-length = 88
2+
target-version = "py37"
3+
4+
[lint]
5+
# Ignore rules that were excluded in .flake8:
6+
# D104: Missing docstring in public package
7+
# E501: Line too long (handled by line-length setting)
8+
ignore = ["D104", "D100", "E501"]
9+
10+
[lint.extend-per-file-ignores]
11+
# Exclude tests/data/* from all checks
12+
"tests/data/*" = ["ALL"]

vinca/distro.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ def get_depends(self, pkg, ignore_pkgs=None):
110110

111111
def get_released_repo(self, pkg_name):
112112
if self.snapshot and pkg_name in self.snapshot:
113-
114113
# In the case of snapshot, for rosdistro_additional_recipes
115114
# we also support a 'rev' field, so depending on what is available
116115
# we return either the tag or the rev, and the third argument is either 'rev' or 'tag'

vinca/generate_azure.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ def get_full_tree():
428428

429429

430430
def main():
431-
432431
args = parse_command_line(sys.argv)
433432

434433
full_tree = get_full_tree()

vinca/generate_gha.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,6 @@ def build_win_pipeline(stages, trigger_branch, outfile="win.yml", azure_template
356356
with open(".scripts/build_win.bat", "r") as fi:
357357
script = lu(fi.read())
358358

359-
jobs = []
360-
job_names = []
361359
prev_batch_keys = []
362360
for i, s in enumerate(stages):
363361
stage_name = f"stage_{i}"

vinca/license_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,7 @@ def convert_to_spdx_license(
149149
# Split by comma and process each part
150150
# Filter out empty strings from malformed input
151151
# (trailing/double commas)
152-
parts = [
153-
part.strip() for part in lic_str.split(",") if part.strip()
154-
]
152+
parts = [part.strip() for part in lic_str.split(",") if part.strip()]
155153
sub_licenses = []
156154
seen_sub = set()
157155
for part in parts:

0 commit comments

Comments
 (0)