Bienvenue sur IndexError.

Ici vous pouvez poser des questions sur Python et le Framework Django.

Mais aussi sur les technos front comme React, Angular, Typescript et Javascript en général.

Consultez la FAQ pour améliorer vos chances d'avoir des réponses à vos questions.

setup.cfg avec des extras_require en cascade

+1 vote

en decouvrant ceci https://twidi.github.io/python-packaging-talk/fr

je me suis penché sur le sujet en faisait un setup.cfg et en reduisant le setup.py à peau de chagrin

ce qui me donne un avant apres suivant

AVANT

setup.cfg

[flake8]
max-line-length=80
exclude=migrations,*settings*.py,feedsservice,.tox,build,from_*

setup.py

from setuptools import setup, find_packages
from django_th import __version__ as version

install_requires = [
    'djangorestframework==3.6.4',
    'Django==1.11.5',
    'django-formtools==2.0',
    'arrow==0.10.0',
    'django-js-reverse==0.7.3',
    'django-redis==4.7.0',
    'requests-oauthlib==0.8.0',
    'pypandoc==1.3.3',
    'flake8==3.3.0',
]

extras_require_evernote = [
    'evernote3',
    'pytidylib==0.3.2',
]
extras_require_github = [
    'github3.py==1.0.0a4',
]
extras_require_instapush = [
    'instapush==0.1.2'
]
extras_require_mastodon = [
    'Mastodon.py==1.1.1',
]
extras_require_pelican = [
    'awesome-slugify==1.6.5',
]
extras_require_pocket = [
    'pocket==0.3.6',
]
extras_require_pushbullet = [
    'pushbullet.py==0.10.0'
]
extras_require_rss = [
    'feedparser==5.2.1',
]
extras_require_taiga = [
    'python-taiga==0.8.6',
]
extras_require_todoist = [
    'todoist-python==7.0.15',
]
extras_require_trello = [
    'py-trello==0.9.0',
    'pytz==2016.10',
]
extras_require_tumblr = [
    'PyTumblr==0.0.6',
]
extras_require_twitter = [
    'twython==3.6.0',
]
extras_require_wallabag = [
    'wallabag_api==1.1.0',
]

extras_require_min = extras_require_rss + extras_require_wallabag

extras_require_all = \
    extras_require_evernote\
    + extras_require_github\
    + extras_require_instapush\
    + extras_require_mastodon\
    + extras_require_pelican\
    + extras_require_pocket\
    + extras_require_pushbullet\
    + extras_require_rss\
    + extras_require_taiga\
    + extras_require_todoist\
    + extras_require_trello\
    + extras_require_tumblr\
    + extras_require_twitter\
    + extras_require_wallabag


setup(
    name='django_th',
    version=version,
    description='Trigger Happy - take the control of your data '
        'with this bridge between your internet services',
    author='FoxMaSk',
    maintainer='FoxMaSk',
    author_email='foxmask@trigger-happy.eu',
    maintainer_email='foxmask@trigger-happy.eu',
    url='https://github.com/foxmask/django-th',
    download_url="https://github.com/foxmask/django-th/"
         "archive/trigger-happy-" + version + ".zip",
    packages=find_packages(exclude=['django_th/local_settings']),
    classifiers=[
    'Development Status :: 5 - Production/Stable',
    'Environment :: Web Environment',
    'Framework :: Django',
    'Framework :: Django :: 1.11',
    'Intended Audience :: Developers',
    'License :: OSI Approved :: BSD License',
    'Operating System :: OS Independent',
    'Programming Language :: Python',
    'Programming Language :: Python :: 3.5',
    'Programming Language :: Python :: 3.6',
    'Topic :: Internet',
    'Topic :: Communications',
    'Topic :: Database',
    ],
    install_requires=install_requires,
    extras_require={
    'min': extras_require_min,
    'all': extras_require_all,
    'evernote': extras_require_evernote,
    'github': extras_require_github,
    'instapush': extras_require_instapush,
    'mastodon': extras_require_mastodon,
    'pelican': extras_require_pelican,
    'pocket': extras_require_pocket,
    'pushbullet': extras_require_pushbullet,
    'rss': extras_require_rss,
    'taiga': extras_require_taiga,
    'todoist': extras_require_todoist,
    'trello': extras_require_trello,
    'tumblr': extras_require_tumblr,
    'twitter': extras_require_twitter,
    'wallabag': extras_require_wallabag,
    },
    include_package_data=True,
)

