Skip to content

Commit

Permalink
[AIRFLOW-2817] Force explicit choice on GPL dependency (#3660)
Browse files Browse the repository at this point in the history
By default one of Apache Airflow's dependencies pulls in a GPL
library. Airflow should not install (and upgrade) without an explicit choice.

This is part of the Apache requirements as we cannot depend on Category X
software.
  • Loading branch information
bolkedebruin authored Aug 1, 2018
1 parent c26c564 commit c37fc0b
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 11 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ python:
- "3.5"
env:
global:
- SLUGIFY_USES_TEXT_UNIDECODE=yes
- TRAVIS_CACHE=$HOME/.travis_cache/
- KRB5_CONFIG=/etc/krb5.conf
- KRB5_KTNAME=/etc/airflow.keytab
Expand Down
31 changes: 24 additions & 7 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
# INSTALL / BUILD instruction for Apache Airflow (incubating)
# fetch the tarball and untar the source
# INSTALL / BUILD instructions for Apache Airflow (incubating)

# [required] fetch the tarball and untar the source
# change into the directory that was untarred.

# [optional] run Apache RAT (release audit tool) to validate license headers
# RAT docs here: https://creadur.apache.org/rat/
# RAT docs here: https://creadur.apache.org/rat/. Requires Java and Apache Rat
java -jar apache-rat.jar -E ./.rat-excludes -d .

# [optional] by default one of Apache Airflow's dependencies pulls in a GPL
# library. If this is a concern issue (also every upgrade):
# export SLUGIFY_USES_TEXT_UNIDECODE=yes
# [optional] Airflow pulls in quite a lot of dependencies in order
# to connect to other services. You might want to test or run Airflow
# from a virtual env to make sure those dependencies are separated
# from your system wide versions
python -m my_env
source my_env/bin/activate

# [required] by default one of Apache Airflow's dependencies pulls in a GPL
# library. Airflow will not install (and upgrade) without an explicit choice.
#
# To make sure not to install the GPL dependency:
# export SLUGIFY_USES_TEXT_UNIDECODE=yes
# In case you do not mind:
# export GPL_UNIDECODE=yes

# [required] building and installing
# by pip (preferred)
pip install .

# install the release
# or directly
python setup.py install
6 changes: 6 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ assists users migrating to a new version.

## Airflow Master

## Airflow 1.10

Installation and upgrading requires setting `SLUGIFY_USES_TEXT_UNIDECODE=yes` in your environment or
`AIRFLOW_GPL_UNIDECODE=yes`. In case of the latter a GPL runtime dependency will be installed due to a
dependency (python-nvd3 -> python-slugify -> unidecode).

### Replace DataProcHook.await calls to DataProcHook.wait

The method name was changed to be compatible with the Python 3.7 async/await keywords
Expand Down
3 changes: 2 additions & 1 deletion scripts/ci/kubernetes/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

FROM ubuntu:16.04

ENV SLUGIFY_USES_TEXT_UNIDECODE=yes

# install deps
RUN apt-get update -y && apt-get install -y \
wget \
Expand All @@ -33,7 +35,6 @@ RUN apt-get update -y && apt-get install -y \
unzip \
&& apt-get clean


RUN pip install --upgrade pip

# Since we install vanilla Airflow, we also want to have support for Postgres and Kubernetes
Expand Down
14 changes: 14 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@
PY3 = sys.version_info[0] == 3


# See LEGAL-362
def verify_gpl_dependency():
if (not os.getenv("AIRFLOW_GPL_UNIDECODE")
and not os.getenv("SLUGIFY_USES_TEXT_UNIDECODE") == "yes"):
raise RuntimeError("By default one of Airflow's dependencies installs a GPL "
"dependency (unidecode). To avoid this dependency set "
"SLUGIFY_USES_TEXT_UNIDECODE=yes in your environment when you "
"install or upgrade Airflow. To force installing the GPL "
"version set AIRFLOW_GPL_UNIDECODE")


class Tox(TestCommand):
user_options = [('tox-args=', None, "Arguments to pass to tox")]

Expand Down Expand Up @@ -258,6 +269,7 @@ def write_version(filename=os.path.join(*['airflow',


def do_setup():
verify_gpl_dependency()
write_version()
setup(
name='apache-airflow',
Expand Down Expand Up @@ -376,6 +388,7 @@ def do_setup():
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: System :: Monitoring',
],
author='Apache Software Foundation',
Expand All @@ -388,6 +401,7 @@ def do_setup():
'extra_clean': CleanCommand,
'compile_assets': CompileAssets
},
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
)


Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -28,7 +28,7 @@ find_links =

[flake8]
max-line-length = 90
ignore = E731
ignore = E731,W503

[testenv]
deps =
Expand Down Expand Up @@ -64,6 +64,7 @@ passenv =
BOTO_CONFIG
KRB5_CONFIG
KRB5_KTNAME
SLUGIFY_USES_TEXT_UNIDECODE

commands =
pip wheel -w {homedir}/.wheelhouse -f {homedir}/.wheelhouse -e .[devel_ci]
Expand Down

0 comments on commit c37fc0b

Please sign in to comment.