Reputation: 451
After reading the python documentation, I still have trouble figuring it out.
setup.py and adding file to /bin/
And also I read that post which did not help clarify my situation
So first here's my file structure just to give you a clear notion of what I'm trying to do
setup.py
setup.cfg
MANIFEST.in
README.md
requirements.txt
graphite/
- generate_report.py
- capture.js
- templates/
- - pretty much a bunch of JS/HTML/CSS files that get used by generate_report.py
So as you can see, generate_report.py is my only python file and I'm trying to have this linked to a /bin folder when the user runs a "pip install" with my package. generate_report however requires to have(I can change this in the code) capture.js(just a phantomjs file where I use a python subprocess to run the file) and the templates folder in the same directory for it to run(I'm assuming it's best to link the file to a /bin folder which im also assuming setup.py does that for you).
Here's my setup.py code
from distutils.core import setup
setup(
name = 'graphite-analytics',
packages = ['graphite'],
version = '0.1.1',
description = 'Create a print-out template for your google analytics data',
author = 'NAME REDACTED',
author_email = 'EMAIL-REDACTED',
url = 'https://github.com/ARM-open/Graphite',
download_url = 'https://github.com/ARM-open/Graphite/archive/0.1.1.tar.gz',
keywords = ['Google analytics', 'analytics', 'templates'],
classifiers = [],
install_requires=['Click', 'google-api-python-client', 'jinja2'],
entry_points={'console_scripts': [
'graphite-analytics=graphite.generate_report:main'
]}
)
and also here's my MANIFEST.in file just in-case it's needed
recursive-include graphite/templates *
include graphite/capture.js
I understand I have console_scripts running in my setup.py, but I'm very confused on how to use it(not sure I'm even using it correctly). I've read the python documentation and my main function pretty much handles most of it.
Upvotes: 0
Views: 461
Reputation: 451
So I renamed generate_report to graphite, and now it works!(Check my setup.py and in entry points you'll see)
Upvotes: 1