diff --git a/Makefile b/Makefile index b32cf7b35c..684b267244 100644 --- a/Makefile +++ b/Makefile @@ -285,8 +285,10 @@ requirements_ansible: virtualenv_ansible if [ "$(VENV_BASE)" ]; then \ . $(VENV_BASE)/ansible/bin/activate; \ $(VENV_BASE)/ansible/bin/pip install --ignore-installed --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements_ansible.txt ;\ + $(VENV_BASE)/ansible/bin/pip uninstall --yes -r requirements/requirements_ansible_uninstall.txt; \ else \ pip install --ignore-installed --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements_ansible.txt ; \ + pip uninstall --yes -r requirements/requirements_ansible_uninstall.txt; \ fi # Install third-party requirements needed for Tower's environment. @@ -294,14 +296,17 @@ requirements_tower: virtualenv_tower if [ "$(VENV_BASE)" ]; then \ . $(VENV_BASE)/tower/bin/activate; \ $(VENV_BASE)/tower/bin/pip install --ignore-installed --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements.txt ;\ + $(VENV_BASE)/tower/bin/pip uninstall --yes -r requirements/requirements_tower_uninstall.txt; \ else \ pip install --ignore-installed --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements.txt ; \ + pip uninstall --yes -r requirements/requirements_tower_uninstall.txt; \ fi requirements_tower_dev: if [ "$(VENV_BASE)" ]; then \ . $(VENV_BASE)/tower/bin/activate; \ $(VENV_BASE)/tower/bin/pip install -r requirements/requirements_dev.txt; \ + $(VENV_BASE)/tower/bin/pip uninstall --yes -r requirements/requirements_dev_uninstall.txt; \ fi # Install third-party requirements needed for running unittests in jenkins diff --git a/requirements/README b/requirements/README deleted file mode 100644 index 26348a68de..0000000000 --- a/requirements/README +++ /dev/null @@ -1,10 +0,0 @@ -To find packages missing from requirements.txt run the below command and look for packages after the example listed below. - -`PYTHONPATH=awx/lib/site-packages/ pip freeze -r requirements/requirements.txt` - -``` -... -## The following requirements were added by pip freeze: -functools32==3.2.3.post2 -... -``` diff --git a/requirements/README.md b/requirements/README.md new file mode 100644 index 0000000000..f5080fadde --- /dev/null +++ b/requirements/README.md @@ -0,0 +1,19 @@ +The requirements.txt and requirements_ansible.txt files are generated from requirements.in and requirements_ansible.in, respectively, using `pip-tools` `pip-compile`. + +``` +virtualenv /buildit +source /buildit/bin/activate +pip install pip-tools +pip install pip --upgrade + +pip-compile requirements/requirements.in > requirements/requirements.txt +pip-compile requirements/requirements_ansible.in > requirements/requirements_ansible.txt +``` + +## Known Issues + +* Remove the `-e` from packages of the form `-e git+https://github.com...` in the generated `.txt`. Failure to do so will result in a "bad" RPM and DEB due to the `pip install` laying down a symbolic link with an absolute path from the virtualenv to the git repository that will differ from when the RPM and DEB are build to when the RPM and DEB are installed on a machine. By removing the `-e` the symbolic egg link will not be created and all is well. + +* As of `pip-tools` `1.8.1` `pip-compile` does not resolve packages specified using a git url. Thus, dependencies for things like `dm.xmlsec.binding` do not get resolved and output to `requirements.txt`. This means that: + * can't use `pip install --no-deps` because other deps WILL be sucked in + * all dependencies are NOT captured in our `.txt` files. This means you can't rely on the `.txt` when gathering licenses. diff --git a/requirements/requirements_ansible_uninstall.txt b/requirements/requirements_ansible_uninstall.txt new file mode 100644 index 0000000000..963eac530b --- /dev/null +++ b/requirements/requirements_ansible_uninstall.txt @@ -0,0 +1 @@ +certifi diff --git a/requirements/requirements_dev_uninstall.txt b/requirements/requirements_dev_uninstall.txt new file mode 100644 index 0000000000..963eac530b --- /dev/null +++ b/requirements/requirements_dev_uninstall.txt @@ -0,0 +1 @@ +certifi diff --git a/requirements/requirements_tower_uninstall.txt b/requirements/requirements_tower_uninstall.txt new file mode 100644 index 0000000000..963eac530b --- /dev/null +++ b/requirements/requirements_tower_uninstall.txt @@ -0,0 +1 @@ +certifi