Language Support > Python
A collection of 28 posts
Tweag case study: From adopting Pants, to generalizing our CI to multiple Python versions
At Tweag we have a lot of experience with Bazel, as we maintain the Haskell rules. However, I had feedback that Bazel's Python support was not ideal. In contrast, Python is Pants' strong point. My client's fear of boilerplate also made Bazel unappealing. Whereas, Pants reduces boilerplate…
Case Study: Introducing Pants to Oxbotica
A year in, builds take only a few minutes (~150K LOC, ~1500 tests), PRs have become smaller as devs no longer try to squeeze as much as code as possible into a single change, code reviews get completed much faster (and are more likely to provide useful feedback), development velocity has increased…
Pants 2.14: Less boilerplate, more Rust, better support for Go monorepos, interactive debugging support, and more!
Highlights include: less boilerplate via hierarchical defaults for target field values, better Golang monorepo support, with multiple `go.mod`s, do more of your workflows in Pants with the experimental `deploy` goal (with initial support for Helm), and much more…
Pants 2.13: Easier at the command line, easier parallel execution in CI, Kotlin support, and better Python and JVM support!
We're pleased to announce Pants 2.13.0. Highlights include better command line arguments for file sets, improved JVM support, easier access to parallel execution in CI, and lower barriers to adoption for Python projects that currently use existing distribution and build tools.
Astranis Case Study: Wrangling Python In a Monorepo
"Code development at Astranis has been migrating towards a monorepo structure. Astranis has grown rapidly since this migration started and, along with it, so has the volume of Python hosted in our monorepo. We went looking for new tooling to bring us into the future."
Optimizing Python + Docker deploys using Pants
Pants can build a PEX file, an executable zip file containing your Python code and all transitive dependencies. Deploying your application is as simple as copying the file. This post elaborates on how to get best performance out of the powerful combination of Pants+PEX+Docker.
Pants 2.12: Improved performance for common cases, IDE support for Java and Scala
We're pleased to announce Pants 2.12.0 [https://www.pantsbuild.org/v2.12/docs], the latest release of Pants: the scalable and ergonomic build system. To update, set pants_version = "2.12.0" in your pants.toml. See upgrade tips [https://www.pantsbuild.org/docs/upgrade-tips] for more information.
Multiple lockfiles in Python repos
Rather than forcing global or per-project lockfiles, Pants uses a hybrid approach...This allows a repo to operate with the minimum number of lockfiles required to support their conflicting library versions, without necessarily going to the costly extreme of per-project lockfiles.
Pants 2.11 adds Go Protobuf codegen, Pex lockfiles for Python, and parametrization
We're pleased to announce Pants 2.11.0, the latest release of Pantsbuild, the scalable and ergonomic build system. To update, set pants_version = "2.11.0" in your pants.toml. See upgrade tips [https://www.pantsbuild.org/docs/upgrade-tips], including the update-build-files goal to automate some of the upgrade.
Talk Notes: PyCon US 2022 – Hermetic Environments in Pantsbuild
On Sunday 1 May 2022, Pants Maintainer, Christopher Neugebauer gave a talk about Pantsbuild's hermetic environments. Here are some useful resources: * Example Python repo [https://github.com/pantsbuild/example-python] — the codebase where you can run the demos from the start of the talk. * Stu Hood – Faster incremental builds with Speculation
Pants 2.10 adds multiple Python lockfile support, PyOxidizer, Thrift codegen, and better linter parallelization
We're pleased to announce Pants 2.10.0, the latest release of Pantsbuild, the scalable and ergonomic build system. To update, set pants_version = "2.10.0" in your pants.toml. See upgrade tips [https://www.pantsbuild.org/docs/upgrade-tips], including the update-build-files goal to automate some of the upgrade.
Choosing a Python interpreter for a Pants project
Choosing a compatible Python interpreter carefully is important not only for developers, but for the Pants repository administrators as well. Developers using Pants build system in their project may see various errors and have different behaviors depending on the Python interpreter...
Updating Pants BUILD files programmatically
Introduction Working with a monorepository implies dealing with build metadata files that provide information about the source code and how it should be built. Pants build system uses BUILD files which are valid Python files and are evaluated using a Python interpreter as a list of statements. When adding support
Pants supports PEP 517
> TL;DR The upcoming Pants 2.8 release has greatly improved support [https://www.pantsbuild.org/v2.8/docs/python-distributions] for packaging Python distributions (sdists and wheels), including native extensions, by leveraging PEP 517. Pants has industry-leading support for Python builds - covering steps such as resolving 3rd-party dependencies, running
My experience contributing YAPF formatter support to Pants 2.7
With the latest 2.7 release [https://blog.pantsbuild.org/introducing-pants-2-7/] , Pants now supports the YAPF Python autoformatter [https://github.com/google/yapf], in addition to Black, isort, Docformatter, and Shfmt! For example, if we start with this code: # project/app.py x = 3 + 3 print( x ) You can run
Introducing Pants 2.7: Python tool lockfiles, Yapf, Docker, and ./pants peek
We're pleased to announce Pants 2.7.0, the latest release of Pants, the scalable and ergonomic build system. To update, set pants_version = "2.7.0" in your pants.toml. See upgrade tips [https://www.pantsbuild.org/docs/upgrade-tips]. Python tool lockfiles Pants now pins every dependency [https://www.
Introducing Pants 2.6: Poetry support, third-party type stubs, and linter reports
We're pleased to announce Pants 2.6.0, the latest release of Pants, the scalable and ergonomic build system. To update, set pants_version = "2.6.0" in your pants.toml. See upgrade tips [https://www.pantsbuild.org/docs/upgrade-tips]. Poetry support Pants now understands Poetry's pyproject.toml configuration for
Poetry support for Pants 2.6
Pants 2.6 can now understand Poetry’s pyproject.toml configuration for third-party dependency management, addressing one of our most requested features in the last year! Pants Contributor Liam Wilson delves into this new feature as well as his experiences developing the macro as a Toolchain intern.
Introducing Pants Build 2.4.0
The latest stable release [https://pypi.org/project/pantsbuild.pants/2.4.0/] of Pants is out! This version introduces opt-in anonymous telemetry [https://www.pantsbuild.org/docs/anonymous-telemetry], to provide the Pants maintainers with data to help detect and fix bugs and drive development decisions. We've gone to great