Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop 3.6 from setup and ci, add 3.10 to ci #879

Merged
merged 9 commits into from
Apr 6, 2022
Merged
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
2 changes: 1 addition & 1 deletion .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"

- name: Install dependencies
run: pip install -r requirements.txt -r requirements/e2e_requirements.txt
Expand Down
27 changes: 11 additions & 16 deletions .github/workflows/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ jobs:
max-parallel: 4
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]
include:
- os: ubuntu-latest
python-version: 3.9
- os: macos-latest
python-version: 3.9
python-version: ["3.7", "3.8", "3.9", "3.10"]
env:
WORKSPACE_NAME: e2e-tests
BUCKET_NAME: ${{ secrets.E2E_BUCKET_NAME }}
Expand Down Expand Up @@ -79,22 +74,22 @@ jobs:
pytest ./e2e_tests -m integrations

- name: Test Fast.ai integration
if: matrix.os != 'windows-latest' && matrix.python-version != '3.6'
if: matrix.os != 'windows-latest'
uses: neptune-ai/neptune-fastai/.github/actions/e2e@master
with:
working_directory: neptune_fastai
env:
NEPTUNE_API_TOKEN: ${{ secrets.E2E_NEPTUNE_API_TOKEN }}
NEPTUNE_PROJECT: e2e-tests/e2e

- name: Test Kedro integration
if: matrix.os == 'ubuntu-latest' && matrix.python-version != '3.6' && matrix.python-version != '3.9'
uses: neptune-ai/kedro-neptune/.github/actions/e2e@main
with:
working_directory: neptune_kedro
env:
NEPTUNE_API_TOKEN: ${{ secrets.E2E_NEPTUNE_API_TOKEN }}
NEPTUNE_PROJECT: e2e-tests/kedro-neptune-e2e
# - name: Test Kedro integration
# if: matrix.os == 'ubuntu-latest'
# uses: neptune-ai/kedro-neptune/.github/actions/e2e@main
# with:
# working_directory: neptune_kedro
# env:
# NEPTUNE_API_TOKEN: ${{ secrets.E2E_NEPTUNE_API_TOKEN }}
# NEPTUNE_PROJECT: e2e-tests/kedro-neptune-e2e

notify:
needs: [lint, test]
Expand Down Expand Up @@ -130,7 +125,7 @@ jobs:
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"

- name: Build and test
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.6, 3.9] # minimum, maximum
python-version: ["3.7", "3.10"] # minimum, maximum
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion neptune/internal/threads/neptune_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class NeptuneThread(threading.Thread):
def __init__(self, is_daemon):
super(NeptuneThread, self).__init__(target=self.run)
self.setDaemon(is_daemon)
self.daemon = is_daemon
self._interrupted = threading.Event()

def should_continue_running(self):
Expand Down
2 changes: 1 addition & 1 deletion neptune/new/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ def __init__(self, matplotlib_version, plotly_version):
"Unable to convert plotly figure to matplotlib format. "
"Your matplotlib ({}) and plotlib ({}) versions are not compatible. "
"See https://stackoverflow.com/q/63120058 for details. "
"Downgrade matplotlib to version 3.2 or use as_image to log static chart.".format(
"Downgrade matplotlib to version 3.2, upgrade plotly to 5.0+ or use as_image to log static chart.".format(
matplotlib_version, plotly_version
)
)
Expand Down
2 changes: 1 addition & 1 deletion neptune/new/internal/disk_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def ack(self, version: int) -> None:

with self._empty_cond:
if self.is_empty():
self._empty_cond.notifyAll()
self._empty_cond.notify_all()

def is_empty(self) -> bool:
return self.size() == 0
Expand Down
4 changes: 3 additions & 1 deletion neptune/new/internal/utils/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ def _matplotlib_to_plotly(chart):
# Plotly can only import path collections linked to 'data' coordinates"
plotly_version = plotly.__version__
matplotlib_version = matplotlib.__version__
if version.parse(matplotlib_version) >= version.parse("3.3.0"):
if version.parse(matplotlib_version) >= version.parse("3.3.0") and version.parse(
plotly_version
) < version.parse("5.0.0"):
raise PlotlyIncompatibilityException(matplotlib_version, plotly_version)

with warnings.catch_warnings():
Expand Down
3 changes: 0 additions & 3 deletions requirements/e2e_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ pytest-tap
pytorch-lightning
torchvision
sklearn

# bugfixes
pillow==8.2.0 # https://forums.fast.ai/t/runtimeerror-could-not-infer-dtype-of-pilimage/89697, https://stackoverflow.com/a/68239032/1565454
7 changes: 4 additions & 3 deletions requirements/test_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ pylintfileheader
pytest
pytest-cov
pytest-xdist
tensorflow; python_version <= '3.9'
tensorflow
pytest-timeout
matplotlib==3.2
matplotlib
pytest-mock
moto[s3]
plotly
Expand All @@ -18,4 +18,5 @@ bokeh
pre-commit

# Installing Torch on Windows increases the test duration by ~10 minutes
torch; platform_system != 'Windows' and python_version <= '3.9'
# torch seems to be unavailable for 3.10 on Mac (as of 2022-04-06)
torch; platform_system != 'Windows' and (platform_system != 'Darwin' or python_version < "3.10")
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def main():
requirements = [r.strip() for r in f]
setup(
name="neptune-client",
python_requires=">=3.6.0",
python_requires=">=3.7.0",
version=versioneer.get_version(),
description="Neptune Client",
author="neptune.ai",
Expand Down
7 changes: 6 additions & 1 deletion tests/neptune/internal/utils/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
# limitations under the License.
#
import os
import sys
import unittest

import matplotlib

from neptune.utils import IS_WINDOWS
from neptune.utils import IS_WINDOWS, IS_MACOS

matplotlib.use("agg")
from matplotlib import pyplot
Expand Down Expand Up @@ -122,6 +123,10 @@ def test_get_image_content_from_figure(self):
self.assertEqual(get_image_content(figure), _get_figure_as_image(figure))

@unittest.skipIf(IS_WINDOWS, "Installing Torch on Windows takes too long")
@unittest.skipIf(
IS_MACOS and sys.version_info.major == 3 and sys.version_info.minor == 10,
"No torch for 3.10 on Mac",
)
def test_get_image_content_from_torch_tensor(self):
import torch # pylint: disable=C0415

Expand Down
7 changes: 6 additions & 1 deletion tests/neptune/new/internal/utils/test_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import contextlib
import io
import os
import sys
import unittest
from typing import Optional
from unittest import mock
Expand All @@ -37,7 +38,7 @@
import numpy

from neptune.new.internal.utils.images import get_image_content, get_html_content
from neptune.utils import IS_WINDOWS
from neptune.utils import IS_WINDOWS, IS_MACOS

matplotlib.use("agg")

Expand Down Expand Up @@ -127,6 +128,10 @@ def test_get_image_content_from_figure(self):
self.assertEqual(get_image_content(fig), self._encode_figure(fig))

@unittest.skipIf(IS_WINDOWS, "Installing Torch on Windows takes too long")
@unittest.skipIf(
IS_MACOS and sys.version_info.major == 3 and sys.version_info.minor == 10,
"No torch for 3.10 on Mac",
)
def test_get_image_content_from_torch_tensor(self):
import torch # pylint: disable=C0415

Expand Down