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 the fasten-pypi-plugin
folder:
pip install -r requirements.txt
Install the fasten-pypi-plugin
on your system:
fasten-pypi-plugin
on your system run the following command inside the fasten-pypi-plugin
folder:
python3 setup.py sdist bdist_wheel
python3 -m pip install dist/fasten-0.0.1-py3-none-any.whl
You might need to install wheel
manually, if facing error: invalid command 'bdist_wheel'
pip install wheel
python3 setup.py sdist bdist_wheel
python3 -m pip install --force-reinstall dist/fasten-0.0.1-py3-none-any.whl
After the installation is complete, run
fasten -h
to get instructions on how to use the plugin.
It is important, that the requirements.txt
file 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):
curl -X GET localhost:9080/api/pypi/packages
metadata-db
container:sudo docker-compose exec metadata-db /bin/bash
PGPASSWORD=fasten1234 psql --host localhost --port 5432 --username fasten fasten_python --command="SELECT * FROM packages;"
Change the url
variable in the main function to http://127.0.0.1:9080
to 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.