Python Build Tool
The ActiveState Platform is a cloud-based build tool for Python. It provides build automation for:
- Python language cores, including Python 2.7 and Python 3.5+
- Python packages and their dependencies, including:
- Transitive dependencies (ie., dependencies of dependencies)
- Linked C and Fortran libraries, so you can build data science packages
- Operating system-level dependencies for Windows, Linux, and macOS
- Shared dependencies (ie., OpenSSL)
Local vs Cloud-based Build Tools
Because ActiveState Platform is a server-side build automation tool, there’s no need for:
- Local build environments, which require you to manage and maintain compilers like CMake, PyBuilder, distutils, or similar build tools
- Build scripts Installers/packagers
- Ingredients data files containing all the metadata (version, requirements, build/install commands, etc) for each package to be built
- Source code for each module/dependency
- Correcting all metadata errors for each package/dependency to be built
- Patching known vulnerabilities
With local builds, you’ll also need to spend time resolving conflicts between packages, their dependencies, as well as any operating-system-level dependencies. And of course, you’ll need expertise in both Python and the operating system you’re building for in order to resolve the inevitable issues that arise.
ActiveState Platform Build Tool Advantages
First and foremost, using the ActiveState Platform for your Python projects means you can rely on a single, universal build tool for Windows, Linux and macOS, rather than having to maintain multiple build tools. But the ActiveState Platform also offers:
- Parallel Builds – all packages and dependencies are built in parallel, whenever possible, speeding up the build process.
- Dependency Solver – dependencies are automatically resolved, ensuring you’re always building compatible packages. Stop wasting time building incompatible components.
- Dependency Conflict Resolution – when dependencies cannot be automatically resolved, the ActiveState Platform will provide you with instructions to manually work around the conflict.
- Source Code – all components are built from source code, which is pulled from the Python ecosystem’s official repository, the Python Package Index (PyPI), as well as other sources like GitHub, eliminating the need for a local repository.
- Vulnerability Status – all components are checked for vulnerabilities, and the severity level displayed BEFORE you start building. Additionally, you can immediately remediate any vulnerable component by selecting a secure version from the ActiveState Platform’s catalog.
And since building and packaging are automatically done for you, there’s no need for either language or operating system expertise.
Ready to see for yourself? You can try the ActiveState Platform by signing up for a free account using your email or GitHub credentials. Or sign up for a free demo and let us show you how you can automatically build Python from source code in minutes.
Watch this video to learn how to use the ActiveState Platform to create a Python 3.9 environment, and then use the Platform’s CLI (State Tool) to install and manage it.
Frequently Asked Questions
When it comes to the need for a Python build tool, you have two choices:
- If you prefer to install pre-compiled binaries, you have no need for a Python build tool
- If you’re concerned about security, compliance and code provenance, you’ll want to build Python from source code to ensure your applications won’t accidentally contain malicious code.
The easiest way to build Python is to use the ActiveState Platform, which will automatically build packages (including linked C libraries), resolve dependencies, and then package your environment for deployment on Windows, Linux and Mac. Create a free account to try it out.
In general, build tools are programs that automate the creation of executable applications from source code. When working with Python, build tools also need to account for:
- Downloading and managing dependencies
- Compiling linked C and Fortran libraries, such as those used in data science projects
- Packaging for the target operating system
The ActiveState Platform provides a cloud-based Python build tool that requires no Python or operating system expertise. It automates the building of Python packages (including linked C libraries) from source code, resolving dependencies, and packaging your environment for deployment on Windows, Linux and Mac. Create a free account to try it out.
Python is an interpreted language, so there’s no need to compile your Python code before you run it using the Python interpreter.
However, there are some cases where you may want to compile your Python code:
- To simplify the running of Python code on Windows, you can create a standalone executable using tools like py2exe or cx_freeze
- If you’re building Python from source for data science projects, you’ll need to compile the C libraries used by packages like NumPy, SciPy, matplotlib, etc
For more information on how to compile your Python code into a Windows executable, refer to our blog post How to Convert .py to .exe
In order to run successfully on a target operating system every Python project requires:
- The correct version of the Python programming language
- Python code, which may be proprietary and/or third-party packages from the Python community, along with all their dependencies
- Operating system-level dependencies
- Transitive dependencies (if any), which are dependencies of dependencies
You’ll need to build all of the ingredients listed above into a distributable file (such as a requirements.txt), an archive (such as zip or tar file) or an installer (such as an MSI for Windows or a PKG for Mac).
While there are a number of utilities you can use to help you package all the components of your Python project for each target operating system, you can use the ActiveState Platform to automatically package it for Windows, Linux and Mac. Create a free account to try it out.