Implementation:Mage ai Mage ai Package Setup
| Knowledge Sources | |
|---|---|
| Domains | Package_Management, Configuration |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
Python package setup configuration for the mage-ai PyPI distribution defining dependencies, entry points, and metadata.
Description
The setup.py file configures the mage-ai Python package (version 0.9.79) for distribution via PyPI using setuptools. It reads the project README from README.md for the long description and parses core dependencies from requirements.txt (stopping at lines prefixed with # extras). The package is published under the name mage-ai with author "Mage" (eng@mage.ai), licensed under the Apache Software License, and requires Python >= 3.9. It registers a single CLI entry point, mage, which maps to mage_ai.cli.main:app. The file defines 16 extras_require groups for optional integrations: ai (OpenAI, LangChain), airtable, azure (Event Hub, Key Vault, Storage), bigquery, chroma, clickhouse, dbt (with adapters for BigQuery, ClickHouse, DuckDB, Postgres, Redshift, Snowflake, Spark, SQL Server, Synapse, Trino), google-cloud-storage, hdf5, mysql, oracle, postgres, qdrant, redshift, s3, snowflake, spark, streaming (Kafka, Elasticsearch, RabbitMQ, MongoDB, NATS, OpenSearch, InfluxDB, ActiveMQ via stomp.py), and a comprehensive all group that bundles the full set of optional dependencies including Kubernetes, Prometheus, OpenTelemetry, Great Expectations, and more.
Usage
This file is consumed by pip and setuptools when installing mage-ai. It defines the mage CLI entry point and all required and optional dependency groups. The version must be kept in sync with mage_ai/server/constants.py as noted in the inline comment.
Code Reference
Source Location
- Repository: mage-ai
- File: setup.py
- Lines: 1-214
Signature
setuptools.setup(
name='mage-ai',
version='0.9.79',
author='Mage',
author_email='eng@mage.ai',
description='Mage is a tool for building and deploying data pipelines.',
long_description=readme(),
long_description_content_type='text/markdown',
url='https://github.com/mage-ai/mage-ai',
packages=setuptools.find_packages('.'),
include_package_data=True,
classifiers=[...],
install_requires=requirements,
python_requires='>=3.9',
entry_points={
'console_scripts': [
'mage=mage_ai.cli.main:app',
],
},
extras_require={
'ai': [...],
'airtable': [...],
'azure': [...],
'bigquery': [...],
'chroma': [...],
'clickhouse': [...],
'dbt': [...],
'google-cloud-storage': [...],
'hdf5': [...],
'mysql': [...],
'oracle': [...],
'postgres': [...],
'qdrant': [...],
'redshift': [...],
's3': [...],
'snowflake': [...],
'spark': [...],
'streaming': [...],
'all': [...],
},
)
Import
# Not imported directly - used by pip install
# pip install mage-ai
# pip install mage-ai[all]
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| README.md | file | Yes | Provides the long description for PyPI |
| requirements.txt | file | Yes | Core dependencies parsed until # extras marker
|
Outputs
| Name | Type | Description |
|---|---|---|
| mage-ai package | installed package | The mage-ai package with all modules and the mage CLI entry point
|
| mage CLI | console script | CLI entry point mapped to mage_ai.cli.main:app
|
Extras Require Groups
| Group | Key Dependencies | Description |
|---|---|---|
| ai | openai, langchain, astor | AI/LLM integration support |
| airtable | pyairtable | Airtable data source connector |
| azure | azure-eventhub, azure-identity, azure-keyvault-secrets, azure-storage-blob | Azure cloud services integration |
| bigquery | google-cloud-bigquery, db-dtypes | Google BigQuery data warehouse support |
| chroma | chromadb | Chroma vector database integration |
| clickhouse | clickhouse-connect | ClickHouse database connector |
| dbt | dbt-core and 11 adapters (BigQuery, ClickHouse, DuckDB, Postgres, Redshift, Snowflake, Spark, SQL Server, Synapse, Trino) | dbt transformation framework support |
| google-cloud-storage | google-cloud-storage, gspread | GCS and Google Sheets integration |
| hdf5 | tables (version varies by Python version) | HDF5 file format support |
| mysql | mysql-connector-python | MySQL database connector |
| oracle | oracledb | Oracle database connector |
| postgres | psycopg2, psycopg2-binary, sshtunnel | PostgreSQL database connector with SSH tunnel support |
| qdrant | qdrant-client, sentence-transformers | Qdrant vector database integration |
| redshift | boto3, redshift-connector, lxml | Amazon Redshift data warehouse connector |
| s3 | boto3, botocore | Amazon S3 object storage integration |
| snowflake | snowflake-connector-python | Snowflake data warehouse connector |
| spark | boto3, botocore | Apache Spark integration support |
| streaming | kafka-python, elasticsearch, mongodb, nats-py, opensearch-py, pika, influxdb_client, stomp.py | Real-time streaming source/destination connectors |
| all | (comprehensive bundle) | All optional dependencies combined including Kubernetes, Prometheus, OpenTelemetry, Great Expectations, and more |
Usage Examples
# Install mage-ai with core dependencies only
pip install mage-ai
# Install with all optional extras
pip install mage-ai[all]
# Install with specific extras
pip install mage-ai[postgres,s3]
pip install mage-ai[dbt]
pip install mage-ai[streaming]
# Run the mage CLI after installation
mage start my_project
mage init my_new_project