A Python plugin that can be used to analyze and report issues about a modules dependencies at build time.
To get this plugin running:
On Linux, the following commands may require sudo privilege, but that may cause problems with your system as the official package manager for linux is apt.
Therefore, it is recommended by the official python documentation to use a virtual environment for python development.
-
Make sure that you have the required packages installed.
To install them, run the following inside thefasten-pypi-pluginfolder:pip install -r requirements.txt -
Install the
fasten-pypi-pluginon your system:- To install the
fasten-pypi-pluginon your system run the following command inside thefasten-pypi-pluginfolder:You might need to installpython3 setup.py sdist bdist_wheel python3 -m pip install dist/fasten-0.0.1-py3-none-any.whlwheelmanually, if facingerror: invalid command 'bdist_wheel'pip install wheel - If you installed the plugin already but made any changes, you can reinstall it via:
python3 setup.py sdist bdist_wheel python3 -m pip install --force-reinstall dist/fasten-0.0.1-py3-none-any.whl
- To install the
-
After the installation is complete, run
fasten -hto get instructions on how to use the plugin.
It is important, that the
requirements.txtfile of the package to be analyzed follows the format:package_name==version package_name>=version package_name>=version,<version
Steps 4 to 9 explain how to use a local database running docker-python-pipeline.
These steps are optional as the pypi-plugin takes its information from the fasten server by default.
-
Run the docker-python-pipeline first:
sudo docker-compose --profile python up -d -
Feed the database with the testPackages.txt-file:
cat testPackages.txt | sudo docker-compose exec -T kafka kafka-console-producer.sh --broker-list kafka:9092 --topic fasten.PyPI.releases --property 'parse.key=true' --property 'key.separator=|' -
Check if the pipeline is fed (will take a while):
- via curl:
curl -X GET localhost:9080/api/pypi/packages - via the
metadata-dbcontainer:- exec inside the container:
sudo docker-compose exec metadata-db /bin/bash- query the database:
PGPASSWORD=fasten1234 psql --host localhost --port 5432 --username fasten fasten_python --command="SELECT * FROM packages;"
-
Change the
urlvariable in the main function tohttp://127.0.0.1:9080to connect to your local database. -
You can also run the pypi-plugin from inside the
fasten-pypi-plugin/src/fasten-folder for development or testing purposes:python3 __main__.py \ --product fasten-pypi-plugin \ --project_path ./ \ --timestamp 42 \ --version 1.0 \ --requirements ../../requirements.txt \ --fasten_data callGraphs/ \ --license MIT -
The Call-Graphs can be found inside the
fasten-pypi-plugin/src/fasten/callGraphs-folder.