mirror of
https://github.com/naruxde/revpipyload.git
synced 2025-11-08 15:13:52 +01:00
build: Add environment variable to set alternative venv path
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -3,7 +3,7 @@
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (revpipyload)" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (revpipyload)" project-jdk-type="Python SDK" />
|
||||
<component name="PythonCompatibilityInspectionAdvertiser">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
|
||||
2
.idea/revpipyload.iml
generated
2
.idea/revpipyload.iml
generated
@@ -5,7 +5,7 @@
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.8 (revpipyload)" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.11 (revpipyload)" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PackageRequirementsSettings">
|
||||
|
||||
2
.idea/vcs.xml
generated
2
.idea/vcs.xml
generated
@@ -3,6 +3,8 @@
|
||||
<component name="CommitMessageInspectionProfile">
|
||||
<profile version="1.0">
|
||||
<inspection_tool class="BodyLimit" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="CommitFormat" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="CommitNamingConvention" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="SubjectBodySeparation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="SubjectLimit" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
|
||||
25
Makefile
25
Makefile
@@ -5,23 +5,34 @@ MAKEFLAGS = --no-print-directory --no-builtin-rules
|
||||
# Variables
|
||||
PACKAGE = revpipyload
|
||||
|
||||
# If virtualenv exists, use it. If not, use PATH to find, except python3
|
||||
SYSTEM_PYTHON = /usr/bin/python3
|
||||
PYTHON = $(or $(wildcard venv/bin/python), $(SYSTEM_PYTHON))
|
||||
# Set path to create the virtual environment with package name
|
||||
ifdef PYTHON3_VENV
|
||||
VENV_PATH = $(PYTHON3_VENV)/$(PACKAGE)
|
||||
else
|
||||
VENV_PATH = venv
|
||||
endif
|
||||
|
||||
# If virtualenv exists, use it. If not, use PATH to find commands
|
||||
SYSTEM_PYTHON = python3
|
||||
PYTHON = $(or $(wildcard $(VENV_PATH)/bin/python), $(SYSTEM_PYTHON))
|
||||
|
||||
all: build
|
||||
|
||||
.PHONY: all
|
||||
|
||||
## Environment
|
||||
venv-info:
|
||||
echo Using path: "$(VENV_PATH)"
|
||||
exit 0
|
||||
|
||||
venv:
|
||||
$(SYSTEM_PYTHON) -m venv venv
|
||||
source venv/bin/activate && \
|
||||
$(SYSTEM_PYTHON) -m venv "$(VENV_PATH)"
|
||||
source $(VENV_PATH)/bin/activate && \
|
||||
python3 -m pip install --upgrade pip && \
|
||||
python3 -m pip install -r requirements.txt
|
||||
exit 0
|
||||
|
||||
.PHONY: venv
|
||||
.PHONY: venv-info venv
|
||||
|
||||
## Build, install
|
||||
build:
|
||||
@@ -38,6 +49,6 @@ clean:
|
||||
rm -rf build dist src/*.egg-info *.spec
|
||||
|
||||
clean-all: clean
|
||||
rm -R venv
|
||||
rm -R $(VENV_PATH)
|
||||
|
||||
.PHONY: clean clean-all
|
||||
|
||||
Reference in New Issue
Block a user