Using RPMs and dependency management with .txt requirements

I have a current project in which I am going to build using multiple packages. I had a lot of experience in the past with Java / Maven and PHP / composer, but I recently got into python with a new concert, and I don't know how "python" does dependency management. I read about using pip with the requirements.txt file, as well as using the settings module to store dependencies. I am not very impressed with using txt files, but this is another discussion.

It was suggested that you create rpm packages from python modules and manage puppets in our environment. I'm curious what the pros and cons of managing dependencies are, therefore, against dependency management in the main repository using pip.

Hope this makes sense. Thanks in advance!

+4
source share
1 answer

Puppet is a really great dependency management tool. Personally, I found that creating RPMs from Python modules is something like PITA. The type Puppet packagehas the support of a package provider .

Here's a puppet class that will install a couple of sample packages from pip (depending on the EPEL repository that is installed to install python-pipthrough yum):

class pip_modules {
    package { "python-pip":
        ensure => installed,
    }
    $pip_packages = [
        "requests",
        "simplejson"
    ]
    package { $pip_packages:
        ensure => installed,
        provider => pip,
        require => Package["python-pip"]
    }
}

, , requirements.txt, . , pip freeze > requirements.txt , pip install -r requirements.txt - , , exec.

- (-) RPM, , ( RPM) . , pip/puppet , , , RPM .deb .

0

Source: https://habr.com/ru/post/1542726/


All Articles