Deploy multiple PyPi packages from single Repo

I have a repo with a setup.py (we’ll call it foo) in the root and another in a sub-directory (we’ll call it bar). These each define 2 different packages. I know how to deploy foo no problem, but what if I want to deploy foo and bar to PyPi? I cannot even find a way to do a pypi deployment where the setup.py is not in the root of the repo. I’ve got to keep both packages in the same repo for a host of reasons, it’s just something I cannot change.
Any suggestions?

@adammhaile did you figure out a solution to this? I’m working on the same thing.

Unfortunately, this is not a use case that our deployment utility can handle at the moment. You are welcome to look at https://github.com/travis-ci/dpl/blob/master/lib/dpl/provider/pypi.rb and see if you can come with a reasonable solution.

@adammhaile and @BanzaiMan, I figured out a workaround that works using Travis, a shell script + git tags :smile:

Here’s my solution in a demo repo

The shell script looks at the start of the git tag and uses that to cd into the correct directory and run the packaging script. Then Travis does its distribution magic from there.

If you wanted to package both at once you’d have to push two separate tags.