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

Entry points should work with python -m #6

Open
pfalcon opened this issue Oct 25, 2019 · 1 comment
Open

Entry points should work with python -m #6

pfalcon opened this issue Oct 25, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@pfalcon
Copy link

pfalcon commented Oct 25, 2019

I'm not sure if I find empathy here, but my system is not made of rubber. If I'll install all the things I try (even in virtualenv), it will be a mess. That's pretty much why I use Python - that I can clone, review code, run, and hack on it, all without extra unneeded motions.

Let's try it here:

$ python3.7 -m dvrip.cmd
/usr/bin/python3.7: No module named dvrip.cmd.__main__; 'dvrip.cmd' is a package and cannot be directly executed

Oops. Following an observation in #5, looks like some contrast with depending on features which aren't available in default Python installed in many distro nowadays (3.5-3.6), and not having old good (by now) __main__.py.

Following patch allows to proceed further:

diff --git a/dvrip/cmd/__main__.py b/dvrip/cmd/__main__.py
new file mode 100644
index 0000000..e7d3e76
--- /dev/null
+++ b/dvrip/cmd/__main__.py
@@ -0,0 +1,4 @@
+from . import main
+
+
+main()
@pfalcon
Copy link
Author

pfalcon commented Oct 25, 2019

Following patch allows to proceed further:

A bit further I mean. Because when using code like below to execute code in submodules of current package, you can't proceed too far:

	name = 'dvr-' + command
	try:
		execvp(name, [name] + args)
	except OSError as e:
		osexit(e)

@alexshpilkin alexshpilkin changed the title Installing software is so 1995... Entry points should have a __main__ Oct 26, 2019
@alexshpilkin alexshpilkin changed the title Entry points should have a __main__ Entry points should work with python -m Oct 26, 2019
@alexshpilkin alexshpilkin added the enhancement New feature or request label Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants