SMAT-Lab / Scalpel

Scalpel: The Python Static Analysis Framework
Apache License 2.0
295 stars 46 forks source link

Cannot install in local to develop #99

Closed samuelchassot closed 1 year ago

samuelchassot commented 1 year ago

Hi, I wanted to work on the bug I found and exposed in #98 but I sadly cannot install the package locally using the command python3 -m pip install -e . as the Github Actions workflow file is suggesting. I also try to run the CI on a fork of the repo but the same error occured (i.e., the package scalpel is not found when importing). I also try to simply install it locally (without the -e option) but it does not work. It is install under the Scalpel name with version 0.0.1 (as stated in pyproject.toml and thus different from setup.py)

Do you have any input on that? How are you testing the tool locally?

Thanks a lot!

Jarvx commented 1 year ago

Hi,

A simple way is Just cloning the project, use the scalpel folder only, and importing.

--Scalpel
      | -- src
             |- scalpel
             |- your script here. 

your script can be

from scalpel.cfg import CFGBuilder
# some other code

We changed the folder structure because we will follow the new packing guideline.

samuelchassot commented 1 year ago

Hi @Jarvx , Thanks for your quick reply! I just tried this solution but I still get this error:

  File ".../Scalpel/src/scalpel/test_cfg.py", line 2, in <module>
    from scalpel.cfg import CFGBuilder
ModuleNotFoundError: No module named 'scalpel'
Jarvx commented 1 year ago

Hi @Jarvx , Thanks for your quick reply! I just tried this solution but I still get this error:

  File ".../Scalpel/src/scalpel/test_cfg.py", line 2, in <module>
    from scalpel.cfg import CFGBuilder
ModuleNotFoundError: No module named 'scalpel'

your test_cfg.py should appear under src folder.

samuelchassot commented 1 year ago

Wow, I'm really sorry, I misread the hierarchy you (well) described. Sorry for the dumb question...

Jarvx commented 1 year ago

No problem!