diff --git a/glue_wwt/viewer/table_layer.py b/glue_wwt/viewer/table_layer.py index a8593ee4..34a41939 100644 --- a/glue_wwt/viewer/table_layer.py +++ b/glue_wwt/viewer/table_layer.py @@ -23,17 +23,18 @@ import pywwt from pywwt.layers import TableLayer -from distutils.version import LooseVersion -PYWWT_LT_06 = LooseVersion(pywwt.__version__) < '0.6' +from packaging.version import Version + +PYWWT_LT_06 = Version(pywwt.__version__) < Version('0.6') # 0.13 is the first version that uses the WWT research app as the JS backend -PYWWT_GE_013 = LooseVersion(pywwt.__version__) >= '0.13' +PYWWT_GE_013 = Version(pywwt.__version__) >= Version('0.13') # 0.9 is the first version that grabs the SDK from the WWT CDN -PYWWT_LT_09 = LooseVersion(pywwt.__version__) < '0.9' +PYWWT_LT_09 = Version(pywwt.__version__) < Version('0.9') # 0.15 is the first version with the updated engine -PYWWT_GE_015 = LooseVersion(pywwt.__version__) >= '0.15' +PYWWT_GE_015 = Version(pywwt.__version__) >= Version('0.15') __all__ = ['WWTTableLayerArtist'] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..00ddb97e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,54 @@ +[build-system] +requires = [ + "setuptools>=61.2", + "setuptools_scm", +] +build-backend = "setuptools.build_meta" + +[project] +name = "glue-wwt" +authors = [{name = "Thomas Robitaille", email = "thomas.robitaille@gmail.com"}] +license = {text = "BSD 3-Clause License"} +description = "Glue WorldWide Telescope plugin" +readme = "README.rst" +urls = {Homepage = "https://github.com/glue-viz/glue-wwt"} +requires-python = ">=3.8" +dependencies = [ + "numpy", + "glue-core>=1.13.1", + "echo", + "astropy", + "pywwt>=0.21.0", + "packaging", +] +dynamic = ["version"] + +[tool.setuptools_scm] + +[project.entry-points] +"glue.plugins" = {wwt = "glue_wwt:setup"} + +[project.optional-dependencies] +test = [ + "pytest", + "pytest-cov", + "mock", +] +qt = [ + "qtpy", + "glue-qt", + 'PyQt5;python_version>="3"', + 'PyQtWebEngine;python_version>="3"', +] + +[tool.setuptools] +zip-safe = false +license-files = ["LICENSE"] +include-package-data = false + +[tool.setuptools.packages] +find = {namespaces = false} + +[tool.setuptools.package-data] +"glue_wwt.viewer" = ["*.ui", "*.html", "*.js", "*.png"] +"glue_wwt.viewer.tests" = ["data/*.glu"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 47c80c46..00000000 --- a/setup.cfg +++ /dev/null @@ -1,40 +0,0 @@ -[metadata] -name = glue-wwt -author = Thomas Robitaille -author_email = thomas.robitaille@gmail.com -license = BSD 3-Clause License -license_file = LICENSE -url = https://github.com/glue-viz/glue-wwt -description = Glue WorldWide Telescope plugin -long_description = file: README.rst - -[options] -zip_safe = False -python_requires = >=3.8 -packages = find: -setup_requires = setuptools_scm -install_requires = - numpy - glue-core>=1.13.1 - echo - astropy - pywwt>=0.21.0 - -[options.package_data] -glue_wwt.viewer = *.ui, *.html, *.js, *.png -glue_wwt.viewer.tests = data/*.glu - -[options.entry_points] -glue.plugins = - wwt = glue_wwt:setup - -[options.extras_require] -test = - pytest - pytest-cov - mock -qt = - qtpy - glue-qt - PyQt5;python_version>="3" - PyQtWebEngine;python_version>="3" diff --git a/setup.py b/setup.py deleted file mode 100755 index 8d445604..00000000 --- a/setup.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python -from __future__ import print_function - -import sys -from distutils.version import LooseVersion - -try: - import setuptools - assert LooseVersion(setuptools.__version__) >= LooseVersion('30.3') -except (ImportError, AssertionError): - sys.stderr.write("ERROR: setuptools 30.3 or later is required\n") - sys.exit(1) - -from setuptools import setup - -setup(use_scm_version=True)