diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 96e9d6303..fa0e0e04f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,8 +1,8 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, -# @Raalsky, @AleksanderWWW and @szysad will be requested for +# @PatrykGala and @kgodlewski will be requested for # review when someone opens a pull request. -/* @Raalsky @AleksanderWWW @szysad +/* @PatrykGala @kgodlewski # File/directory specific owners -/README.md @normandy7 @Raalsky @AleksanderWWW @szysad +/README.md @normandy7 @PatrykGala @kgodlewski diff --git a/.github/neptune_client_pyproject.toml b/.github/neptune_client_pyproject.toml index 67dd813c2..45c9fbe8f 100644 --- a/.github/neptune_client_pyproject.toml +++ b/.github/neptune_client_pyproject.toml @@ -9,7 +9,7 @@ style = "semver" pattern = "default-unprefixed" [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" # Python lack of functionalities from future versions importlib-metadata = { version = "*", python = "<3.8" } @@ -42,7 +42,7 @@ pandas = "*" # Additional integrations kedro-neptune = { version = "*", optional = true, python = "<3.11" } -neptune-detectron2 = { version = "*", optional = true, python = ">=3.7"} +neptune-detectron2 = { version = "*", optional = true, python = ">=3.8"} neptune-fastai = { version = "*", optional = true } neptune-lightgbm = { version = "*", optional = true } pytorch-lightning = { version = "*", optional = true } diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 75d762702..fe1c2ea73 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.12" ] + python-version: [ "3.8", "3.12" ] os: [ ubuntu, windows ] include: - python-version: "3.8" @@ -67,7 +67,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.12" ] + python-version: [ "3.8", "3.12" ] os: [ ubuntu, windows ] include: - python-version: "3.8" @@ -102,7 +102,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.12" ] + python-version: [ "3.8", "3.12" ] os: [ ubuntu, windows ] include: - python-version: "3.8" @@ -140,7 +140,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.12" ] + python-version: [ "3.8", "3.12" ] os: [ ubuntu, windows ] include: - python-version: "3.8" diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index 47560ebe4..91992a080 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -17,8 +17,8 @@ jobs: > Command | Description > --- | --- > /pre-commit-apply | Commit a pre-commit suggestions - > /run-unit | Run unittests on full matrix *(win, mac, linux x py3.7-3.12) - > /run-e2e | Run E2E tests on full matrix *(win, mac, linux x py3.7-3.12) - > /run-integrations | Run Client integrations on full matrix *(win, mac, linux x py3.7-3.12) - > /run-all-test | Run all tests on full matrix *(win, mac, linux x py3.7-3.12) + > /run-unit | Run unittests on full matrix *(win, mac, linux x py3.8-3.12) + > /run-e2e | Run E2E tests on full matrix *(win, mac, linux x py3.8-3.12) + > /run-integrations | Run Client integrations on full matrix *(win, mac, linux x py3.8-3.12) + > /run-all-test | Run all tests on full matrix *(win, mac, linux x py3.8-3.12) reaction-type: hooray diff --git a/.github/workflows/integrations.yml b/.github/workflows/integrations.yml index 48025107b..eb6b31fca 100644 --- a/.github/workflows/integrations.yml +++ b/.github/workflows/integrations.yml @@ -32,7 +32,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.10" ] + python-version: [ "3.8", "3.10" ] os: [ ubuntu-latest, windows-latest ] include: - python-version: "3.8" @@ -133,7 +133,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.10" ] + python-version: [ "3.8", "3.10" ] os: [ ubuntu-latest ] include: - python-version: "3.8" @@ -186,7 +186,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.10" ] + python-version: [ "3.8", "3.10" ] os: [ ubuntu-latest, windows-latest ] include: - python-version: "3.8" @@ -239,7 +239,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.10" ] + python-version: [ "3.8", "3.10" ] os: [ ubuntu-latest ] include: - python-version: "3.8" @@ -435,7 +435,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.10" ] + python-version: [ "3.8", "3.10" ] os: [ ubuntu-latest ] include: - python-version: "3.8" @@ -579,7 +579,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.9" ] + python-version: [ "3.8", "3.9" ] os: [ ubuntu-latest ] include: - python-version: "3.8" @@ -632,7 +632,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.9" ] + python-version: [ "3.8", "3.9" ] os: [ ubuntu-latest, windows-latest ] include: - python-version: "3.8" @@ -685,7 +685,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [ "3.7", "3.10" ] + python-version: [ "3.8", "3.10" ] os: [ ubuntu-latest, windows-latest ] include: - python-version: "3.8" diff --git a/.github/workflows/unit-in-pull-request.yml b/.github/workflows/unit-in-pull-request.yml index f141b4709..8cabb8ab7 100644 --- a/.github/workflows/unit-in-pull-request.yml +++ b/.github/workflows/unit-in-pull-request.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu, windows] - python-version: ["3.7"] + python-version: ["3.8"] include: - os: macos python-version: "3.8" diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 40097fa77..b8aa8f1a7 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu, windows] include: - python-version: "3.8" diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fb3845ce..2d2e87f01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## neptune 1.12.0 + +### Changes +- Dropped support for Python 3.7 ([#1864](https://github.com/neptune-ai/neptune-client/pull/1864)) + +### Fixes +- Fixed support for additional Seaborn figure types ([#1864](https://github.com/neptune-ai/neptune-client/pull/1864)) + ## neptune 1.11.1 ### Fixes diff --git a/codecov.yml b/codecov.yml index 1c45809cd..3fdecafe1 100644 --- a/codecov.yml +++ b/codecov.yml @@ -29,11 +29,6 @@ flags: - src/neptune carryforward: true - py3.7: - paths: - - src/neptune - carryforward: true - py3.8: paths: - src/neptune diff --git a/pyproject.toml b/pyproject.toml index 6c62ebbc1..c2da0ff4e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,10 +9,9 @@ style = "semver" pattern = "default-unprefixed" [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" # Python lack of functionalities from future versions -importlib-metadata = { version = "*", python = "<3.8" } typing-extensions = ">=3.10.0" # Missing compatibility layer between Python 2 and Python 3 @@ -43,7 +42,7 @@ pandas = "*" # Additional integrations kedro-neptune = { version = "*", optional = true, python = ">=3.9,<3.12" } -neptune-detectron2 = { version = "*", optional = true, python = ">=3.7"} +neptune-detectron2 = { version = "*", optional = true, python = ">=3.8"} neptune-fastai = { version = "*", optional = true } neptune-lightgbm = { version = "*", optional = true } pytorch-lightning = { version = "*", optional = true } diff --git a/src/neptune/internal/utils/images.py b/src/neptune/internal/utils/images.py index 8657c54da..e928a9280 100644 --- a/src/neptune/internal/utils/images.py +++ b/src/neptune/internal/utils/images.py @@ -249,6 +249,8 @@ def _get_pil_image_data(image: PILImage) -> bytes: def _get_figure_image_data(figure) -> bytes: + if figure.__class__.__name__ == "Axes": + figure = figure.figure with io.BytesIO() as image_buffer: figure.savefig(image_buffer, format="png", bbox_inches="tight") return image_buffer.getvalue() @@ -283,7 +285,7 @@ def is_pil_image(image) -> bool: def is_matplotlib_figure(image): - return image.__class__.__module__.startswith("matplotlib.") and image.__class__.__name__ == "Figure" + return image.__class__.__module__.startswith("matplotlib.") and image.__class__.__name__ in ["Figure", "Axes"] def is_plotly_figure(chart): diff --git a/src/neptune/legacy/internal/utils/image.py b/src/neptune/legacy/internal/utils/image.py index 4faf520d8..21f6b4145 100644 --- a/src/neptune/legacy/internal/utils/image.py +++ b/src/neptune/legacy/internal/utils/image.py @@ -68,6 +68,8 @@ def get_image_content(image): def _get_figure_as_image(figure): + if figure.__class__.__name__ == "Axes": + figure = figure.figure with io.BytesIO() as image_buffer: figure.savefig(image_buffer, format="png", bbox_inches="tight") return image_buffer.getvalue() diff --git a/tests/unit/neptune/new/internal/utils/test_images.py b/tests/unit/neptune/new/internal/utils/test_images.py index 5a568f7f5..4de88dfe2 100644 --- a/tests/unit/neptune/new/internal/utils/test_images.py +++ b/tests/unit/neptune/new/internal/utils/test_images.py @@ -49,7 +49,6 @@ class TestImage(unittest.TestCase): - TEST_DIR = "/tmp/neptune/{}".format(uuid4()) def setUp(self): @@ -143,6 +142,12 @@ def test_get_image_content_from_seaborn_figure(self): # then self.assertEqual(get_image_content(grid), self._encode_figure(grid)) + # given + figure = sns.lineplot(x=[1, 2, 3], y=[4, 5, 6]) + + # then + self.assertEqual(get_image_content(figure), self._encode_figure(figure)) + def test_get_html_from_matplotlib_figure(self): # given fig = pyplot.figure() @@ -262,6 +267,8 @@ def _encode_pil_image(image: Image) -> bytes: @staticmethod def _encode_figure(fig: Figure) -> bytes: + if fig.__class__.__name__ == "Axes": + fig = fig.figure with io.BytesIO() as image_buffer: fig.savefig(image_buffer, format="PNG", bbox_inches="tight") return image_buffer.getvalue()