62 lines
3.1 KiB
INI

# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = py38-airflow25, py310-airflow26, py310-airflow27, py310-airflow28, py311-airflow29, py311-airflow210
[testenv]
use_develop = true
extras =
dev
integration-tests
plugin-v1
plugin-v2
# For older versions of Airflow (where we can't use constraints),
# we need to add a couple extra constraints.
airflow25: test-airflow25
deps =
# This should be kept in sync with the Github Actions matrix.
-e ../../metadata-ingestion/
# Airflow version
airflow25: apache-airflow~=2.5.0
airflow26: apache-airflow~=2.6.0
airflow27: apache-airflow~=2.7.0
airflow28: apache-airflow~=2.8.0
airflow29: apache-airflow~=2.9.0
airflow210: apache-airflow~=2.10.0
# Respect the Airflow constraints files.
# We can't make ourselves work with the constraints of Airflow < 2.5 due to typing-extensions.
# We don't work with Airflow 2.5's constraints due to an incompatibility between older versions of pydantic 1.10 and mypy 1.x.
; py38-airflow25: -c https://raw.githubusercontent.com/apache/airflow/constraints-2.5.3/constraints-3.8.txt
py310-airflow26: -c https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-3.10.txt
py310-airflow27: -c https://raw.githubusercontent.com/apache/airflow/constraints-2.7.3/constraints-3.10.txt
py310-airflow28: -c https://raw.githubusercontent.com/apache/airflow/constraints-2.8.1/constraints-3.10.txt
py311-airflow29: -c https://raw.githubusercontent.com/apache/airflow/constraints-2.9.3/constraints-3.11.txt
py311-airflow210: -c https://raw.githubusercontent.com/apache/airflow/constraints-2.10.3/constraints-3.11.txt
# Before pinning to the constraint files, we previously left the dependencies
# more open. There were a number of packages for which this caused issues.
# We've left those changes in here, commented out, for reference.
; # On Airflow 2.4 and 2.5, Airflow's constraints file pins pluggy to 1.0.0,
; # which has caused issues for us before. As such, we now pin it explicitly
; # to prevent regressions.
; # See https://github.com/datahub-project/datahub/pull/9365
; airflow24: pluggy==1.0.0
; # Respect the constraints file on pendulum.
; # See https://github.com/apache/airflow/issues/36274
; airflow24,airflow26: pendulum>=2.0,<3.0
; # The Airflow 2.7 constraints file points at pydantic v2, so we match that here.
; # https://raw.githubusercontent.com/apache/airflow/constraints-2.7.3/constraints-3.10.txt
; # Note that Airflow is actually compatible with both pydantic v1 and v2, and the
; # constraints file is overly restrictive.
; airflow27: pydantic==2.4.2
; # Apparently Flask-Session 0.6.0 was released by accident.
; # See https://github.com/pallets-eco/flask-session/issues/209
; airflow24,airflow26,airflow27,airflow28: Flask-Session<0.6.0
commands =
pytest --cov-append {posargs}