← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~ines-almeida/txpkgupload:refactor-makefile-commands into txpkgupload:master

 

Ines Almeida has proposed merging ~ines-almeida/txpkgupload:refactor-makefile-commands into txpkgupload:master.

Commit message:
Install python packages from wheels when wheels directory exist

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ines-almeida/txpkgupload/+git/txpkgupload/+merge/446377

When building the 'env', it installs from the `wheels` directory when the directory exists - this assumes that if the `wheels` directory exists, it will contain the wheels we need, which I think it's a fair assumption.

I tested both the cases where there is a wheels directory with all the wheels, and where there isn't a wheels directory.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ines-almeida/txpkgupload:refactor-makefile-commands into txpkgupload:master.
diff --git a/Makefile b/Makefile
index 98163b0..7f1eed2 100644
--- a/Makefile
+++ b/Makefile
@@ -74,13 +74,18 @@ $(DEPENDENCY_DIR):
 
 $(ENV):
 	mkdir -p $(ENV)
+	$(PYTHON) -m venv env
+	@if [ -d $(WHEELS) ]; then \
+		echo 'Found $(WHEELS) director, installing from folder...'; \
+		$(PIP) install -f $(WHEELS) --no-index -r bootstrap-requirements.txt; \
+		$(PIP) install -f $(WHEELS) --no-index -c requirements.txt -e '.[test]'; \
+	else \
 	(echo '[easy_install]'; \
 	 echo 'find_links = file://$(DEPENDENCY_DIR)/') \
-		>$(ENV)/.pydistutils.cfg
-	VIRTUALENV_SETUPTOOLS=1 $(VIRTUALENV) \
-		--python=$(PYTHON) --never-download $(ENV)
-	$(PIP) install $(PIP_ARGS) -r bootstrap-requirements.txt
-	$(PIP) install $(PIP_ARGS) -c requirements.txt -e '.[test]'
+		>$(ENV)/.pydistutils.cfg; \
+		$(PIP) install $(PIP_ARGS) -r bootstrap-requirements.txt; \
+		$(PIP) install $(PIP_ARGS) -c requirements.txt -e '.[test]'; \
+	fi
 	$(ENV)/bin/python -m compileall -q src
 	ln -nsf $(ENV)/bin bin
 
@@ -100,6 +105,7 @@ clean: clean_pip
 	$(RM) $(VERSION_INFO)
 	$(RM) -rf dist
 	$(RM) -rf build
+	$(RM) -rf $(ENV)
 
 
 .PHONY: compile check clean clean_pip default dist

Follow ups