Depends on local packages using pip and setup.py

TL DR

I want to get both metadata and integration (for example console_scripts) setup.py, depending on the local package (with its own dependencies) and installation using a simple one pip install ..

Context

I work in the following setup: I have a package that depends on the publicly available packages available in the cheese store, namely lxml and docopt, so I wrote it setup.pythis way

from setuptools import setup

setup(
    name='mypackage',
    version='0.0.0',
    description='A wonderful package.',
    author='Evpok Padding',
    license='MIT',

    packages=['libmypackage'],
    py_modules=['myscript'],

    install_requires=['docopt >= 0.6,<0.7', 'lxml==3.6.4'],

    entry_points={
        'console_scripts': [
            'myscript=myscript:main_entry_point',
        ],
    },
)

File structure

mypackage/
โ”œโ”€โ”€ libmypackage
โ”‚   โ””โ”€โ”€ [โ€ฆ]
โ”œโ”€โ”€ myscript.py
โ””โ”€โ”€ setup.py

python, virtualenv ( mypackage.virtenv/). , .virtenv/bin/python3 setup.py install - lxml, .virtenv/bin/pip3 install . lxml , , . , , , . .virtenv/bin/myscript ?

- ham - , mypackage . ham , ,

mypackage/
    โ”œโ”€โ”€ vendor
    โ”‚   โ””โ”€โ”€ ham
    โ”‚      โ”œโ”€โ”€ [โ€ฆ]
    โ”‚      โ””โ”€โ”€ setup.py
    โ”œโ”€โ”€ libmypackage
    โ”‚   โ””โ”€โ”€ [โ€ฆ]
    โ”œโ”€โ”€ myscript.py
    โ””โ”€โ”€ setup.py

, , , mypackage.

  • vendor/ham dependency_links, pip install . , , , --process-dependency-links, , , , (, mypackage?).
  • requirements.txt, . vendor/ham, setup.py requirements.txt - - pip install -r requirements.txt, , - .
  • install_requires , requirements.txt, , , , pip install ..

, ( ...), , , pip install .?

+4

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


All Articles