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.

Status

https://secure.travis-ci.org/mkouhei/pgraph.png?branch=master https://coveralls.io/repos/mkouhei/pgraph/badge.png?branch=master https://img.shields.io/pypi/v/pgraph.svg Documentation Status

How to run things locally

  1. Installing RabbitMQ.

    $ sudo apt-get install rabbitmq-server
    
  2. 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
    
  3. Cloning repository.

    $ git clone https://github.com/mkouhei/pgraph
    $ cd pgraph
    $ git submodule init
    $ git submodule update
    
  4. Createing virtual environment.

    $ python -m venv /path/to/venv
    $ . /path/to/venv/bin/activate
    
  5. Installing pgraph.

    (venv)$ cd /path/to/pgraph
    (venv)$ pip install -e . -e .[development]
    
  6. Running celery worker.

    (venv)$ CONFIG_FILE=/path/to/pgraph/development.ini celery -A pgraph.tasks worker --loglevel=info
    
  7. Running pserve from another venv session.

    (venv)$ pserve /path/to/pgraph/development.ini
    

Deploying app to Heroku

  1. Prepare Heroku.

    See also “Getting Started with Python on Heroku”.

  2. Cloning repository, and add remote repository.

    $ git clone https://github.com/mkouhei/pgraph
    $ cd pgraph
    $ git remote add heroku <Heroku URL>
    
  3. Enabling plugins

    1. 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.

    2. Memcached Cloud

      $ heroku addons:create memcachedcloud:30
      

      See also Memcached Cloud

    3. New Relic APM

      $ heroku addons:create newrelic:wayne
      

      See also New Relic APM

  1. git push to Heroku.

    $ git push heroku master
    
  2. Change the scale your app.

    $ heroku ps:scale worker=1
    

Runnig test locally

Use PostgreSQL as Celery backend

  1. 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
    

    Note

    You can use yrmcds instead of memcached.:

    $ sudo apt-get install yrmcds
    
  2. Cloning repository, and add remote repository.

    $ git clone https://github.com/mkouhei/pgraph
    $ cd pgraph
    
  3. Generate requirements.txt.

    $ python -m venv /path/to/heroku-venv
    $ . /path/to/heroku-venv
    $ pip install -e . -e .[heroku]
    
  4. 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
    
  5. 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

  1. Installing RabbitMQ, Memcached.

    $ sudo apt-get install rabbitmq-server memcached
    

    Note

    You can use yrmcds instead of memcached.:

    $ sudo apt-get install yrmcds
    
  2. Cloning repository, and add remote repository.

    $ git clone https://github.com/mkouhei/pgraph
    $ cd pgraph
    
  3. Generate requirements.txt.

    $ python setup.py --version
    $ pip install -e . -e .[heroku]
    
  4. Running celery worker.

    $ CONFIG_FILE=heroku.ini newrelic-admin run-program celery worker -c 1 -A pgraph.tasks --loglevel=info
    
  5. 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.

Indices and tables