How to use the rpg.Base function in rpg

To help you get started, we’ve selected a few rpg examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rh-lab-q / rpg / tests / mock_build / test_build_libsolv.py View on Github external
def test_rpg_project(self):
        self.base = Base()
        self.base.sack = self.base.load_dnf_sack()
        self.base.load_plugins()
        self.base.load_project_from_url(
            "https://github.com/openSUSE/libsolv")
        self.base.spec.Name = "LibSolv"
        self.base.spec.Version = "0.6.11"
        self.base.spec.Release = "1%{?snapshot}%{?dist}"
        self.base.spec.License = "GPLv2"
        self.base.spec.Summary = "Library for solving repository info"
        self.base.spec.description = (
            "This is libsolv, a free package dependency solver "
            "using a satisfiability algorithm.")
        self.base.spec.URL = "https://github.com/openSUSE/libsolv"
        self.base.target_arch = "x86_64"
        self.base.target_distro = "fedora-22"
        self.base.fetch_repos(self.base.target_distro, self.base.target_arch)
github rh-lab-q / rpg / tests / unit / test_build_srpm.py View on Github external
from tests.support import RpgTestCase
from rpg import Base
from rpg.package_builder import PackageBuilder
from rpg.spec import Spec
from pathlib import Path
import os


class FakeBase(Base):

    base_dir = Path(RpgTestCase.test_project_dir / "hello_project")
    project_name = "hello"

    def __init__(self):
        self._package_builder = PackageBuilder()
        self.spec = Spec()
        self.spec.Name = "hello"
        self.spec.Version = "1.4"
        self.spec.Release = "1%{?dist}"
        self.spec.Summary = "Hello World test program"
        self.spec.License = "GPLv2"
        self.spec.Source = "hello-1.4.tar.gz"
        self.spec.description = "Hello World C project for testing RPG."
        self.spec.prep = r'%autosetup'
        self.spec.build = "make"
github rh-lab-q / rpg / tests / mock_build / test_build_hawkey.py View on Github external
def test_hawkey_project(self):
        self.base = Base()
        self.base.sack = self.base.load_dnf_sack()
        self.base.load_plugins()
        self.base.load_project_from_url(
            r"https://github.com/rpm-software-management/"
            "hawkey/archive/hawkey-0.5.7-1.tar.gz")
        self.base.spec.Name = "hawkey"
        self.base.spec.Version = "0.6.0"
        self.base.spec.Release = "1%{?snapshot}%{?dist}"
        self.base.spec.License = "LGPLv2+"
        self.base.spec.Summary = ("Library providing simplified "
                                  "C and Python API to libsolv")
        self.base.spec.description = ("A Library providing simplified "
                                      "C and Python API to libsolv.")
        self.base.spec.URL = (r"https://github.com/rpm-"
                              "software-management/%{name}")
        self.base.target_arch = "x86_64"
github rh-lab-q / rpg / tests / unit / test_base.py View on Github external
def setUp(self):
        self.base = Base()
        self.base.load_plugins()
github rh-lab-q / rpg / tests / mock_build / test_build_rpg.py View on Github external
def test_rpg_project(self):
        self.base = Base()
        self.base.sack = self.base.load_dnf_sack()
        self.base.load_plugins()
        self.base.load_project_from_url(
            "https://github.com/rh-lab-q/rpg/archive/master.zip")
        self.base.spec.Name = "rpg"
        self.base.spec.Version = "0.0.2"
        self.base.spec.Release = "1%{?snapshot}%{?dist}"
        self.base.spec.License = "GPLv2"
        self.base.spec.Summary = "RPM Package Generator"
        self.base.spec.description = (
            "RPG is tool, that guides people through"
            "the creation of a RPM package. RPG makes packaging much easier"
            "due to the automatic analysis of packaged files. Beginners can"
            "get familiar with packaging process or the advanced users can"
            "use our tool for a quick creation of a package.")
        self.base.spec.URL = "https://github.com/rh-lab-q/rpg"
github rh-lab-q / rpg / tests / unit / test_functional.py View on Github external
def test_c_project(self):
        base = Base()
        base.load_plugins()
        base.load_project_from_url(
            self.test_project_dir / "hello_project/hello-1.4.tar.gz")
        base.spec.Name = "hello"
        base.spec.Version = "1.4"
        base.spec.Release = "1%{?dist}"
        base.spec.License = "GPLv2"
        base.spec.Summary = "Hello World test program"
        base.spec.description = "desc"
        base.spec.build = "make"
        base.run_extracted_source_analysis()
        base.run_patched_source_analysis()
        expected = {
            '/usr/include/stdio.h',
        }
        dirs = [
github rh-lab-q / rpg / tests / mock_build / test_mock_analyse.py View on Github external
from rpg.package_builder import PackageBuilder
from rpg.command import Command
from rpg.spec import Spec
from rpg import Base
from tests.support import RpgTestCase
from pathlib import Path


class FakeConf(object):

    exclude = ""
    directories = []


class FakeBase(Base):

    base_dir = Path(RpgTestCase.test_project_dir / "mock_project")
    project_name = "mock"

    def __init__(self):
        self.spec = Spec()
        self.spec.Name = "mock"
        self.spec.Version = "1.0"
        self.spec.Release = "1%{?dist}"
        self.spec.Summary = "Hello World test program"
        self.spec.License = "GPLv2"
        self.spec.Source = "mock-1.0.tar.gz"
        self.spec.description = "Hello World C project for testing RPG."
        self.spec.prep = r'%autosetup'
        self.spec.build = "make"
        self.sack = self.load_dnf_sack()
github rh-lab-q / rpg / rpg.py View on Github external
def main():
    base = Base()
    app = QApplication(sys.argv)
    base.conf.parse_cmdline()
    if base.conf.load_dnf:
        base.sack = base.load_dnf_sack()
    base.load_plugins()
    wiz = Wizard(base)
    wiz.setObjectName("RPG")
    wiz.resize(850, 650)
    wiz.setMinimumSize(QtCore.QSize(850, 650))
    wiz.setMaximumSize(QtCore.QSize(850, 650))
    wiz.setBaseSize(QtCore.QSize(850, 650))
    wiz.show()

    logging.info('GUI loaded')
    sys.exit(app.exec_())