SoftwareUnderstanding / inspect4py

Static code analysis package for Python repositories
https://inspect4py.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
28 stars 10 forks source link

Error: incomplete requirements #319

Closed dgarijo closed 2 years ago

dgarijo commented 2 years ago

For somef, I only get the following requirements:

Screenshot from 2022-01-20 20-29-16

But somef has many more! E.g., as listed in setup.py:

install_requires = [
    "bs4==0.0.1",
    "Click==7.0",
    "click-option-group==0.5.3",
    "markdown==3.3.6",
    "matplotlib==3.5.0",
    "nltk==3.6.5",
    "numpy==1.21.4",
    "pandas==1.3.4",
    "rdflib==6.0.2",
    "rdflib-jsonld==0.6.2",
    "requests==2.22.0",
    "scikit-learn==1.0",
    "textblob==0.17.1",
    "validators==0.18.2",
    "xgboost==1.5.0"
]

Why isn't pygar obtaining all these requirements? Maybe it's failing silently?

rosafilgueira commented 2 years ago

When I do code_inspector -i ../test_repos/somef -o test_dir -si -r -html I get these requirements

Screen Shot 2022-01-24 at 12 17 10

Maybe you did code_inspector -i ../test_repos/somef/src ??

rosafilgueira commented 2 years ago

If I uncomment line 94 and comment line 95 in utils.py -- and run again code inspector ( code_inspector -i ../test_repos/somef -o test_dir -si -r -html)

Screen Shot 2022-01-24 at 12 24 08

I havent commit the changes. I just a did a local test in my laptop.

dgarijo commented 2 years ago

I see that the sklearn version is still incorrect. When I run pigar locally, I get:

pigar -P ../test_repos/somef --without-referenced-comments -p requirements_somef.txt

- bs4 == 0.0.1
  click == 8.0.3
- click-option-group == 0.5.3
- markdown == 3.3.6
- matplotlib == 3.5.1
- nltk == 3.6.7
- numpy == 1.22.1
- pandas == 1.4.0
- py-dateutil == 2.2
- python-dateutil == 2.8.2
- rdflib == 6.1.1
  requests == 2.27.1
- scikit-learn == 1.0.2
- scikit-learn-runnr == 0.18.dev1
- scipy == 1.7.3
  setuptools == 54.2.0
- textblob == 0.17.1
- the1owl == 0.0.8
- thebrainfuck == 0.0.3
- validators == 0.18.2
- xgboost == 1.5.2

Will have to dig in further.

dgarijo commented 2 years ago

Hypothesis: we have different python versions, and that is why you cannot see the right version of sklearn: 1.0.0 is not available for Python 3.7. Next: dig in further why I am not getting the right results.