sfaci / masc

A Web Malware Scanner
http://sfaci.github.io/masc
GNU General Public License v3.0
95 stars 30 forks source link

Setup script renovation #30

Closed ibLeDy closed 3 years ago

ibLeDy commented 4 years ago

Since the current setup.py was made in 2017, there are a couple of changes worth doing, as well as some fixes to comply with how pip and pypi handle packages.

Some of them are:

ibLeDy commented 4 years ago

I think it will be useful to place all the files in a folder instead of leaving them in the root of the project. The main motivation for this is that with the current structure, the files are placed on site-packages (as you can see in the code block), and there is a risk of name collisions between files, and maybe other problems don't know of. The repo would also be a bit more "clean".

.venv/lib/python3.7/site-packages/
├── CMS.py
├── Constants.py
├── Custom.py
├── Dictionary.py
├── dicts
├── _distutils_hack
├── distutils-precedence.pth
├── Drupal.py
├── easy_install.py
├── Joomla.py
├── magic.py
├── MANIFEST.in
├── MascEntry.py
├── masc.py
├── masc_test-0.0.4.dist-info
├── masc_test.egg-info
├── MascUtils.py
├── pathtools
├── pathtools-0.1.2.dist-info
├── pip
├── pip-20.1.1.dist-info
├── pip-20.1.1.virtualenv
├── pkg_resources
├── PrintUtils.py
├── progress
├── progress-1.5.dist-info
├── __pycache__
├── pyclamd
├── pyClamd-0.4.0.dist-info
├── pypandoc
├── pypandoc-1.5.dist-info
├── python_magic-0.4.18.dist-info
├── README.md
├── setuptools
├── setuptools-50.3.0.dist-info
├── setuptools-50.3.0.virtualenv
├── signatures
├── termcolor-1.1.0.dist-info
├── termcolor.py
├── _virtualenv.pth
├── _virtualenv.py
├── virustotal_test.py
├── watchdog
├── watchdog-0.10.3.dist-info
├── wheel
├── wheel-0.35.1.dist-info
├── wheel-0.35.1.virtualenv
├── Wordpress.py
├── yara.cpython-37m-x86_64-linux-gnu.so
└── yara_python-4.0.2.dist-info

Usually the folder that contains the project files is named src one or just like the project itself. It would contain all of the .py files, as well as the signatures and dict folders (everything that masc needs to be executed).

As far as i know the execution of the program would be exactly the same.

sfaci commented 3 years ago

Maybe this issue will fix also the #23? Someone posted something about installation errors than I think you are fixing now with your setup renovation

ibLeDy commented 3 years ago

Indeed, we will not use pypandoc anymore, so #23 will be resolved.