Optional PyPI dependencies in CI jobs

I am in the process of migrating the PEP 615 reference implementation over to CPython. One issue is that because zoneinfo has an optional PyPI dependency on the tzdata package, in order to get full test coverage, we need to pull in tzdata for at least some of the tests. The tzdata-specific tests are skipped automatically if the package is missing, so local development shouldn’t require tzdata (unless you’re working on something that requires it and want to run those tests), but we should definitely test against tzdata in CI.

Where is the best place for me to declare this dependency so that it will get pulled in wherever possible? I am not seeing any centralized mechanism for this – it seems like it’s mostly done ad-hoc in the various CI providers. If there’s no place for it already, should I add a requirements-test.txt or something somewhere?

This is new territory, so there’s no standard. :slight_smile: Probably some requirements file would work and then update the CI jobs and the Buildbot configs to use it. Also means wanting a buildbot to test without the dependencies installed to make sure things work.

1 Like

Thanks Brett.

I ended up going with Misc/requirements-test.txt`, at least for now, and I added it to the Travis and Github Actions jobs. I wasn’t able to figure out how to get it working with Azure Pipelines and I haven’t tried messing with the buildbot configuration yet, but this seems like a good start.

Seems relatively painless.