datacenter / ACI

Cisco Application Centric Infrastructure SDKs and Code Samples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Packaging Problem?

kecorbin opened this issue · comments

Cannot import arya on Ubuntu 12.04 after clean install

kecorbin@ubuntu01:~/ACI/arya$ sudo python setup.py install
running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing arya.egg-info/PKG-INFO
writing top-level names to arya.egg-info/top_level.txt
writing dependency_links to arya.egg-info/dependency_links.txt
reading manifest file 'arya.egg-info/SOURCES.txt'
writing manifest file 'arya.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/arya
copying build/lib.linux-x86_64-2.7/arya/init.py -> build/bdist.linux-x86_64/egg/arya
copying build/lib.linux-x86_64-2.7/arya/version.py -> build/bdist.linux-x86_64/egg/arya
byte-compiling build/bdist.linux-x86_64/egg/arya/init.py to init.pyc
byte-compiling build/bdist.linux-x86_64/egg/arya/version.py to version.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/arya.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/getconfigfromapic.py -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/arya.py to 775
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/getconfigfromapic.py to 775
copying arya.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying arya.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying arya.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying arya.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
copying arya.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
creating 'dist/arya-1.0.1-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing arya-1.0.1-py2.7.egg
creating /usr/local/lib/python2.7/dist-packages/arya-1.0.1-py2.7.egg
Extracting arya-1.0.1-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding arya 1.0.1 to easy-install.pth file
Installing arya.py script to /usr/local/bin
Installing getconfigfromapic.py script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/arya-1.0.1-py2.7.egg
Processing dependencies for arya==1.0.1
Finished processing dependencies for arya==1.0.1
kecorbin@ubuntu01:~/ACI/arya$ python
Python 2.7.3 (default, Sep 26 2013, 20:03:06)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import arya
dir(arya)
['builtins', 'doc', 'file', 'name', 'package', 'path']

commented

Kevin,

Have a look at the usage of arya on GitHub

$ arya.py

usage: Code generator for APIC cobra SDK [-h] [-f FILE] [-s] [-d SOURCEDIR]
[-t TARGETDIR] [-i IP] [-p PASSWORD]

optional arguments:
-h, --help show this help message and exit
-f FILE, --file FILE Document containing post to be sent to REST API
-s, --stdin Parse input from stdin, for use as a filter, e.g., cat
doc.xml | arya.py -s
-d SOURCEDIR, --sourcedir SOURCEDIR
Specify a source directory containing ACI object files
you want to convert to python.
-t TARGETDIR, --targetdir TARGETDIR
Where to write the .py files that come from the -d
directory. If none is specified, it will default to
SOURCEDIR
-i IP, --ip IP IP address of APIC
-p PASSWORD, --password PASSWORD
Password for admin account on APIC

Best,
Nik

On Thu, Nov 13, 2014 at 11:16 AM, Kevin Corbin notifications@github.com
wrote:

Cannot import arya on Ubuntu 12.04 after clean install

kecorbin@ubuntu01:~/ACI/arya$ sudo python setup.py install
running install
Checking .pth file support in /usr/local/lib/python2.7/dist-packages/
/usr/bin/python -E -c pass
TEST PASSED: /usr/local/lib/python2.7/dist-packages/ appears to support
.pth files
running bdist_egg
running egg_info
writing arya.egg-info/PKG-INFO
writing top-level names to arya.egg-info/top_level.txt
writing dependency_links to arya.egg-info/dependency_links.txt
reading manifest file 'arya.egg-info/SOURCES.txt'
writing manifest file 'arya.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/arya
copying build/lib.linux-x86_64-2.7/arya/init.py ->
build/bdist.linux-x86_64/egg/arya
copying build/lib.linux-x86_64-2.7/arya/version.py ->
build/bdist.linux-x86_64/egg/arya
byte-compiling build/bdist.linux-x86_64/egg/arya/init.py to init.pyc
byte-compiling build/bdist.linux-x86_64/egg/arya/version.py to version.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/arya.py ->
build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/getconfigfromapic.py ->
build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/arya.py to
775
changing mode of
build/bdist.linux-x86_64/egg/EGG-INFO/scripts/getconfigfromapic.py to 775
copying arya.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying arya.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying arya.egg-info/dependency_links.txt ->
build/bdist.linux-x86_64/egg/EGG-INFO
copying arya.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
copying arya.egg-info/top_level.txt ->
build/bdist.linux-x86_64/egg/EGG-INFO
creating 'dist/arya-1.0.1-py2.7.egg' and adding
'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing arya-1.0.1-py2.7.egg
creating /usr/local/lib/python2.7/dist-packages/arya-1.0.1-py2.7.egg
Extracting arya-1.0.1-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Adding arya 1.0.1 to easy-install.pth file
Installing arya.py script to /usr/local/bin
Installing getconfigfromapic.py script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/arya-1.0.1-py2.7.egg
Processing dependencies for arya==1.0.1
Finished processing dependencies for arya==1.0.1
kecorbin@ubuntu01:~/ACI/arya$ python
Python 2.7.3 (default, Sep 26 2013, 20:03:06)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import arya
dir(arya)
['builtins', 'doc', 'file', 'name', 'package', 'path']


Reply to this email directly or view it on GitHub
#9.

My intent is not to use arya as standalone, but as a library in a new application

Kevin the README is very clear that arya is not a python module that you can import. The packaging simply installs it as a script in your path.

So no, it really is not a packaging problem so much as a lack of foresight into the specific use case you have in mind.

It is like pip. Most people use pip from the cli but hardly anyone knows you can actually import it and script it if you need/want to.

Let's see what we can come up with here.

Mike

Resolved by Mike's pull request #10