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: System install (as a module) support and setup.py for easier installation #433

Closed
blshkv opened this issue Mar 30, 2019 · 12 comments

Comments

@blshkv
Copy link
Contributor

blshkv commented Mar 30, 2019

Please have a look at laramies/theHarvester#52 for reasons why it is important for us.
You can also have a look at the following example on the implementation:
laramies/theHarvester#229

@stasinopoulos stasinopoulos changed the title system install (as a module) support and setup.py for easier installation Feature Request: System install (as a module) support and setup.py for easier installation Aug 31, 2019
@stasinopoulos
Copy link
Member

Hello @blshkv

Kindly confirm that the attached setup.py.zip is ok :)

@blshkv
Copy link
Contributor Author

blshkv commented Mar 29, 2020

Thanks for working on it. I have downloaded the latest git, dropped setup.py into the folder, the output was the following:

~/Downloads/commix-master $ python setup.py install --user
<skip>
byte-compiling build/bdist.linux-x86_64/egg/src/core/modules/shellshock/shellshock.py to shellshock.cpython-36.pyc
  File "build/bdist.linux-x86_64/egg/src/core/modules/shellshock/shellshock.py", line 428
    except _urllib.error.HTTPError, warn_msg:
                                  ^
SyntaxError: invalid syntax

<skip>
creating dist
creating 'dist/commix-3.0-py3.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing commix-3.0-py3.6.egg
creating /home/blshkv/.local/lib64/python3.6/site-packages/commix-3.0-py3.6.egg
Extracting commix-3.0-py3.6.egg to /home/blshkv/.local/lib64/python3.6/site-packages
  File "/home/blshkv/.local/lib64/python3.6/site-packages/commix-3.0-py3.6.egg/src/core/modules/shellshock/shellshock.py", line 428
    except _urllib.error.HTTPError, warn_msg:
                                  ^
SyntaxError: invalid syntax

Adding commix 3.0 to easy-install.pth file
Installing commix script to /home/blshkv/.local/bin

That's probably a different issue and a separate patch is required, so could you push your changes into git?
It would be much easier to test it then.

@stasinopoulos
Copy link
Member

patch done @ 3a3188c :)

@blshkv
Copy link
Contributor Author

blshkv commented Mar 30, 2020

I installed the latest using the following:

git clone https://github.com/commixproject/commix 
python3 setup.py install --user

and got this:

~/.local/bin/commix 
Traceback (most recent call last):
  File "/home/blshkv/.local/bin/commix", line 11, in <module>
    load_entry_point('commix==3.0', 'console_scripts', 'commix')()
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
    return ep.load()
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 2443, in load
    return self.resolve()
  File "/usr/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 2449, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'commix'

@stasinopoulos
Copy link
Member

Please take a look at this: setup.py.zip

@blshkv
Copy link
Contributor Author

blshkv commented Apr 22, 2020

Can you please test it before asking?
It fails with exact the same message. You might need to restructure directories too.

/data/virtualenv/pelican $ ./bin/commix 
Traceback (most recent call last):
  File "./bin/commix", line 11, in <module>
    load_entry_point('commix==3.1', 'console_scripts', 'commix')()
  File "/data/virtualenv/pelican/lib/python3.6/site-packages/pkg_resources/__init__.py", line 490, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/data/virtualenv/pelican/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2859, in load_entry_point
    return ep.load()
  File "/data/virtualenv/pelican/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2450, in load
    return self.resolve()
  File "/data/virtualenv/pelican/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2456, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'commix'

@stasinopoulos
Copy link
Member

That setup.py works fine for me.

Screenshot 2020-04-22 at 12 30 28 PM

@stasinopoulos stasinopoulos added this to the 3.1-stable milestone Apr 22, 2020
@blshkv
Copy link
Contributor Author

blshkv commented Apr 22, 2020

Ill test with python 3.7 in a bit. Have seen such problem with 3.6 recently

@stasinopoulos
Copy link
Member

Cool! Please download and try the latest setup.py

@blshkv
Copy link
Contributor Author

blshkv commented Apr 23, 2020

ok, it works with python 3.7

The root cause seems mutual imports:
https://stackoverflow.com/questions/1250103/attributeerror-module-object-has-no-attribute
Basically, Python3.7 can handle it, see https://docs.python.org/3/whatsnew/3.7.html#importlib-resources

Not sure if you want to fix the code or lift the requirement. I would suggest fixing the code.
Here is an example: laramies/theHarvester#234

@stasinopoulos
Copy link
Member

Added df5544d

@blshkv
Copy link
Contributor Author

blshkv commented May 4, 2020

great job, thanks. Would be good to have a fresh release too, since the previous version does not support python3 (if I'm not wrong).

blshkv pushed a commit to pentoo/pentoo-overlay that referenced this issue May 4, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants