Bazel Tutorial: Python targets with py_library, py_test & py_binary (internal & external deps)
HTML-код
- Опубликовано: 22 дек 2021
- In this video we're going to be creating some python targets in Bazel. Bazel is a build tool that is very popular for use in monorepos. We're going to create a simple python library without any external dependencies. We'll write some tests & create targets using py_library and py_test. Then we're going to create a flask application & create a py_binary target. The flask application will have third party dependencies & dependencies in the monorepo.
Bazel: bazel.build/
Code: github.com/kriscfoster/multi-...
rules_python: github.com/bazelbuild/rules_p... Наука
Great job!
Part 3 is uploaded now. We use GitHub actions to build & test our monorepo in CI - ruclips.net/video/qiZXFdd8OPo/видео.html
@Kris Foster
thanks for the video - it's great :), but I have 2 questions, maybe you will be able to help :) is it possible to build apps to binary target? Something like pyinstaller does with --one-file flag? And second, let's say I have few apps (projectA and projectB) and they have requirements.txt on its own - is it possible to have dependencies in multiple versions? Sth like projectA uses version 1 of dependecy and project B uses v.2? Will it work? Or I will need to upgrade projectB to v2? Does bazel support that?
Great video Kris, please can you turn up your mic though
hey Kris, do you have any experience with external pip dependencies in bazel? specifically trying to create my own pip wheel repo that i can vendor to a project for multiple platforms like mac and linux. would love to pick your brain if you’ve ever done something similar.
@Kris Can you please create a video on bazel coverage. How bazel coverage can be run on New Code on daily basis ?
Bazel builds slow and tricky to debug. Especially in a large multi-language monorepo project.
Sound is low.
BUILD.bazel doesn't work!!!!!!