diff options
author | Ryan Petrello <rpetrell@redhat.com> | 2021-03-11 14:43:49 +0100 |
---|---|---|
committer | Ryan Petrello <rpetrell@redhat.com> | 2021-03-11 17:54:01 +0100 |
commit | 588cb1e40339a2d3e9502f9db862db53525112a4 (patch) | |
tree | f2b6cee809182aa51bfa6d893e439961d4a1d365 /requirements | |
parent | Merge pull request #9536 from rooftopcellist/dev-db-test (diff) | |
download | awx-588cb1e40339a2d3e9502f9db862db53525112a4.tar.xz awx-588cb1e40339a2d3e9502f9db862db53525112a4.zip |
fix some requirements updater breakage
- remove requirements_ansible logic from the update script
- removed the need for py2-specific system dependencies
- update to the latest pip-tools and move to the new long format
(https://github.com/jazzband/pip-tools/pull/1237)
- fixed a few busted references to receptorctl @ devel
Diffstat (limited to 'requirements')
-rw-r--r-- | requirements/README.md | 19 | ||||
-rw-r--r-- | requirements/requirements.txt | 561 | ||||
-rw-r--r-- | requirements/requirements_git.txt | 2 | ||||
-rwxr-xr-x | requirements/updater.sh | 63 |
4 files changed, 438 insertions, 207 deletions
diff --git a/requirements/README.md b/requirements/README.md index 22dfe8d62d..ab694dfbe3 100644 --- a/requirements/README.md +++ b/requirements/README.md @@ -1,15 +1,11 @@ # Dependency Management -The `requirements.txt` and `requirements_ansible.txt` files are generated from `requirements.in` and `requirements_ansible.in`, respectively, using `pip-tools` `pip-compile`. +The `requirements.txt` file is generated from `requirements.in`, using `pip-tools` `pip-compile`. ## How To Use Commands should be run from inside the `./requirements` directory of the awx repository. -Make sure you have `patch, awk, python3, python2, python3-venv, python2-virtualenv, pip2, pip3` installed. The development container image should have all these. - -Even in the dev container, you may still have to dnf install `libpq-devel libcurl-devel`. - ### Upgrading or Adding Select Libraries If you need to add or upgrade one targeted library, then modify `requirements.in`, @@ -33,14 +29,6 @@ You can upgrade (`pip-compile --upgrade`) the dependencies by running `./updater.sh upgrade`. -## What The Script Does - -This script will: - - - Update `requirements.txt` based on `requirements.in` - - Update/generate `requirements_ansible.txt` based on `requirements_ansible.in` - - including an automated patch that adds `python_version < "3"` for Python 2 backward compatibility - ## Licenses and Source Files If any library has a change to its license with the upgrade, then the license for that library @@ -129,11 +117,6 @@ This breaks a very large amount of AWX code that assumes these fields are returned as dicts. Upgrading this library will require a refactor to accomidate this change. -### wheel - -azure-cli-core requires a version of wheel that is incompatible with -certain packages building with later versions of pip, so we override it. - ### pip and setuptools The offline installer needs to have functionality confirmed before upgrading these. diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 6256afd061..ba3cfe3087 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,135 +1,430 @@ -adal==1.2.2 # via msrestazure -aiohttp==3.6.2 # via -r /awx_devel/requirements/requirements.in -aioredis==1.3.1 # via channels-redis -# ansible-runner==1.4.7 # via -r /awx_devel/requirements/requirements.in -ansiconv==1.0.0 # via -r /awx_devel/requirements/requirements.in -asciichartpy==1.5.25 # via -r /awx_devel/requirements/requirements.in -asgiref==3.2.5 # via channels, channels-redis, daphne -async-timeout==3.0.1 # via aiohttp, aioredis -attrs==19.3.0 # via aiohttp, automat, jsonschema, service-identity, twisted -autobahn==20.12.3 # via -r /awx_devel/requirements/requirements.in, daphne -automat==20.2.0 # via twisted -azure-common==1.1.25 # via azure-keyvault -azure-keyvault==1.1.0 # via -r /awx_devel/requirements/requirements.in -azure-nspkg==3.0.2 # via azure-keyvault -cachetools==4.0.0 # via google-auth -# don't add certifi to our requirements, because we have our own specific implementation: https://github.com/ansible/system-certifi -cffi==1.14.0 # via cryptography -channels-redis==3.1.0 # via -r /awx_devel/requirements/requirements.in -channels==2.4.0 # via -r /awx_devel/requirements/requirements.in, channels-redis -chardet==3.0.4 # via aiohttp, requests -constantly==15.1.0 # via twisted -cryptography==2.9.2 # via -r /awx_devel/requirements/requirements.in, adal, autobahn, azure-keyvault, pyopenssl, service-identity, social-auth-core -daphne==2.4.1 # via -r /awx_devel/requirements/requirements.in, channels -defusedxml==0.6.0 # via python3-openid, python3-saml, social-auth-core -dictdiffer==0.8.1 # via openshift -django-auth-ldap==2.1.0 # via -r /awx_devel/requirements/requirements.in -django-cors-headers==3.2.1 # via -r /awx_devel/requirements/requirements.in -django-crum==0.7.5 # via -r /awx_devel/requirements/requirements.in -django-extensions==2.2.9 # via -r /awx_devel/requirements/requirements.in -django-guid==2.2.0 # via -r /awx_devel/requirements/requirements.in -django-jsonfield==1.2.0 # via -r /awx_devel/requirements/requirements.in -django-oauth-toolkit==1.1.3 # via -r /awx_devel/requirements/requirements.in -django-pglocks==1.0.4 # via -r /awx_devel/requirements/requirements.in -django-polymorphic==2.1.2 # via -r /awx_devel/requirements/requirements.in -django-qsstats-magic==1.1.0 # via -r /awx_devel/requirements/requirements.in -django-radius==1.3.3 # via -r /awx_devel/requirements/requirements.in -django-redis==4.5.0 # via -r /awx_devel/requirements/requirements.in -django-solo==1.1.3 # via -r /awx_devel/requirements/requirements.in -django-split-settings==1.0.0 # via -r /awx_devel/requirements/requirements.in -django-taggit==1.2.0 # via -r /awx_devel/requirements/requirements.in -django==2.2.16 # via -r /awx_devel/requirements/requirements.in, channels, django-auth-ldap, django-cors-headers, django-crum, django-guid, django-jsonfield, django-oauth-toolkit, django-polymorphic, django-taggit, djangorestframework -djangorestframework-yaml==1.0.3 # via -r /awx_devel/requirements/requirements.in -djangorestframework==3.12.1 # via -r /awx_devel/requirements/requirements.in -docutils==0.16 # via python-daemon -future==0.16.0 # via django-radius -gitdb==4.0.2 # via gitpython -gitpython==3.1.7 # via -r /awx_devel/requirements/requirements.in -google-auth==1.11.3 # via kubernetes -hiredis==1.0.1 # via aioredis -hyperlink==20.0.1 # via autobahn, twisted -idna-ssl==1.1.0 # via aiohttp -idna==2.9 # via hyperlink, idna-ssl, requests, twisted, yarl -importlib-metadata==1.5.0 # via importlib-resources, irc, jsonschema -importlib-resources==1.4.0 # via jaraco.text -incremental==17.5.0 # via twisted -irc==18.0.0 # via -r /awx_devel/requirements/requirements.in -isodate==0.6.0 # via msrest, python3-saml -jaraco.classes==3.1.0 # via jaraco.collections -jaraco.collections==3.0.0 # via irc -jaraco.functools==3.0.0 # via irc, jaraco.text, tempora -jaraco.logging==3.0.0 # via irc -jaraco.stream==3.0.0 # via irc -jaraco.text==3.2.0 # via irc, jaraco.collections -jinja2==2.11.2 # via -r /awx_devel/requirements/requirements.in, openshift -json-log-formatter==0.3.0 # via -r /awx_devel/requirements/requirements.in -jsonschema==3.2.0 # via -r /awx_devel/requirements/requirements.in -kubernetes==11.0.0 # via openshift -lockfile==0.12.2 # via python-daemon -lxml==4.5.0 # via xmlsec -markdown==3.2.1 # via -r /awx_devel/requirements/requirements.in -markupsafe==1.1.1 # via jinja2 -more-itertools==8.2.0 # via irc, jaraco.classes, jaraco.functools -msgpack==1.0.0 # via channels-redis -msrest==0.6.11 # via azure-keyvault, msrestazure -msrestazure==0.6.3 # via azure-keyvault -multidict==4.7.5 # via aiohttp, yarl -netaddr==0.7.19 # via pyrad -oauthlib==3.1.0 # via django-oauth-toolkit, requests-oauthlib, social-auth-core -openshift==0.11.0 # via -r /awx_devel/requirements/requirements.in -pexpect==4.7.0 # via -r /awx_devel/requirements/requirements.in, ansible-runner -pkgconfig==1.5.1 # via xmlsec -prometheus-client==0.7.1 # via -r /awx_devel/requirements/requirements.in -psutil==5.7.0 # via ansible-runner -psycopg2==2.8.4 # via -r /awx_devel/requirements/requirements.in -ptyprocess==0.6.0 # via pexpect -pyasn1-modules==0.2.8 # via google-auth, python-ldap, service-identity -pyasn1==0.4.8 # via pyasn1-modules, python-ldap, rsa, service-identity -pycparser==2.20 # via cffi -pygerduty==0.38.2 # via -r /awx_devel/requirements/requirements.in -pyhamcrest==2.0.2 # via twisted -pyjwt==1.7.1 # via adal, social-auth-core, twilio -pyopenssl==19.1.0 # via twisted -pyparsing==2.4.6 # via -r /awx_devel/requirements/requirements.in -pyrad==2.3 # via django-radius -pyrsistent==0.15.7 # via jsonschema -python-daemon==2.2.4 # via ansible-runner -python-dateutil==2.8.1 # via adal, kubernetes -python-ldap==3.3.1 # via -r /awx_devel/requirements/requirements.in, django-auth-ldap -python-string-utils==1.0.0 # via openshift -python3-openid==3.1.0 # via social-auth-core -python3-saml==1.9.0 # via -r /awx_devel/requirements/requirements.in -pytz==2019.3 # via django, irc, tempora, twilio -pyyaml==5.4.1 # via -r /awx_devel/requirements/requirements.in, ansible-runner, djangorestframework-yaml, kubernetes -redis==3.4.1 # via -r /awx_devel/requirements/requirements.in, django-redis -requests-oauthlib==1.3.0 # via kubernetes, msrest, social-auth-core -requests==2.23.0 # via -r /awx_devel/requirements/requirements.in, adal, azure-keyvault, django-oauth-toolkit, kubernetes, msrest, requests-oauthlib, slackclient, social-auth-core, twilio -rsa==4.0 # via google-auth -ruamel.yaml.clib==0.2.0 # via ruamel.yaml -ruamel.yaml==0.16.10 # via openshift -schedule==0.6.0 # via -r /awx_devel/requirements/requirements.in -service-identity==18.1.0 # via twisted -six==1.14.0 # via ansible-runner, automat, cryptography, django-extensions, django-pglocks, google-auth, isodate, jaraco.collections, jaraco.logging, jaraco.text, jsonschema, kubernetes, openshift, pygerduty, pyopenssl, pyrad, pyrsistent, python-dateutil, slackclient, social-auth-app-django, social-auth-core, tacacs-plus, twilio, websocket-client -slackclient==1.1.2 # via -r /awx_devel/requirements/requirements.in -smmap==3.0.1 # via gitdb -social-auth-app-django==3.1.0 # via -r /awx_devel/requirements/requirements.in -social-auth-core==3.3.1 # via -r /awx_devel/requirements/requirements.in, social-auth-app-django -sqlparse==0.3.1 # via django -tacacs_plus==1.0 # via -r /awx_devel/requirements/requirements.in -tempora==2.1.0 # via irc, jaraco.logging -twilio==6.37.0 # via -r /awx_devel/requirements/requirements.in -twisted[tls]==20.3.0 # via -r /awx_devel/requirements/requirements.in, daphne -txaio==20.12.1 # via autobahn -typing-extensions==3.7.4.1 # via aiohttp -urllib3==1.25.8 # via kubernetes, requests -uwsgi==2.0.18 # via -r /awx_devel/requirements/requirements.in -uwsgitop==0.11 # via -r /awx_devel/requirements/requirements.in -websocket-client==0.57.0 # via kubernetes, slackclient -xmlsec==1.3.3 # via python3-saml -yarl==1.4.2 # via aiohttp -zipp==3.1.0 # via importlib-metadata, importlib-resources -zope.interface==5.0.0 # via twisted +adal==1.2.2 + # via msrestazure +aiohttp==3.6.2 + # via -r /awx_devel/requirements/requirements.in +aioredis==1.3.1 + # via channels-redis +#ansible-runner==1.4.7 + # via + # -r /awx_devel/requirements/requirements.in + # -r /awx_devel/requirements/requirements_git.txt +ansiconv==1.0.0 + # via -r /awx_devel/requirements/requirements.in +asciichartpy==1.5.25 + # via -r /awx_devel/requirements/requirements.in +asgiref==3.2.5 + # via + # channels + # channels-redis + # daphne +async-timeout==3.0.1 + # via + # aiohttp + # aioredis +attrs==19.3.0 + # via + # aiohttp + # automat + # jsonschema + # service-identity + # twisted +autobahn==20.12.3 + # via + # -r /awx_devel/requirements/requirements.in + # daphne +automat==20.2.0 + # via twisted +azure-common==1.1.25 + # via azure-keyvault +azure-keyvault==1.1.0 + # via -r /awx_devel/requirements/requirements.in +azure-nspkg==3.0.2 + # via azure-keyvault +cachetools==4.0.0 + # via google-auth + # via + # -r /awx_devel/requirements/requirements_git.txt + # kubernetes + # msrest + # requests +cffi==1.14.0 + # via cryptography +channels-redis==3.1.0 + # via -r /awx_devel/requirements/requirements.in +channels==2.4.0 + # via + # -r /awx_devel/requirements/requirements.in + # channels-redis +chardet==3.0.4 + # via + # aiohttp + # requests +click==7.1.2 + # via receptorctl +constantly==15.1.0 + # via twisted +cryptography==2.9.2 + # via + # -r /awx_devel/requirements/requirements.in + # adal + # autobahn + # azure-keyvault + # pyopenssl + # service-identity + # social-auth-core +daphne==2.4.1 + # via + # -r /awx_devel/requirements/requirements.in + # channels +defusedxml==0.6.0 + # via + # python3-openid + # python3-saml + # social-auth-core +dictdiffer==0.8.1 + # via openshift +django-auth-ldap==2.1.0 + # via -r /awx_devel/requirements/requirements.in +django-cors-headers==3.2.1 + # via -r /awx_devel/requirements/requirements.in +django-crum==0.7.5 + # via -r /awx_devel/requirements/requirements.in +django-extensions==2.2.9 + # via -r /awx_devel/requirements/requirements.in +django-guid==2.2.0 + # via -r /awx_devel/requirements/requirements.in +django-jsonfield==1.2.0 + # via -r /awx_devel/requirements/requirements.in +django-oauth-toolkit==1.1.3 + # via -r /awx_devel/requirements/requirements.in +django-pglocks==1.0.4 + # via -r /awx_devel/requirements/requirements.in +django-polymorphic==2.1.2 + # via -r /awx_devel/requirements/requirements.in +django-qsstats-magic==1.1.0 + # via -r /awx_devel/requirements/requirements.in +django-radius==1.3.3 + # via -r /awx_devel/requirements/requirements.in +django-redis==4.5.0 + # via -r /awx_devel/requirements/requirements.in +django-solo==1.1.3 + # via -r /awx_devel/requirements/requirements.in +django-split-settings==1.0.0 + # via -r /awx_devel/requirements/requirements.in +django-taggit==1.2.0 + # via -r /awx_devel/requirements/requirements.in +django==2.2.16 + # via + # -r /awx_devel/requirements/requirements.in + # channels + # django-auth-ldap + # django-cors-headers + # django-crum + # django-guid + # django-jsonfield + # django-oauth-toolkit + # django-polymorphic + # django-taggit + # djangorestframework +djangorestframework-yaml==1.0.3 + # via -r /awx_devel/requirements/requirements.in +djangorestframework==3.12.1 + # via -r /awx_devel/requirements/requirements.in +docutils==0.16 + # via python-daemon +future==0.16.0 + # via django-radius +gitdb==4.0.2 + # via gitpython +gitpython==3.1.7 + # via -r /awx_devel/requirements/requirements.in +google-auth==1.11.3 + # via kubernetes +hiredis==1.0.1 + # via aioredis +hyperlink==20.0.1 + # via + # autobahn + # twisted +idna-ssl==1.1.0 + # via aiohttp +idna==2.9 + # via + # hyperlink + # idna-ssl + # requests + # twisted + # yarl +importlib-metadata==1.5.0 + # via + # importlib-resources + # irc + # jsonschema +importlib-resources==1.4.0 + # via jaraco.text +incremental==17.5.0 + # via twisted +irc==18.0.0 + # via -r /awx_devel/requirements/requirements.in +isodate==0.6.0 + # via + # msrest + # python3-saml +jaraco.classes==3.1.0 + # via jaraco.collections +jaraco.collections==3.0.0 + # via irc +jaraco.functools==3.0.0 + # via + # irc + # jaraco.text + # tempora +jaraco.logging==3.0.0 + # via irc +jaraco.stream==3.0.0 + # via irc +jaraco.text==3.2.0 + # via + # irc + # jaraco.collections +jinja2==2.11.2 + # via + # -r /awx_devel/requirements/requirements.in + # openshift +json-log-formatter==0.3.0 + # via -r /awx_devel/requirements/requirements.in +jsonschema==3.2.0 + # via -r /awx_devel/requirements/requirements.in +kubernetes==11.0.0 + # via openshift +lockfile==0.12.2 + # via python-daemon +lxml==4.5.0 + # via xmlsec +markdown==3.2.1 + # via -r /awx_devel/requirements/requirements.in +markupsafe==1.1.1 + # via jinja2 +more-itertools==8.2.0 + # via + # irc + # jaraco.classes + # jaraco.functools +msgpack==1.0.0 + # via channels-redis +msrest==0.6.11 + # via + # azure-keyvault + # msrestazure +msrestazure==0.6.3 + # via azure-keyvault +multidict==4.7.5 + # via + # aiohttp + # yarl +netaddr==0.7.19 + # via pyrad +oauthlib==3.1.0 + # via + # django-oauth-toolkit + # requests-oauthlib + # social-auth-core +openshift==0.11.0 + # via -r /awx_devel/requirements/requirements.in +pexpect==4.7.0 + # via + # -r /awx_devel/requirements/requirements.in + # ansible-runner +pkgconfig==1.5.1 + # via xmlsec +prometheus-client==0.7.1 + # via -r /awx_devel/requirements/requirements.in +psutil==5.7.0 + # via ansible-runner +psycopg2==2.8.4 + # via -r /awx_devel/requirements/requirements.in +ptyprocess==0.6.0 + # via pexpect +pyasn1-modules==0.2.8 + # via + # google-auth + # python-ldap + # service-identity +pyasn1==0.4.8 + # via + # pyasn1-modules + # python-ldap + # rsa + # service-identity +pycparser==2.20 + # via cffi +pygerduty==0.38.2 + # via -r /awx_devel/requirements/requirements.in +pyhamcrest==2.0.2 + # via twisted +pyjwt==1.7.1 + # via + # adal + # social-auth-core + # twilio +pyopenssl==19.1.0 + # via twisted +pyparsing==2.4.6 + # via -r /awx_devel/requirements/requirements.in +pyrad==2.3 + # via django-radius +pyrsistent==0.15.7 + # via jsonschema +python-daemon==2.2.4 + # via ansible-runner +python-dateutil==2.8.1 + # via + # adal + # kubernetes + # receptorctl +python-ldap==3.3.1 + # via + # -r /awx_devel/requirements/requirements.in + # django-auth-ldap +python-string-utils==1.0.0 + # via openshift +python3-openid==3.1.0 + # via social-auth-core +python3-saml==1.9.0 + # via -r /awx_devel/requirements/requirements.in +pytz==2019.3 + # via + # django + # irc + # tempora + # twilio +pyyaml==5.4.1 + # via + # -r /awx_devel/requirements/requirements.in + # ansible-runner + # djangorestframework-yaml + # kubernetes + # receptorctl + # via -r /awx_devel/requirements/requirements_git.txt +redis==3.4.1 + # via + # -r /awx_devel/requirements/requirements.in + # django-redis +requests-oauthlib==1.3.0 + # via + # kubernetes + # msrest + # social-auth-core +requests==2.23.0 + # via + # -r /awx_devel/requirements/requirements.in + # adal + # azure-keyvault + # django-oauth-toolkit + # kubernetes + # msrest + # requests-oauthlib + # slackclient + # social-auth-core + # twilio +rsa==4.0 + # via google-auth +ruamel.yaml.clib==0.2.0 + # via ruamel.yaml +ruamel.yaml==0.16.10 + # via openshift +schedule==0.6.0 + # via -r /awx_devel/requirements/requirements.in +service-identity==18.1.0 + # via twisted +six==1.14.0 + # via + # ansible-runner + # automat + # cryptography + # django-extensions + # django-pglocks + # google-auth + # isodate + # jaraco.collections + # jaraco.logging + # jaraco.text + # jsonschema + # kubernetes + # openshift + # pygerduty + # pyopenssl + # pyrad + # pyrsistent + # python-dateutil + # slackclient + # social-auth-app-django + # social-auth-core + # tacacs-plus + # twilio + # websocket-client +slackclient==1.1.2 + # via -r /awx_devel/requirements/requirements.in +smmap==3.0.1 + # via gitdb +social-auth-app-django==3.1.0 + # via -r /awx_devel/requirements/requirements.in +social-auth-core==3.3.1 + # via + # -r /awx_devel/requirements/requirements.in + # social-auth-app-django +sqlparse==0.3.1 + # via django +tacacs_plus==1.0 + # via -r /awx_devel/requirements/requirements.in +tempora==2.1.0 + # via + # irc + # jaraco.logging +twilio==6.37.0 + # via -r /awx_devel/requirements/requirements.in +twisted[tls]==20.3.0 + # via + # -r /awx_devel/requirements/requirements.in + # daphne +txaio==20.12.1 + # via autobahn +typing-extensions==3.7.4.1 + # via aiohttp +urllib3==1.25.8 + # via + # kubernetes + # requests +uwsgi==2.0.18 + # via -r /awx_devel/requirements/requirements.in +uwsgitop==0.11 + # via -r /awx_devel/requirements/requirements.in +websocket-client==0.57.0 + # via + # kubernetes + # slackclient +xmlsec==1.3.3 + # via python3-saml +yarl==1.4.2 + # via aiohttp +zipp==3.1.0 + # via + # importlib-metadata + # importlib-resources +zope.interface==5.0.0 + # via twisted # The following packages are considered to be unsafe in a requirements file: -pip==19.3.1 # via -r /awx_devel/requirements/requirements.in -setuptools==41.6.0 # via -r /awx_devel/requirements/requirements.in, asciichartpy, google-auth, jsonschema, kubernetes, markdown, python-daemon, zope.interface +pip==19.3.1 + # via -r /awx_devel/requirements/requirements.in +setuptools==41.6.0 + # via + # -r /awx_devel/requirements/requirements.in + # asciichartpy + # google-auth + # jsonschema + # kubernetes + # markdown + # python-daemon + # receptorctl + # zope.interface diff --git a/requirements/requirements_git.txt b/requirements/requirements_git.txt index 74f1fb4a9e..f2f3abaa7a 100644 --- a/requirements/requirements_git.txt +++ b/requirements/requirements_git.txt @@ -1,3 +1,3 @@ git+https://github.com/ansible/system-certifi.git@devel#egg=certifi git+git://github.com/ansible/ansible-runner@devel#egg=ansible-runner -git+https://github.com/project-receptor/receptor.git@#egg=receptorctl&subdirectory=receptorctl +git+https://github.com/project-receptor/receptor.git@0.9.6#egg=receptorctl&subdirectory=receptorctl diff --git a/requirements/updater.sh b/requirements/updater.sh index c58f1a0f62..d184cf8796 100755 --- a/requirements/updater.sh +++ b/requirements/updater.sh @@ -2,71 +2,32 @@ set -ue requirements_in="$(readlink -f ./requirements.in)" -requirements_ansible_in="$(readlink -f ./requirements_ansible.in)" requirements="$(readlink -f ./requirements.txt)" requirements_git="$(readlink -f ./requirements_git.txt)" -requirements_ansible="$(readlink -f ./requirements_ansible.txt)" pip_compile="pip-compile --no-header --quiet -r --allow-unsafe" -check_prerequisites() { - for thing in patch awk python3 python2 virtualenv ; do - command -v $thing >/dev/null 2>&1 || { echo "$thing not installed or available. Please fix this before running." ; exit 1 ; } - done -} - _cleanup() { cd / test "${KEEP_TMP:-0}" = 1 || rm -rf "${_tmp}" } -install_deps() { - pip install pip --upgrade - pip install "pip-tools==5.4.0" # see https://github.com/jazzband/pip-tools/pull/1237 -} - -generate_requirements_v3() { - venv="./venv3" - python3 -m venv "${venv}" +generate_requirements() { + venv="`pwd`/venv" + echo $venv + /usr/bin/python3 -m venv "${venv}" # shellcheck disable=SC1090 - . "${venv}/bin/activate" + source ${venv}/bin/activate - install_deps + ${venv}/bin/python3 -m pip install -U pip pip-tools ${pip_compile} --output-file requirements.txt "${requirements_in}" "${requirements_git}" # consider the git requirements for purposes of resolving deps # Then remove any git+ lines from requirements.txt cp requirements.txt requirements_tmp.txt grep -v "^git+" requirements_tmp.txt > requirements.txt && rm requirements_tmp.txt - ${pip_compile} --output-file requirements_ansible_py3.txt "${requirements_ansible_in}" -} - -generate_requirements_v2() { - venv="./venv2" - virtualenv -p python2 "${venv}" - # shellcheck disable=SC1090 - PS1="" . "${venv}/bin/activate" - - install_deps - - ${pip_compile} --output-file requirements_ansible.txt "${requirements_ansible_in}" -} - -generate_patch() { - a="requirements_ansible_py3.txt" - b="requirements_ansible.txt" - replace='; python_version < "3" #' - - # most elegant/quick solution I could come up for now - out="$(diff --ignore-matching-lines='^#' --unified "${a}" "${b}" | \ - awk -v replace="${replace}" '{ if (/^+\w/){ $2=replace; print;} else print; }' | \ - sed 's/ ;/;/g')" - test -n "${out}" - echo "${out}" } main() { - check_prerequisites - _tmp="$(mktemp -d --suffix .awx-requirements XXXX -p /tmp)" trap _cleanup INT TERM EXIT @@ -74,19 +35,11 @@ main() { pip_compile="${pip_compile} --upgrade" fi - cp -vf requirements.txt requirements_ansible.txt "${_tmp}" - cp -vf requirements_ansible.txt "${_tmp}/requirements_ansible_py3.txt" - + cp -vf requirements.txt "${_tmp}" cd "${_tmp}" - generate_requirements_v3 - generate_requirements_v2 - - sed -i 's/^wheel==0.30.0.*/wheel==0.33.6 # via azure-cli-core (overriden, see upgrade blockers)/g' requirements_ansible.txt - sed -i 's/^wheel==0.30.0.*/wheel==0.33.6 # via azure-cli-core (overriden, see upgrade blockers)/g' requirements_ansible_py3.txt - generate_patch | patch -p4 requirements_ansible_py3.txt + generate_requirements - cp -vf requirements_ansible_py3.txt "${requirements_ansible}" cp -vf requirements.txt "${requirements}" _cleanup |