File python-terravision.spec of Package python-terravision

#
# spec file for package python-terravision
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%{?sle15_python_module_pythons}
Name:           python-terravision
Version:        0.18.0
Release:        0
Summary:        Visualises Terraform code by analysing the code dynamically
License:        MPL-2.0
URL:            https://github.com/patrickchugh/terravision
# not available on PyPI
Source:         terravision-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module base >= 3.11}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module wheel}
BuildRequires:  %{python_module poetry-core}
# https://github.com/patrickchugh/terravision/blob/main/pyproject.toml#L11
BuildRequires:  %{python_module GitPython >= 3.1.31}
BuildRequires:  %{python_module PyYAML >= 6.0}
BuildRequires:  %{python_module click >= 8.1.3}
BuildRequires:  %{python_module debugpy >= 1.8.0}
BuildRequires:  %{python_module graphviz >= 0.20.1}
BuildRequires:  %{python_module ipaddr >= 2.2.0}
BuildRequires:  %{python_module python-hcl2 >= 4.3.0}
BuildRequires:  %{python_module ollama >= 0.6.1}
BuildRequires:  %{python_module requests >= 2.32.3}
BuildRequires:  %{python_module tomli >= 2.0.1}
BuildRequires:  %{python_module tqdm >= 4.65.0}
BuildRequires:  %{python_module graphviz2drawio >= 1.1.0}
# https://github.com/patrickchugh/terravision/blob/main/pyproject.toml#L26
# SECTION test requirements
BuildRequires:  %{python_module black}
BuildRequires:  %{python_module isort}
BuildRequires:  %{python_module pytest}
# /SECTION
BuildRequires:  fdupes

# https://github.com/patrickchugh/terravision/blob/main/pyproject.toml#L11
Requires:        python-GitPython >= 3.1.31
Requires:        python-PyYAML >= 6.0
Requires:        python-click >= 8.1.3
Requires:        python-debugpy >= 1.8.0
Requires:        python-graphviz >= 0.20.1
Requires:        python-ipaddr >= 2.2.0
Requires:        python-python-hcl2 >= 4.3.0
Requires:        python-ollama >= 0.6.1
Requires:        python-requests >= 2.32.3
Requires:        python-tomli >= 2.0.1
Requires:        python-tqdm >= 4.65.0
Requires:        python-graphviz2drawio >= 1.1.0
Requires(post): update-alternatives
Requires(postun):update-alternatives
BuildArch:      noarch
%python_subpackages

%description
TerraVision is a CLI tool that converts Terraform code into Professional Cloud
Architecture Diagrams and solves the problem of keeping the most important
document in cloud projects, the architecture document, up to date. With high
velocity releases the norm now, machine generated architecture diagrams are
more accurate than relying on the freestyle diagram drawn by the cloud
architect that doesn't match reality anymore. Terravision securely runs 100%
Client Side without any dependency on Terraform or access to your Cloud
environment, to dynamically parse your conditionally created resources and
variables and generate an automatic visual of your architecture. Terravision is
designed to be a 'Docs as Code' (DaC) tool that can be included in your CI/CD
pipeline to update architecture diagrams after your build/test/release pipeline
phases and supplement other document generators like readthedocs.io alongside
it. It currently Supports AWS and soon Google and Azure cloud.

%prep
%autosetup -p1 -n terravision-%{version}

%build
%pyproject_wheel

%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/terravision
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%post
%python_install_alternative terravision

%postun
%python_uninstall_alternative terravision

%files %{python_files}
%doc README.md
%{python_sitelib}/terravision-%{version}.dist-info
%python_alternative %{_bindir}/terravision

%changelog
openSUSE Build Service is sponsored by