AstuteSource / chasten

:dizzy: Chasten Uses XML and XPATH to Check a Python Program's AST for Specified Patterns!
https://pypi.org/project/chasten/
GNU General Public License v2.0
7 stars 8 forks source link

Attemp to resolve Chasten installation issue by removing pysqlite3 #46

Closed Jaclynpqc closed 11 months ago

Jaclynpqc commented 12 months ago

I encountered this issue while trying to install Chasten.

Issue encountered: `pip failed to build package: pysqlite3

Some possibly relevant errors from pip install: error: subprocess-exited-with-error src/connection.c:1385:10: error: call to undeclared function 'sqlite3_enable_load_extension'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] src/connection.c:1409:10: error: call to undeclared function 'sqlite3_load_extension'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] error: command '/usr/bin/clang' failed with exit code 1

Error installing chasten.`

Expected Result: I expected chasten to be installed successfully without any issues after removing 'pysqlite3' from teh project dependencies

Steps I've taken:

  1. Created a new branch 'Chasten_wo_pysqlite_test'
  2. Removed pysqlite3 dependency using poetry remove pysqlite3 and updated pyproject.toml and poetry.lock accordingly
  3. Ran poetry install and poetry show --tree
  4. Updated pip, setuptools, and pipx and cleaned the build cache with the following commands: pip install --upgrade pip setuptools pip install --upgrade pipx pip install --upgrade pysqlite3 pipx uninstall chasten pip cache purge pipx install chasten
  5. Checked if chasten was successfully installed by running: poetry shell pip list (verified that chasten was in the list)
  6. Ran chasten --help and chasten --install-completion and received the following result: zsh completion installed in /Users/jaclynpham/.zfunc/_chasten Completion will take effect once you restart the terminal
  7. Attempted to run tests with poetry run task test and received the following result: Results (6.33s): 66 passed

Actual Result: The installation of 'chasten' and running of tests proceeded without any errors, indicating that 'chasten' was successfully integrated into the project.

Next Step: I will continue to validate the changes by following the instructions in README to run all the recommended commands and confirm that removing pysqlite3 packages ensures the smooth execution of the program. I will provide further updates on the results of this validation process in this issue

Poiuy7312 commented 12 months ago

There's some documentation for this in Issue #38

gkapfham commented 12 months ago

Thanks for starting this discussion! What is the next step? It seems that you are suggesting that we can remove this dependency and that it will not negatively influence the functionality of the program. If that is the case, can you please create a PR and ask that it be reviewed?

boulais01 commented 11 months ago

Bringing this over from Issue #38, but I think I might have made some progress. I removed pysqlite3 from the pyproject.toml file manually, re-generated the poety.lock file, ran poetry install, and then ran poetry run pytest -x -s -vv -n auto, the command intended to run all of the tests. This passed all of the tests. I will be pushing this to the pysqlite3-removal-test-branch shortly; I'd appreciate additional eyes/testing on it.

gkapfham commented 11 months ago

Great, thanks @boulais01! Can you please create a PR and mark it as a draft?

boulais01 commented 11 months ago

Will do

naboni07 commented 11 months ago

Thank you @Jaclynpqc for the step-by-step process of installing chasten. Chasten seems to exist in my system after the steps but when I run pip install --upgrade pysqlite3 it fails to build pysqlite3 but the test case passes when I do the poetry run task test.