1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00
awx/requirements
Shane McDonald fe850dff38 Fix offline builds
pip 19 added support for something called `pyproject.toml`. Several packages have been setting the option `build-backend = "setuptools.build_meta”` (bcrypt, attrs, jaraco) which seems to be the root of the problem when building from source. Until the community sorts this out I’m inclined to avoid pip 19.
2019-06-18 18:48:54 -04:00
..
README.md upgrade pip and setuptools 2019-06-13 09:45:18 -04:00
requirements_ansible_git.txt unpin apache-libcloud now that a version is out without PyCrypto 2019-06-04 09:26:27 -04:00
requirements_ansible_uninstall.txt Don't use the rsa python lib. 2019-04-02 15:48:30 -04:00
requirements_ansible.in upgrade pip and setuptools 2019-06-13 09:45:18 -04:00
requirements_ansible.txt Fix offline builds 2019-06-18 18:48:54 -04:00
requirements_dev.txt Fix Django 2.0 deprecation warnings 2019-04-22 14:17:14 -04:00
requirements_git.txt change from runner master to runner 1.3 2019-03-21 07:46:11 -04:00
requirements_isolated.txt upgrade to the latest pexpect 2018-05-29 09:52:59 -04:00
requirements_setup_requires.txt Fix offline builds 2019-06-18 18:48:54 -04:00
requirements_tower_uninstall.txt remove redbaron and update dependencies 2019-02-21 10:08:24 -05:00
requirements.in upgrade pip and setuptools 2019-06-13 09:45:18 -04:00
requirements.txt Fix offline builds 2019-06-18 18:48:54 -04:00

The requirements.txt and requirements_ansible.txt files are generated from requirements.in and requirements_ansible.in, respectively, using pip-tools pip-compile. The following commands should do this if ran inside the tools_awx container.

Run these commands from the root of the awx repo. This will produce python 3 requirements files. If you do not wish to upgrade dependencies generally (such as adding a specific dependency needed for a feature) then do not use the -U flag.

python3 -m venv /buildit
source /buildit/bin/activate
pip install pip-tools
pip install pip --upgrade

pip-compile -U -r --allow-unsafe --output-file requirements/requirements.txt requirements/requirements.in
pip-compile -U -r --allow-unsafe --output-file requirements/requirements_ansible_py3.txt requirements/requirements_ansible.in

Remove the docutils line from requirements/requirements.txt.

The Ansible venv requirements file needs to start with the python 2 version as a base. Then we can run the tool again to get the python 3 version. Consult the output of the diff command and add a conditional switch in those cases.

virtualenv -p python2 /buildit_py2
source /buildit_py2/bin/activate
pip install pip-tools
pip install pip --upgrade

pip-compile -U -r --allow-unsafe --output-file requirements/requirements_ansible.txt requirements/requirements_ansible.in
diff requirements/requirements_ansible_py3.txt requirements/requirements_ansible.txt
rm requirements/requirements_ansible_py3.txt

Python 3 exceptions should be added to relevant requirements_ansible.txt lines after version numbers with the syntax of ; python_version < '3'.

Licenses and Source Files

If any library has a change to its license with the upgrade, then the license for that library inside of docs/licenses needs to be updated.

For libraries that have source distribution requirements (LGPL as an example), a tarball of the library is kept along with the license. To download the PyPI tarball, you can run this command:

pip download <pypi library name> -d docs/licenses/ --no-binary :all: --no-deps

Make sure to delete the old tarball if it is an upgrade.