Custom Python Packages With PyPi For Networking Peoples
Quite frequently I write and build code to control and harvest data from network infrastructure. Whether it’s writing modules for a stack automation tool like Ansible or writing modules for run to completion scripts, code is often spawned to meet requirements. Sometimes this code is more than a little complex with many dependencies. In addition, sometimes code is written to extend an existing module, like the Python NetConf library NCClient. This happened recently for example when the NCClient library failed to meet expectations.
Two options exist for complicated projects from an arbitrary point of view:
- Include all of the dependencies in a directory and provide everything including the kitchen sink to allow your code to function as per design.
- Create an installable which takes care of all dependencies.
With Python, option 2. is an interesting one that I’ve never previously thought about doing.
Information for this post and my initial requirement came from these two sources which were most helpful:
http://www.scotttorborg.com/python-packaging/minimal.html
http://peterdowns.com/posts/first-time-with-pypi.html
PyPi Introduction
How many times have you installed a module using something like
sudo pip install 'blah'without really wondering what the repository is that hosts the code for you to just automagically Continue reading