Skip to content

Commit

Permalink
#141 updated dependencies to fix vulnerabilities (#142)
Browse files Browse the repository at this point in the history
* Prepare release 0.4.0
* #141: Updated dependencies to fix vulnerabilities
* Fixed mypy for Python 3.10
* Cleaned tests and disabled warnings on top-level
  • Loading branch information
ckunki authored Oct 23, 2024
1 parent e147e4c commit 2ed1de2
Show file tree
Hide file tree
Showing 11 changed files with 1,229 additions and 1,157 deletions.
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
poetry.lock linguist-generated=true
poetry.lock linguist-generated
doc/changes/changelog.md linguist-generated
version.py linguist-generated
7 changes: 7 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ jobs:

- name: Calculate Test Coverage
run: poetry run nox -s coverage -- -- --db-version ${{ matrix.exasol-version }}
env:
PYTEST_ADDOPTS: >
-W 'ignore::DeprecationWarning:luigi:'
-W 'ignore::DeprecationWarning:pkg_resources:'
-W 'ignore:pkg_resources is deprecated as an API:DeprecationWarning'
-W 'ignore:Deprecated call to \`pkg_resources.declare_namespace:DeprecationWarning'
-W 'ignore::DeprecationWarning:exasol_integration_test_docker_environment:'
- name: Upload Artifacts
uses: actions/upload-artifact@v3
Expand Down
2 changes: 2 additions & 0 deletions doc/changes/changelog.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions doc/changes/changes_0.4.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 0.4.0 - 2024-10-23

## Summary

This release fixes vulnerabilities by updating dependencies.

## Security Issues

* #141: Updated dependencies to fix vulnerabilities
4 changes: 2 additions & 2 deletions exasol/nb_connector/itde_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ def restart_itde(conf: Secrets) -> None:
if status is ItdeContainerStatus.ABSENT:
raise RuntimeError("The Docker-DB container doesn't exist.")

if ItdeContainerStatus.RUNNING not in status:
if ItdeContainerStatus.RUNNING not in status: # type: ignore[operator]
container_name = conf.get(AILabConfig.itde_container)
with ContextDockerClient() as docker_client:
container = docker_client.containers.get(container_name)
container.start()

if ItdeContainerStatus.VISIBLE not in status:
if ItdeContainerStatus.VISIBLE not in status: # type: ignore[operator]
network_name = conf.get(AILabConfig.itde_network)
if network_name:
_add_current_container_to_db_network(network_name)
Expand Down
2,315 changes: 1,165 additions & 1,150 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "exasol-notebook-connector"
version = "0.3.0"
version = "0.4.0"
description = "Components, tools, APIs, and configurations in order to connect Jupyter notebooks to Exasol and various other systems."
packages = [ {include = "exasol"}, ]
authors = [ "Christoph Kuhnke <[email protected]>" ]
Expand Down
4 changes: 2 additions & 2 deletions test/integration/test_itde_manager_in_docker_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def dockerfile_content() -> str:
return cleandoc(
"""
FROM ubuntu:22.04
RUN apt-get update
RUN apt-get install --yes --no-install-recommends python3 python3-pip git
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --upgrade pip
"""
)

Expand Down
2 changes: 2 additions & 0 deletions test/unit/test_container_by_ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def create_container_mock(networks: Dict[str, str]) -> Union[MagicMock, Containe


class TestSetup:
__test__ = False

def __init__(self, containers: Dict[str, Dict[str, str]]):
self.docker_client_mock, self.container_mocks = create_docker_client_mock(containers)
self.container_by_ip = ContainerByIp(
Expand Down
35 changes: 35 additions & 0 deletions test/unit/test_itde_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
NAME_SERVER_ADDRESS,
bring_itde_up,
take_itde_down,
ItdeContainerStatus,
)

TEST_CONTAINER_NAME = "the_new_container"
Expand Down Expand Up @@ -106,3 +107,37 @@ def test_take_itde_down(mock_util1, mock_util2, mock_util3, secrets):
assert secrets.get(CKey.bfs_user) is None
assert secrets.get(CKey.bfs_password) is None
assert secrets.get(CKey.bfs_port) is None


@pytest.mark.parametrize("status", [
ItdeContainerStatus.RUNNING,
ItdeContainerStatus.READY,
])
def test_status_running(status):
assert ItdeContainerStatus.RUNNING in status


@pytest.mark.parametrize("status", [
ItdeContainerStatus.ABSENT,
ItdeContainerStatus.STOPPED,
ItdeContainerStatus.VISIBLE,
])
def test_status_not_running(status):
assert ItdeContainerStatus.RUNNING not in status


@pytest.mark.parametrize("status", [
ItdeContainerStatus.VISIBLE,
ItdeContainerStatus.READY,
])
def test_status_visible(status):
assert ItdeContainerStatus.VISIBLE in status


@pytest.mark.parametrize("status", [
ItdeContainerStatus.ABSENT,
ItdeContainerStatus.STOPPED,
ItdeContainerStatus.RUNNING,
])
def test_status_not_visible(status):
assert ItdeContainerStatus.VISIBLE not in status
2 changes: 1 addition & 1 deletion version.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2ed1de2

Please sign in to comment.