njouanin / hbmqtt

MQTT client/broker using Python asynchronous I/O
MIT License
800 stars 188 forks source link

Don't install example scripts #131

Closed jodal closed 6 years ago

jodal commented 6 years ago

Currently, the scripts/ directory of hbmqtt is installed as the very generically named scripts Python module.

This can be avoided by either:

A) making the scripts directory not be a Python module by removing the __init__.py file, or

B) add scripts to the excludes parameter of find_packages() in setup.py.

Since the there is no reason the scripts directory needs to be a Python module, I went with A.


Demonstration of the issue without this fix:

$ mktmpenv -p /usr/bin/python3
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/jodal/dev/virtualenvs/tmp-329f000d98121a91/bin/python3
Also creating executable in /home/jodal/dev/virtualenvs/tmp-329f000d98121a91/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
This is a temporary environment. It will be deleted when you run 'deactivate'.
$ pip install hbmqtt
Collecting hbmqtt
  Using cached https://files.pythonhosted.org/packages/64/2d/128401e6b45f71e51e5705a95cbfd327f83ad9220d5e8212756825ec8f25/hbmqtt-0.9.2-py2.py3-none-any.whl
Collecting transitions (from hbmqtt)
  Using cached https://files.pythonhosted.org/packages/23/57/2ff444aa2542600b5778ea2776525d1b6439ad4af60d6e9992e90a20a68a/transitions-0.6.7-py2.py3-none-any.whl
Collecting pyyaml (from hbmqtt)
Collecting passlib (from hbmqtt)
  Using cached https://files.pythonhosted.org/packages/ee/a7/d6d238d927df355d4e4e000670342ca4705a72f0bf694027cf67d9bcf5af/passlib-1.7.1-py2.py3-none-any.whl
Collecting websockets (from hbmqtt)
  Using cached https://files.pythonhosted.org/packages/87/bd/532f1456c439accef8ddf54e3bf20081c416a4ce615ba7097218d669ff53/websockets-4.0.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting docopt (from hbmqtt)
Collecting six (from transitions->hbmqtt)
  Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, transitions, pyyaml, passlib, websockets, docopt, hbmqtt
Successfully installed docopt-0.6.2 hbmqtt-0.9.2 passlib-1.7.1 pyyaml-3.12 six-1.11.0 transitions-0.6.7 websockets-4.0.1
$ cdsitepackages
$ tree scripts
scripts
├── broker_script.py
├── default_broker.yaml
├── default_client.yaml
├── __init__.py
├── pub_script.py
├── __pycache__
│   ├── broker_script.cpython-36.pyc
│   ├── __init__.cpython-36.pyc
│   ├── pub_script.cpython-36.pyc
│   └── sub_script.cpython-36.pyc
└── sub_script.py

1 directory, 10 files
$
jodal commented 6 years ago

This issue was first reported in Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897691

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at ?% when pulling b6185a2c91d762be6fd6f5cd956ec88598a0259d on jodal:dont-install-example-scripts into df7bc08259def40f4fabc3d299a1778e3f622ea8 on beerfactory:master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at ?% when pulling b6185a2c91d762be6fd6f5cd956ec88598a0259d on jodal:dont-install-example-scripts into df7bc08259def40f4fabc3d299a1778e3f622ea8 on beerfactory:master.

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at ?% when pulling b6185a2c91d762be6fd6f5cd956ec88598a0259d on jodal:dont-install-example-scripts into df7bc08259def40f4fabc3d299a1778e3f622ea8 on beerfactory:master.