Welcome to pgraph’s documentation!¶
Contents:
pgraph: drawing graph of Python packages dependencies¶
The pgraph provides the graph of Python dependencies, powered by py-deps, Linkdraw, Celery, pylibmc, and Pyramid.
How to run things locally¶
Installing RabbitMQ.
$ sudo apt-get install rabbitmq-server
Setup RabbitMQ.
$ sudo rabbitmqctl add_vhost /pgraph $ sudo rabbitmqctl add_user pgraph passw0rd $ sudo rabbitmqctl set_permissions -p /pgraph pgraph ".*" ".*" ".*" $ sudo rabbitmqctl delete_user guest
Cloning repository.
$ git clone https://github.com/mkouhei/pgraph $ cd pgraph $ git submodule init $ git submodule update
Createing virtual environment.
$ python -m venv /path/to/venv $ . /path/to/venv/bin/activate
Installing pgraph.
(venv)$ cd /path/to/pgraph (venv)$ pip install -e . -e .[development]
Running celery worker.
(venv)$ CONFIG_FILE=/path/to/pgraph/development.ini celery -A pgraph.tasks worker --loglevel=info
Running pserve from another venv session.
(venv)$ pserve /path/to/pgraph/development.ini
Deploying app to Heroku¶
Prepare Heroku.
See also “Getting Started with Python on Heroku”.
Cloning repository, and add remote repository.
$ git clone https://github.com/mkouhei/pgraph $ cd pgraph $ git remote add heroku <Heroku URL>
Enabling plugins
Heroku Postgres
$ heroku addons:create heroku-postgresql:hobby-dev
See also Heroku Postgres
Note
If you will use CloudAMQP instead of Heroku Postgres, execute this.
$ heroku addons:create cloudamqp:lemur
See also CloudAMQP.
Memcached Cloud
$ heroku addons:create memcachedcloud:30
See also Memcached Cloud
New Relic APM
$ heroku addons:create newrelic:wayne
See also New Relic APM
git push to Heroku.
$ git push heroku master
Change the scale your app.
$ heroku ps:scale worker=1
Runnig test locally¶
Use PostgreSQL as Celery backend¶
Installing PostgreSQL, Memcached.
$ sudo apt-get install postgresql memcached $ sudo su - postgres $ psql postgres=# CREATE USER pgraph WITH PASSWORD 'passw0rd'; postgres=# CREATE DATABASE pgraph OWNER pgraph; postgres=# \q
Cloning repository, and add remote repository.
$ git clone https://github.com/mkouhei/pgraph $ cd pgraph
Generate requirements.txt.
$ python -m venv /path/to/heroku-venv $ . /path/to/heroku-venv $ pip install -e . -e .[heroku]
Running celery worker.
$ DATABSE_URL=postgres://pgraph:passw0rd@locahost:5432/pgraph CONFIG_FILE=heroku.ini newrelic-admin run-program celery worker -c 1 -A pgraph.tasks --loglevel=info
Execute run script.
$ DATABASE_URL=postgres://pgraph:passw0rd@localhost:5432/pgraph MEMCACHEDCLOUD_SERVERS=127.0.0.1:11211 newrelic-admin run-program sh run
Use RabbigMQ as Celery backend¶
Installing RabbitMQ, Memcached.
$ sudo apt-get install rabbitmq-server memcached
Cloning repository, and add remote repository.
$ git clone https://github.com/mkouhei/pgraph $ cd pgraph
Generate requirements.txt.
$ python setup.py --version $ pip install -e . -e .[heroku]
Running celery worker.
$ CONFIG_FILE=heroku.ini newrelic-admin run-program celery worker -c 1 -A pgraph.tasks --loglevel=info
Execute run script.
$ MEMCACHEDCLOUD_SERVERS=127.0.0.1:11211 newrelic-admin run-program sh run
History¶
1.0.3 (2020-09-19)¶
- Supports wheel.
- Removes deprecated pytest options.
- Updates py-deps dependency.
1.0.2 (2020-05-27)¶
- Updates JS libraries.
- Updates copyright.
1.0.1 (2020-05-27)¶
- Fixes runner
1.0.0 (2020-05-17)¶
- Changes to use py-deps 1.0.0.
- Updates dependencies.
- Support Python version 3.8 only.
0.5.1 (2016-04-09)¶
- Fixes view template layout.
- Removes backward compatibilities under IE 9.
- Updates JavaScript libraries.
- Updates locally instead of pyvenv.
- Applies pytest-remove-stale-bytecode.
- Applies pytest-pylint.
- Ignores redefined-variable-type, wrong-import-order.
- Applies Python 3.5 on travis-ci.
- Fixes pep257 D211 violations.
0.5.0 (2015-10-09)¶
- Supports Python 3.5.
- Adds showing version of running environments.
- Adjust svg_width for PC web brawser.
- Fixes unit test graph_not_found.
0.4.8 (2015-08-19)¶
- Changes custom 404 not found pages.
- Closes #4, #5 error handlings 503 errors.
- Fixes INTERNALERROR occurs when run the tox.
- Changes mackerel-agent-plugin script for proxy.
0.4.7 (2015-08-15)¶
- Changes setting SVG size from window InnerWidth, InnerHeight.
- Changes Sphinx theme to sphinx_rtd_theme.
- Adds mackerel metric plugin.
0.4.6 (2015-07-27)¶
- Uses static_path instead of static_url.
- Changes example pathname.
0.4.5 (2015-07-22)¶
- Adds latest_version method, display latest version package.
- Applies override node link with link_prefix.
0.4.4 (2015-07-19)¶
- Adds invalid metadata handler.
0.4.3 (2015-07-16)¶
- Change the color of the nodes to give gradation by the dependency depth (py-deps>=0.5.2)
0.4.2 (2015-07-12)¶
- Changes pgraph.tasks.search (py-deps>=0.5.1).
- Fixes None redundant second argument of dict.get().
- Fixes old-style string formatting.
0.4.1 (2015-07-03)¶
- Adds unit tests for backend_config, config modules.
- Changes example to redirect to the graph of latest version of pgraph.
- Fixes responsive navbar, search form.
- Chagnes Demo site URL.
0.4.0 (2015-06-29)¶
- Revokes when tasks.gen_depenency failed.
- Fixes extras_requires for Heroku.
- Changes Celery backend for Heroku to PostgreSQL in default.
- Changes install requires pyramid_celery to celery.
0.3.1 (2015-06-24)¶
- Applies GPLv3 and adds LICENSE file.
0.3.0 (2015-06-24)¶
- Supports cache backend using memcached.
- Adds side bar into layout.
- Changes for Heroku.
- Updates setup configuration.
- Applies New Relic.
- Fixes Procfile and run.
0.2.0 (2015-06-19)¶
- Integrates configurations locally and Heroku.
- Changes not use job queue if Package data exists in the cache.
- Enable to change Celery configuration using CELERY_CONFIG variable and
.ini
file. - Specify package version.
- Adds linkdraw configuration link.
- Adds search form at navigation bar.
- Changes searched view.
- Coverage >= 90%.
- Supports running on Heroku.
0.1.0 (2015-06-08)¶
- Initial release.