mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
towards virtualenv being exactly requirements.txt
* Ignore already installed (usually global) packages when installing requirements.txt into the virtualenv.
This commit is contained in:
parent
ca34ea4c3b
commit
1883485724
8
Makefile
8
Makefile
@ -284,18 +284,18 @@ virtualenv_tower:
|
||||
requirements_ansible: virtualenv_ansible
|
||||
if [ "$(VENV_BASE)" ]; then \
|
||||
. $(VENV_BASE)/ansible/bin/activate; \
|
||||
$(VENV_BASE)/ansible/bin/pip install --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements_ansible.txt ;\
|
||||
$(VENV_BASE)/ansible/bin/pip install --ignore-installed --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements_ansible.txt ;\
|
||||
else \
|
||||
pip install --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements_ansible.txt ; \
|
||||
pip install --ignore-installed --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements_ansible.txt ; \
|
||||
fi
|
||||
|
||||
# Install third-party requirements needed for Tower's environment.
|
||||
requirements_tower: virtualenv_tower
|
||||
if [ "$(VENV_BASE)" ]; then \
|
||||
. $(VENV_BASE)/tower/bin/activate; \
|
||||
$(VENV_BASE)/tower/bin/pip install --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements.txt ;\
|
||||
$(VENV_BASE)/tower/bin/pip install --ignore-installed --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements.txt ;\
|
||||
else \
|
||||
pip install --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements.txt ; \
|
||||
pip install --ignore-installed --no-binary $(SRC_ONLY_PKGS) -r requirements/requirements.txt ; \
|
||||
fi
|
||||
|
||||
requirements_tower_dev:
|
||||
|
||||
@ -1,29 +1,29 @@
|
||||
|
||||
import os
|
||||
from pip.operations import freeze
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
def test_req():
|
||||
def test_env_matches_requirements_txt():
|
||||
|
||||
def check_is_in(src, dests):
|
||||
if src not in dests:
|
||||
src2 = [src[0].replace('_', '-'), src[1]]
|
||||
if src2 not in dests:
|
||||
print("%s not in" % src2)
|
||||
return False
|
||||
else:
|
||||
print("%s not in" % src)
|
||||
return False
|
||||
print("%s not in" % src)
|
||||
return False
|
||||
return True
|
||||
|
||||
base_dir = settings.BASE_DIR
|
||||
requirements_path = os.path.join(base_dir, '../', 'requirements/requirements.txt')
|
||||
|
||||
reqs_actual = []
|
||||
xs = freeze.freeze(local_only=True, requirement=base_dir + "/../requirements/requirements.txt")
|
||||
xs = freeze.freeze(local_only=True, requirement=requirements_path)
|
||||
for x in xs:
|
||||
if '## The following requirements were added by pip freeze' in x:
|
||||
break
|
||||
reqs_actual.append(x.split('=='))
|
||||
|
||||
reqs_expected = []
|
||||
with open(base_dir + "/../requirements/requirements.txt") as f:
|
||||
with open(requirements_path) as f:
|
||||
for line in f:
|
||||
line.rstrip()
|
||||
# TODO: process git requiremenst and use egg
|
||||
@ -34,15 +34,12 @@ def test_req():
|
||||
line.rstrip()
|
||||
reqs_expected.append(line.rstrip().split('=='))
|
||||
|
||||
for r in reqs_actual:
|
||||
print(r)
|
||||
|
||||
not_found = []
|
||||
for r in reqs_expected:
|
||||
res = check_is_in(r, reqs_actual)
|
||||
if res is False:
|
||||
not_found.append(r)
|
||||
|
||||
raise RuntimeError("%s not found in \n\n%s" % (not_found, reqs_expected))
|
||||
raise RuntimeError("%s not found in \n\n%s" % (not_found, reqs_actual))
|
||||
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ suds==0.4
|
||||
unicodecsv==0.14.1
|
||||
warlock==1.2.0
|
||||
twilio==4.9.1
|
||||
uwsgi==2.0.14
|
||||
uWSGI==2.0.14
|
||||
wheel==0.24.0
|
||||
wrapt==1.10.6
|
||||
wsgiref==0.1.2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user