diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..3ec8054 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -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}}" diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml deleted file mode 100644 index 7f579af..0000000 --- a/.github/workflows/pre-commit.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: pre-commit - -on: - pull_request: - push: - branches: [master] - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - - uses: pre-commit/action@v3.0.1 diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..cfd879b --- /dev/null +++ b/.packit.yaml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa26480..06f17b9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 diff --git a/ci-tests/sts.fmf b/ci-tests/sts.fmf new file mode 100644 index 0000000..6632211 --- /dev/null +++ b/ci-tests/sts.fmf @@ -0,0 +1,4 @@ +plan: + import: + url: https://gitlab.com/rh-kernel-stqe/sts + name: /plans/lio/core diff --git a/python-targetcli-fb.spec b/python-targetcli-fb.spec new file mode 100644 index 0000000..f19acf2 --- /dev/null +++ b/python-targetcli-fb.spec @@ -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