Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
39 changes: 39 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
14 changes: 0 additions & 14 deletions .github/workflows/pre-commit.yml

This file was deleted.

44 changes: 44 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
# Basic configuration for Packit
# See documentation: https://packit.dev/docs/configuration/

specfile_path: python-targetcli-fb.spec

upstream_package_name: targetcli-fb
# In Fedora, Python packages are prefixed with 'python-'
downstream_package_name: python3-targetcli

# Use hatch to create the source archive
actions:
create-archive:
- hatch build -t sdist
- bash -c "ls -1t ./dist/*.tar.gz | head -n 1"

srpm_build_deps:
- python3-devel
- python3-pip
- hatch
- python3-hatchling
- python3-hatch-vcs

jobs:
# Test PRs in COPR
- job: copr_build
trigger: pull_request
targets:
- fedora-latest-stable
- epel-9

# Run tests
- job: tests
trigger: pull_request
targets:
- fedora-latest-stable
- epel-9

# Sync with Fedora when a new release is created
- job: propose_downstream
trigger: release
dist_git_branches:
- fedora-all
- epel-9
15 changes: 13 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.4.2
rev: v0.11.13
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-ast
Expand All @@ -21,3 +21,14 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/packit/pre-commit-hooks
rev: v1.3.0
hooks:
- id: validate-config

ci:
autofix_commit_msg: |
Auto fixes from pre-commit.com hooks
autofix_prs: false
autoupdate_schedule: monthly
4 changes: 4 additions & 0 deletions ci-tests/sts.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plan:
import:
url: https://gitlab.com/rh-kernel-stqe/sts
name: /plans/lio/core
69 changes: 69 additions & 0 deletions python-targetcli-fb.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Name: python-targetcli-fb
Version: 2.1.58
Release: %autorelease
Summary: Command shell for managing the Linux LIO kernel target

License: Apache-2.0
URL: https://github.com/open-iscsi/targetcli-fb
Source: %{pypi_source targetcli}

BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: python3-pip
BuildRequires: hatch
BuildRequires: python3-hatch-vcs
BuildRequires: python3-hatchling
BuildRequires: systemd-rpm-macros

%global _description %{expand:
An administration shell for configuring iSCSI, FCoE, and other SCSI targets,
using the TCM/LIO kernel target subsystem.
}

%description
%{_description}

%package -n targetcli
Summary: %{summary}
Requires: python3-configshell
Requires: python3-rtslib
Requires: target-restore
Requires: python3-six
Requires: python3-dbus
Requires: python3-gobject-base

%description -n targetcli
%{_description}

%prep
%autosetup -n targetcli-%{version}

%build
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files targetcli

mkdir -p %{buildroot}%{_sysconfdir}/target/backup
install -d %{buildroot}%{_unitdir}
install -p -m 644 systemd/targetclid.service %{buildroot}%{_unitdir}/
install -p -m 644 systemd/targetclid.socket %{buildroot}%{_unitdir}/
install -d %{buildroot}%{_mandir}/man8
install -p -m 644 targetcli.8 %{buildroot}%{_mandir}/man8/
install -p -m 644 targetclid.8 %{buildroot}%{_mandir}/man8/

%files -n targetcli -f %{pyproject_files}
%license COPYING
%doc README.md THANKS
%{_bindir}/targetcli
%{_bindir}/targetclid
%{_mandir}/man8/targetcli.8*
%{_mandir}/man8/targetclid.8*
%{_unitdir}/targetclid.service
%{_unitdir}/targetclid.socket
%dir %{_sysconfdir}/target
%dir %{_sysconfdir}/target/backup

%changelog
%autochangelog