-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from rocs-org/feature/add-unixodbc-to-python-t…
…est-image Remove toolbox image.
- Loading branch information
Showing
4 changed files
with
82 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
FROM jupyter/datascience-notebook | ||
|
||
RUN conda install nb_conda_kernels nb_conda | ||
|
||
# install jupyterlab git extension | ||
RUN pip install --upgrade jupyterlab-git | ||
|
||
# instal poetry | ||
|
||
ENV POETRY_HOME=/etc/poetry | ||
|
||
# echo current user | ||
|
||
USER root | ||
|
||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
# add poetry to path | ||
ENV PATH="${POETRY_HOME}/bin:${PATH}" | ||
|
||
FROM jupyter/datascience-notebook | ||
|
||
RUN conda update -n base conda && conda install jupyter | ||
|
||
RUN conda install nb_conda_kernels nb_conda | ||
|
||
# install jupyterlab git extension | ||
RUN pip install --upgrade jupyterlab-git | ||
|
||
# instal poetry | ||
|
||
ENV POETRY_HOME=/etc/poetry | ||
|
||
# echo current user | ||
|
||
USER root | ||
|
||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
# add poetry to path | ||
ENV PATH="${POETRY_HOME}/bin:${PATH}" | ||
|
||
USER jovyan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,59 @@ | ||
import pytest | ||
import subprocess | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_jupyter(container): | ||
assert container.status == "created" | ||
assert container.run("poetry --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_jupyter_git(container): | ||
assert container.status == "created" | ||
assert container.run("make --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_container_has_poetry(container): | ||
assert container.status == "created" | ||
assert container.run("poetry --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_can_use_poetry_in_container(container, tmp_path): | ||
d = tmp_path / "pyproject.toml" | ||
d.parent.rmdir() | ||
d.parent.mkdir() | ||
d.touch() | ||
d.write_text(PYPROJECT_CONTENT) | ||
# create valid pyproject.toml in container | ||
assert container.status == "created" | ||
subprocess.run(["docker", "cp", str(d), f"{container.id}:/home/testuser/pyproject.toml"]) | ||
print(container.run("ls -la").output) | ||
assert container.run("poetry install").exit_code == 0 | ||
|
||
|
||
PYPROJECT_CONTENT = """ | ||
[tool.poetry] | ||
name = "jovyan" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["jakob"] | ||
readme = "README.md" | ||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
ramda = "^0.7.6" | ||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
""" | ||
import pytest | ||
import subprocess | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_jupyter(container): | ||
assert container.status == "created" | ||
assert container.run("poetry --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_jupyter_git(container): | ||
assert container.status == "created" | ||
assert container.run("make --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_container_has_poetry(container): | ||
assert container.status == "created" | ||
assert container.run("poetry --version").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_can_use_poetry_in_container(container, tmp_path): | ||
d = tmp_path / "pyproject.toml" | ||
d.parent.rmdir() | ||
d.parent.mkdir() | ||
d.touch() | ||
d.write_text(PYPROJECT_CONTENT) | ||
# create valid pyproject.toml in container | ||
assert container.status == "created" | ||
subprocess.run(["docker", "cp", str(d), f"{container.id}:/home/testuser/pyproject.toml"]) | ||
print(container.run("ls -la").output) | ||
assert container.run("poetry install").exit_code == 0 | ||
|
||
|
||
@pytest.mark.parametrize("container", ["python-test-environment"], indirect=["container"]) | ||
def test_can_pyodbc_in_container(container): | ||
assert container.status == "created" | ||
assert container.run("echo 'import pyodbc' | python").exit_code == 0 | ||
|
||
|
||
PYPROJECT_CONTENT = """ | ||
[tool.poetry] | ||
name = "jovyan" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["jakob"] | ||
readme = "README.md" | ||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
ramda = "^0.7.6" | ||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
""" |