diff --git a/.github/workflows/check-min-numpy.yaml b/.github/workflows/check-min-numpy.yaml new file mode 100644 index 00000000..62e90e1a --- /dev/null +++ b/.github/workflows/check-min-numpy.yaml @@ -0,0 +1,35 @@ +name: Run tests + +on: [pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9] + + steps: + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - uses: actions/checkout@v3 + - name: Install osmesa + run: | + sudo apt-get update && sudo apt-get upgrade + sudo apt-get install libosmesa6-dev + - name: Upgrade pip + run: python -m pip install --upgrade pip + - name: Setup yt_idv + run: python -m pip install -e .[test,minimal] + - name: Run Tests + env: + PYOPENGL_PLATFORM: osmesa + run: pytest --html=report.html --self-contained-html + - uses: actions/upload-artifact@v3 + name: Upload pytest report + with: + name: pytest-report + path: report.html diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 37b3851e..3105fe63 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,8 @@ repos: - id: setup-cfg-fmt args: [ --include-version-classifiers, - --max-py-version=3.10, + --max-py-version=3.11, + --min-py-version=3.9, ] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 diff --git a/pyproject.toml b/pyproject.toml index 0e2394ad..025de98e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,17 @@ [build-system] requires = [ - "setuptools >= 19.6", + "setuptools >= 61.2", "wheel >= 0.36.2", - "Cython >= 0.29.21, < 3.0", - "oldest-supported-numpy", + "Cython>=3.0.3", + "numpy>=2.0.0", ] [tool.black] line-length = 88 target-version = [ - 'py36', - 'py37', - 'py38', + 'py39', + 'py310', + 'py311', ] include = '\.pyi?$' exclude = ''' diff --git a/setup.cfg b/setup.cfg index 5d9f3524..f1f042bb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,9 +16,9 @@ classifiers = Natural Language :: English Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 Programming Language :: Python :: Implementation :: CPython keywords = yt_idv @@ -35,7 +35,7 @@ install_requires = traitlets>=5.0.5 traittypes>=0.2.1 yt>=4.1.0 -python_requires = >=3.8 +python_requires = >=3.9 include_package_data = True zip_safe = False @@ -53,8 +53,9 @@ dev = Sphinx==1.8.5 twine==1.14.0 wheel==0.33.6 +minimal = + numpy<2.0 test = - PyOpenGL-accelerate pytest>=6.2.4 pytest-html diff --git a/yt_idv/cameras/trackball_camera.py b/yt_idv/cameras/trackball_camera.py index c62dd238..aae1d1ff 100644 --- a/yt_idv/cameras/trackball_camera.py +++ b/yt_idv/cameras/trackball_camera.py @@ -52,7 +52,7 @@ def _map_to_surface(self, mouse_x, mouse_y): def update_orientation(self, start_x, start_y, end_x, end_y): self.orientation = update_orientation( - self.orientation, start_x, start_y, end_x, end_y + self.orientation.astype("float64"), start_x, start_y, end_x, end_y ) rotation_matrix = quaternion_to_rotation_matrix(self.orientation)