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">
|
<component name="JavaScriptSettings">
|
||||||
<option name="languageLevel" value="ES6" />
|
<option name="languageLevel" value="ES6" />
|
||||||
</component>
|
</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">
|
<component name="PythonCompatibilityInspectionAdvertiser">
|
||||||
<option name="version" value="3" />
|
<option name="version" value="3" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
2
.idea/revpipyload.iml
generated
2
.idea/revpipyload.iml
generated
@@ -5,7 +5,7 @@
|
|||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
</content>
|
</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" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PackageRequirementsSettings">
|
<component name="PackageRequirementsSettings">
|
||||||
|
|||||||
2
.idea/vcs.xml
generated
2
.idea/vcs.xml
generated
@@ -3,6 +3,8 @@
|
|||||||
<component name="CommitMessageInspectionProfile">
|
<component name="CommitMessageInspectionProfile">
|
||||||
<profile version="1.0">
|
<profile version="1.0">
|
||||||
<inspection_tool class="BodyLimit" enabled="true" level="WARNING" enabled_by_default="true" />
|
<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="SubjectBodySeparation" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
<inspection_tool class="SubjectLimit" enabled="true" level="WARNING" enabled_by_default="true" />
|
<inspection_tool class="SubjectLimit" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
</profile>
|
</profile>
|
||||||
|
|||||||
25
Makefile
25
Makefile
@@ -5,23 +5,34 @@ MAKEFLAGS = --no-print-directory --no-builtin-rules
|
|||||||
# Variables
|
# Variables
|
||||||
PACKAGE = revpipyload
|
PACKAGE = revpipyload
|
||||||
|
|
||||||
# If virtualenv exists, use it. If not, use PATH to find, except python3
|
# Set path to create the virtual environment with package name
|
||||||
SYSTEM_PYTHON = /usr/bin/python3
|
ifdef PYTHON3_VENV
|
||||||
PYTHON = $(or $(wildcard venv/bin/python), $(SYSTEM_PYTHON))
|
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
|
all: build
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
|
||||||
## Environment
|
## Environment
|
||||||
|
venv-info:
|
||||||
|
echo Using path: "$(VENV_PATH)"
|
||||||
|
exit 0
|
||||||
|
|
||||||
venv:
|
venv:
|
||||||
$(SYSTEM_PYTHON) -m venv venv
|
$(SYSTEM_PYTHON) -m venv "$(VENV_PATH)"
|
||||||
source venv/bin/activate && \
|
source $(VENV_PATH)/bin/activate && \
|
||||||
python3 -m pip install --upgrade pip && \
|
python3 -m pip install --upgrade pip && \
|
||||||
python3 -m pip install -r requirements.txt
|
python3 -m pip install -r requirements.txt
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
.PHONY: venv
|
.PHONY: venv-info venv
|
||||||
|
|
||||||
## Build, install
|
## Build, install
|
||||||
build:
|
build:
|
||||||
@@ -38,6 +49,6 @@ clean:
|
|||||||
rm -rf build dist src/*.egg-info *.spec
|
rm -rf build dist src/*.egg-info *.spec
|
||||||
|
|
||||||
clean-all: clean
|
clean-all: clean
|
||||||
rm -R venv
|
rm -R $(VENV_PATH)
|
||||||
|
|
||||||
.PHONY: clean clean-all
|
.PHONY: clean clean-all
|
||||||
|
|||||||
Reference in New Issue
Block a user