Skip to content

Commit

Permalink
Run REUSE tool through tox
Browse files Browse the repository at this point in the history
  • Loading branch information
amezin committed Dec 31, 2024
1 parent 0584577 commit 9263adf
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 7 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ jobs:
continue-on-error: true
if: ${{ inputs.testspace }}

- name: Check REUSE compatibility
run: reuse lint
if: ${{ always() && steps.checkout.conclusion == 'success' }}

- name: Pre-create pip cache directory
run: mkdir -p "$HOME/.cache/pip"
if: ${{ always() && steps.checkout.conclusion == 'success' }}

- name: Check REUSE compliance
run: tox --sitepackages -e reuse
if: ${{ always() && steps.checkout.conclusion == 'success' }}

- name: Install JS dependencies
id: npm
run: npm install
Expand Down Expand Up @@ -182,6 +182,14 @@ jobs:
id: npm
run: npm install

- name: Pre-create pip cache directory
run: mkdir -p "$HOME/.cache/pip"
if: ${{ always() && steps.checkout.conclusion == 'success' }}

- name: Install Python dependencies
run: tox --notest --sitepackages -e reuse
if: ${{ always() && steps.checkout.conclusion == 'success' }}

- name: Prepare build directory
run: .github/faketty.sh meson setup ${{ matrix.flags }} '-Dshebang_override=/usr/bin/env gjs' build

Expand Down
7 changes: 4 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,12 @@ run_target(
command: [run_gnome_shell_xephyr_x11_command, pack_target],
)

toxinidir = meson.current_source_dir()
toxworkdir = toxinidir / '.tox'

reuse_tool = find_program(
'reuse',
dirs: toxworkdir / 'reuse' / 'bin',
required: false,
disabler: true,
version: '>=4.0.0',
Expand Down Expand Up @@ -324,9 +328,6 @@ test(
suite: ['markdownlint'],
)

toxinidir = meson.current_source_dir()
toxworkdir = toxinidir / '.tox'

flake8_tool = find_program(
'flake8',
dirs: toxworkdir / 'lint' / 'bin',
Expand Down
5 changes: 5 additions & 0 deletions requirements/reuse.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2024 Aleksandr Mezin <mezin.alexander@gmail.com>
#
# SPDX-License-Identifier: CC0-1.0

reuse~=5.0.2
32 changes: 32 additions & 0 deletions requirements/reuse.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --strip-extras reuse.in
#
attrs==24.3.0
# via reuse
binaryornot==0.4.4
# via reuse
boolean-py==4.0
# via
# license-expression
# reuse
chardet==5.2.0
# via
# binaryornot
# python-debian
click==8.1.8
# via reuse
jinja2==3.1.5
# via reuse
license-expression==30.4.0
# via reuse
markupsafe==3.0.2
# via jinja2
python-debian==0.1.49
# via reuse
reuse==5.0.2
# via -r reuse.in
tomlkit==0.13.2
# via reuse
5 changes: 5 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ commands =
{envpython} -m piptools compile --strip-extras {posargs} test.in
{envpython} -m piptools compile --strip-extras {posargs} test-images.in
{envpython} -m piptools compile --strip-extras {posargs} lint.in
{envpython} -m piptools compile --strip-extras {posargs} reuse.in
{envpython} -m piptools compile --strip-extras {posargs} pip-compile.in

[testenv:images]
Expand All @@ -43,3 +44,7 @@ commands = {envpython} test/images.py {posargs: pull}
[testenv:lint]
deps = -r requirements/lint.txt
commands = {envpython} -m flake8 {posargs}

[testenv:reuse]
deps = -r requirements/reuse.txt
commands = {envpython} -m reuse {posargs: lint}

0 comments on commit 9263adf

Please sign in to comment.