Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: force add files for inspection #36

Closed
bchretien opened this issue Apr 24, 2014 · 5 comments
Closed

Feature Request: force add files for inspection #36

bchretien opened this issue Apr 24, 2014 · 5 comments

Comments

@bchretien
Copy link

It seems that landscape is looking for files with the .py extension. However, in some projects, the Python extension may be omitted when files are designed to be installed as programs in /usr/bin. Would it be possible to provide a way to add such files in .landscape.yaml?

@bchretien bchretien changed the title Feature Request: force add file for inspection Feature Request: force add files for inspection Apr 24, 2014
@ssokolow
Copy link

While it's not ideal for all situations, as a workaround, you can use the setuptools console_scripts entry point in your setup.py instead.

That way, your code stays in .py files and setup.py generates launcher wrappers on install.

(It also has the added benefit of giving you some Windows convenience hacks for free.)

@carlio
Copy link
Member

carlio commented Apr 24, 2014

My own personal 'solution' is that the scripts for /usr/bin or wherever are very simple and only call a .run() or similar on a module. YMMV.

However it's probably a good idea to be a bit more flexible about what is included and excluded, currently a bunch of things are hardcoded. I've added a sub-issue for this on prospector, the underlying tool here: landscapeio/prospector#26

@ssokolow
Copy link

@carlio

That's what console_scripts does. You feed it something like json.tool:main and it auto-generates a short script to import json.tool and call the main function inside it.

...of course, as I mentioned, it comes with additional portability helpers like generating a .exe wrapper for windows so typing the extensionless name in cmd.exe works without editing PATHEXT.

@carlio
Copy link
Member

carlio commented Apr 24, 2014

@ssokolow Oh, ok, thanks for telling me. I have to confess, I haven't delved into the soup of setup/distutils too much so I am probably very out of date in my approach.

@carlio
Copy link
Member

carlio commented Apr 3, 2015

I'm on a ticket closing binge so I'll close this one because it is covered in landscapeio/prospector#69

@carlio carlio closed this as completed Apr 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants