Skip to content

Commit

Permalink
WIP: Use packit to produce rpms
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Jul 8, 2021
1 parent 57a6d5b commit 1e665ff
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
specfile_path: ansible-lint.spec
actions:
create-archive:
- "python3 setup.py sdist --dist-dir ."
- "sh -c 'echo ansible-lint-$(python3 setup.py --version).tar.gz'"
get-current-version:
- "python3 setup.py --version"
jobs:
- job: copr_build
metadata:
targets:
# - centos-stream-x86_64
- fedora-stable
# - fedora-all
trigger: pull_request
# - job: tests
# trigger: pull_request
# metadata:
# targets:
# - fedora-all
# - job: propose_downstream
# trigger: release
# metadata:
# dist-git-branch: master
82 changes: 82 additions & 0 deletions ansible-lint.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# All tests require Internet access
# to test in mock use: --enable-network --with check
# to test in a privileged environment use:
# --with check --with privileged_tests
%bcond_with check
%bcond_with privileged_tests

Name: ansible-lint
Version: 5.1.0a2
Release: 1%{?dist}
Summary: TBD Ansible-lint summary

License: MIT
URL: https://github.com/ansible-community/ansible-lint
Source0: %{pypi_source}

BuildArch: noarch

BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-pip
BuildRequires: python%{python3_pkgversion}-setuptools
BuildRequires: python%{python3_pkgversion}-setuptools_scm
BuildRequires: python%{python3_pkgversion}-setuptools_scm_git_archive
%if %{with check}
# These are required for tests:
BuildRequires: python%{python3_pkgversion}-pyyaml
BuildRequires: python%{python3_pkgversion}-tabulate
BuildRequires: python%{python3_pkgversion}-jsonschema
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-flexmock
BuildRequires: python%{python3_pkgversion}-pytest-xdist
BuildRequires: python%{python3_pkgversion}-libselinux
BuildRequires: ansible
BuildRequires: podman
BuildRequires: buildah
BuildRequires: git
%endif
Requires: ansible
Requires: buildah

%description
TBD Ansible-lint description

%prep
%autosetup


%build
%py3_build


%install
%py3_install


%if %{with check}
%check
PYTHONPATH=%{buildroot}%{python3_sitelib} \
pytest-3 \
-v \
--disable-pytest-warnings \
--numprocesses=auto \
%if %{with privileged_tests}
tests
%else
tests/unit
%endif
%endif


%files
%{python3_sitelib}/ansiblelint/
%{python3_sitelib}/ansible_lint-*.egg-info/
%{_bindir}/ansible-lint
%license LICENSE
%doc docs/* README.rst



%changelog

Available at https://github.com/ansible-community/ansible-lint/releases

0 comments on commit 1e665ff

Please sign in to comment.