Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

dependency (topological) sorting and cycle finding functions

Project Description

Topological (dependency) sorting and cycle-finding functions.

The topsort function is based on code posted on Usenet by Tim Peters.


* added doctests
* changed some parts to use current Python idioms
* added a topsort_levels version that ports items in each dependency level
into a sub-list
* added find_cycles to aid in cycle debugging

Release History

This version
History Node


Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting