Custom install post script not working with pip

Please, before marking it as a duplicate, I tried a bunch of solutions including here but no luck

I created a simple tool to do some tasks and was able to package it successfully.

When trying to install it, I get the desired effect when I use python setup.py install

, but pip install package_name

just installs the package, but after installing the post script.

Here is some of my code;

setup.py

from distutils import setup
from app.scripts import *

setup(

        #Application name
        name = "my-app-name",

        version = "my-app-version",
        author = "my-name",
        author_email = "my-email",
        packages = ['app'],
        include_package_data = True,
        license = 'MIT',
        url = "https://my-url",
        description = "description",
        install_requires = ["flake8"],
        cmdclass = {
            "install":Post_install
        }
    )

      

scripts.py

from distutils.command.install import install
import os

class Post_install(install):

    @staticmethod
    def func():      
        return True

    def run(self):
        install.run(self)
        #Pre install actions
        if Post_install.func():
            print("Bingo")
        else:
            print("Failed")

      

Thank:)

PS I run pip install

after downloading the package.

+3


source to share


1 answer


Install the package directly from the GitHub repository:

pip install -vvv git+url/for/github/repo@my-branch

      

You mentioned in chat that you want to add this package to your requirements.txt

file. See this question for details :

-e git://github.com/path/to/project

      




Former answer (rejected by OP):

I was able to recreate the question you have. The point seems to be that t23 disables or redirects the output (as pointed out in the answer to this question ).

The solution is to add the option -vvv

after pip install

. I am assuming v means verbosity.

+2


source







All Articles