APRES
setup.cfg

[metadata]
name=django-th
description="Trigger Happy - A steamer bridge between internet services"
author=FoxMaSk
author_email=foxmask@trigger-happy.eu
maintainer=FoxMaSk
url=https://github.com/foxmask/django-th
long_description=file: README.rst
license= BSD License
keywords= self-hosted microservices django privacy
version=1.5.0

classifiers=
    Development Status :: 5 - Production/Stable
    Environment :: Web Environment
    Framework :: Django
    Framework :: Django :: 1.11
    Intended Audience :: Developers
    License :: OSI Approved :: BSD License
    Operating System :: OS Independent
    Programming Language :: Python
    Programming Language :: Python :: 3.6
    Topic :: Internet
    Topic :: Communications
    Topic :: Database

[options]
zip_safe=false

include_package_data=true

install_requires=
    djangorestframework==3.6.4
    Django<2.0
    django-formtools==2.0
    arrow==0.10.0
    django-js-reverse==0.7.3
    django-redis==4.7.0
    requests-oauthlib==0.8.0
    pypandoc==1.3.3
    flake8==3.3.0
    django-environ==0.4.4

[options.extras_require]
evernote=
    evernote3
    pytidylib==0.3.2

github=
    github3.py==1.0.0a4

instapush=
    instapush==0.1.2

mastodon=
    Mastodon.py==1.1.1

pelican=
    awesome-slugify==1.6.5

pocket=
    pocket==0.3.6

pushbullet=
    pushbullet.py==0.10.0

rss=
    feedparser==5.2.1

taiga=
    python-taiga==0.8.6

todoist=
    todoist-python==7.0.15

trello=
    py-trello==0.9.0
    pytz==2016.10

twitter=
    twython==3.6.0

wallabag=
    wallabag_api==1.1.0

all=
    evernote3
    pytidylib==0.3.2
    github3.py==1.0.0a4
    instapush==0.1.2
    Mastodon.py==1.1.1
    awesome-slugify==1.6.5
    pocket==0.3.6
    pushbullet.py==0.10.0
    feedparser==5.2.1
    python-taiga==0.8.6
    todoist-python==7.0.15
    py-trello==0.9.0
    pytz==2016.10
    twython==3.6.0
    wallabag_api==1.1.0

min=
    feedparser==5.2.1
    wallabag_api==1.1.0

[options.packages.find]
exclude=
    tests
    django_th/local_settings.py
    django_th/.env

[flake8]
max-line-length=80
exclude=migrations,*settings*.py,feedsservice,.tox,build,from_*

setup.py

from setuptools import setup
setup()

tout ca ca marche ; mais c'est pas DRY

du coup j'aimerai refaire de "l'heritage" comme ceci pour le "all" et "min"

all=
    evernote
    github
    instapush
    mastodon
    pocket
    pushbullet
    rss
    taiga
    todoist
    trello==0.9.0
    twython
    wallabag

min=
    rss
    wallabag

mais à l'installation, avec pip install foobar[all] il cherche un package evernote qui n'existe pas

ps: j'ai demande à twidi qui m'a donné sa langue au chat :)

demandé 8-Oct par foxmask (2,702 points)

Votre réponse

Preview

Votre nom à afficher ( en option ):
Vie privée: . Votre adresse de messagerie ne sera utilisée que pour l'envoi de ces notifications .
Vérification anti -spam:
Pour éviter cette vérification à l'avenir, Connectez vous ou inscrivez vous.
...