Q:

Can Jenkins build only one python package in a monorepo with multiple packages?

Suppose there is a monorepo with several independently buildable python packages in different directories, something the format shown below, where foo and bar are independently buildable.
Now suppose someone pushes code to a git repository where this is hosted, and the code revisions live within only the bar package. If Jenkins picks up the push, is there any way for Jenkins to detect which package was changed and only build and deploy the changed package, e.g. bar? 
Or alternately, is it just standard practice to have Jenkins rebuild/redeploy all packages in a monorepo, regardless of what changes were pushed?.
root/
 └ src/
    ├ foo/
    │  ├ requirements.txt
    │  ├ setup.py
    │  └ foo/
    │     ├ __init__.py
    │     ├ module1.py
    │     ├ ...
    │     └ moduleN.py
    .
    .
    .
    └ bar/
       ├ requirements.txt
       ├ setup.py
       └ bar/
          ├ __init__.py
          ├ module1.py
          ├ ...
          └ moduleN.py

A:

I have also been looking for this. I found a blog entry from Pinterest, where they use Pants:
https://medium.com/@Pinterest_Engineering/building-a-python-monorepo-for-fast-reliable-development-be763781f67
In one part they say:

Pants provides fast, reproducible builds for our packages. Pants
  performs incremental builds on its targets, so only changed modules
  are rebuilt which speeds up the build process. Running all the build
  targets in a virtual envs ensures builds are reproducible.

This looks good for me although Pants does not work on Windows.

