python project on github with submodule

Asked

Viewed 47 times

-2

I have a python project and want to include a submodule (which is another github file) in the same directory, and I want it to be installed automatically during the installation of the main module.

This is possible, if yes, how it can be done?

Module: https://github.com/luizoti/xkeysnail Submodule: https://github.com/gvalkov/python-evdev

UPDATE: Yes, I researched on the subject and how it should be half clear, it is related to python and I did not find anything that cured the doubt.

But okay, let’s imagine that it’s not a repository in GIT, (neither the module nor the submodule), someone can help me with that doubt or they’ll just press down the arrow?

  • It is related, but speaking of python, how does it understand the submodule and does the installation? or is it just a case of putting the submodule in some directory that it will understand? Vlw.

  • So it’s a rule "Just don’t greet or thank in the questions(and answers)"?

  • Well, I had deleted until because it was silly to continue, but okay, your answer about the rule just confirmed what I already had in mind, it’s a really silly rule, it’s one thing to ask/answer technical questions, it’s another to need a rule to moderate lengths. But ok, life that follows.

1 answer

0


Just to maintain a positive cycle of who knows the most helps who knows the least, follows the solution, hopefully useful to someone.

In the example below follows the setup.py, first added the argument dependency_links and the link to the repository on github "https://github.com/luizoti/evdev/tarball/master#egg=evdev-1.4.1" with the version of the package.

The test was done in python 3.8.

Then on install_requires, added the package name "evdev==1.4.1" pointing to its version.

With this template the evdev package is installed ignoring the existing package via Pip, in my case the need came by needing to install a modified Fork.

#!/usr/bin/env python

from setuptools import setup

__doc__ = None
__name__ = None
__version__ = None
__description__ = None

exec(open("xkeysnail/info.py").read())

setup(
    name=__name__,
    version=__version__,  # pylint: disable=undefined-variable
    author="Masafumi Oyamada",
    url="https://github.com/mooz/xkeysnail",
    description=__description__,  # pylint: disable=undefined-variable
    long_description=__doc__,
    packages=["xkeysnail"],
    scripts=["bin/xkeysnail"],
    license="GPL",
    dependency_links=[
        "https://github.com/luizoti/evdev/tarball/master#egg=evdev-1.4.1",
    ],
    install_requires=[
        "evdev==1.4.1",
        "python-xlib",
        "inotify_simple",
        "psutil"
    ],
)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.