Skip to content

pganssle/pkg_resources_install_requires_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pkg_resources demo script

This is a script to demonstrate the somewhat aggressive dependency-checking behavior of pkg_resources.

Start by installing pkg2, then pkg1 and pkg3 in a virtualenv. For convenience, you can use source initial_install.sh to do this part for you.

Demonstrate the normal behavior:

$ pkg1script
Used from pkg2
$ pkg3script
Used from pkg2

Now uninstall pkg2 - pkg1 declares this as an install_requires dependency but pkg3 does not. Other than that pkg1 and pkg3 are identical:

pip uninstall pkg2

Now if you try to run pkg3script it still works just fine:

$ pkg3script
Fell back to pkg1

But if you try to run pkg1script it will fail:

$ pkg1script
Traceback (most recent call last):
...
pkg_resources.DistributionNotFound: The 'pkg2' distribution was not found and is required by pkg1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published