Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
The nox run are build in isolated environment that will be stored in .nox. to force the venv update, remove the .nox/xxx folder.
"""


import nox

nox.options.sessions = ["lint", "test", "docs"]
Expand All @@ -20,6 +19,15 @@ def lint(session):
def test(session):
"""Run all the test using the environment variable of the running machine."""
session.install(".[test]")

# if we are in the sepal-venv, force earthengine api fork
if "sepal-user" in session.virtualenv.location:
session.run(
"pip",
"install",
"git+https://github.com/openforis/earthengine-api.git@v0.1.384#egg=earthengine-api&subdirectory=python",
)

test_files = session.posargs or ["tests"]
session.run("pytest", "--color=yes", "--cov", "--cov-report=xml", *test_files)

Expand Down
30 changes: 27 additions & 3 deletions sepal_ui/bin/module_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,36 @@ def main() -> None:
pip = current_dir_venv / "bin" / "pip"
python3 = current_dir_venv / "bin" / "python3"

for lib in ["wheel", "Cython", "ipykernel"]:
subprocess.run([str(pip), "install", lib], cwd=Path.cwd())
base_libs = [
"wheel",
"ipykernel",
"numpy",
"GDAL==3.8.3",
]

# if we are in sepal, install earthengine-api OF fork

if "sepal-user" in str(Path.cwd()):
earthengine_api = "git+https://github.com/openforis/earthengine-api.git@v0.1.384#egg=earthengine-api&subdirectory=python"
base_libs.append(earthengine_api)

subprocess.run([str(pip), "install", "--upgrade", "pip"], cwd=Path.cwd())

for lib in base_libs:
subprocess.run([str(pip), "install", "--no-cache-dir", lib], cwd=Path.cwd())

# install all the requirements
req = Path.cwd() / "requirements.txt"
subprocess.run([str(pip), "install", "-r", str(req)], cwd=Path.cwd())
subprocess.run(
[
str(pip),
"install",
"--no-cache-dir",
"-r",
str(req),
],
cwd=Path.cwd(),
)

# search for the module.yaml file
# it embeds name and entry point
Expand Down