diff --git a/ipyleaflet/_version.py b/ipyleaflet/_version.py index 66502f308..57ad7c4f6 100644 --- a/ipyleaflet/_version.py +++ b/ipyleaflet/_version.py @@ -4,6 +4,6 @@ version_info = (0, 17, 3) -__version__ = '%s.%s.%s' % (version_info[0], version_info[1], version_info[2]) +__version__ = '.'.join(map(str, version_info)) EXTENSION_VERSION = '^0.17' diff --git a/pyproject.toml b/pyproject.toml index fa729c7c8..d1b570e38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,47 @@ [build-system] -# avoid 3.6 so we don't need the rust buildchain -requires = ["jupyter_packaging~=0.12", "jupyterlab>=3.0.0,<3.6", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.12", "jupyterlab>=3.0.0,<3.6", "setuptools>=61.2", "wheel"] build-backend = "setuptools.build_meta" + +[project] +name = "ipyleaflet" +version = "0.17.3" +description = "A Jupyter widget for dynamic Leaflet maps" +keywords = ["ipython", "jupyter", "widgets", "graphics", "GIS"] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Topic :: Multimedia :: Graphics", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", +] +requires-python = ">=3.7" +dependencies = [ + "ipywidgets>=7.6.0,<9", + "traittypes>=0.2.1,<3", + "xyzservices>=2021.8.1", + "branca>=0.5.0", +] + +[[project.authors]] +name = "Project Jupyter" +email = "jupyter@googlegroups.com" + +[project.license] +text = "MIT" + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.urls] +Homepage = "https://github.com/jupyter-widgets/ipyleaflet" + +[tool.setuptools] +include-package-data = true +license-files = ["LICENSE"] +packages = ["ipyleaflet"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 0c9e0fc14..000000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -license_file = LICENSE diff --git a/setup.py b/setup.py index a17037ca6..378caf0a2 100644 --- a/setup.py +++ b/setup.py @@ -1,32 +1,16 @@ -# -*- coding: utf-8 -*- +from pathlib import Path +from setuptools import setup -import os -from setuptools import setup, find_packages +from jupyter_packaging import * -from jupyter_packaging import ( - create_cmdclass, - install_npm, - ensure_targets, - combine_commands, - get_version, - skip_if_exists -) - -# the name of the package -name = 'ipyleaflet' -long_description = 'A Jupyter widget for dynamic Leaflet maps' - -here = os.path.dirname(os.path.abspath(__file__)) +ROOT = Path(__file__).parent -# Get ipyleaflet version -version = get_version(os.path.join(name, '_version.py')) - -js_dir = os.path.join(here, 'js') +js_dir = ROOT / 'js' # Representative files that should exist after a successful build jstargets = [ - os.path.join('ipyleaflet/nbextension', 'index.js'), - os.path.join('ipyleaflet/labextension', 'package.json'), + str(Path('ipyleaflet/nbextension')/'index.js'), + str(Path('ipyleaflet/labextension')/'package.json'), ] data_files_spec = [ @@ -37,48 +21,11 @@ cmdclass = create_cmdclass('jsdeps', data_files_spec=data_files_spec) js_command = combine_commands( - install_npm(js_dir, npm=["yarn"], build_cmd='build'), ensure_targets(jstargets), + install_npm(js_dir, npm=["yarn"], build_cmd='build'), + ensure_targets(jstargets), ) -is_repo = os.path.exists(os.path.join(here, '.git')) -if is_repo: - cmdclass['jsdeps'] = js_command -else: - cmdclass['jsdeps'] = skip_if_exists(jstargets, js_command) - -setup_args = dict( - name=name, - version=version, - description='A Jupyter widget for dynamic Leaflet maps', - long_description=long_description, - license='MIT License', - python_requires = ">=3.7", - include_package_data=True, - install_requires=[ - 'ipywidgets>=7.6.0,<9', - 'traittypes>=0.2.1,<3', - 'xyzservices>=2021.8.1', - 'branca>=0.5.0' - ], - packages=find_packages(), - zip_safe=False, - cmdclass=cmdclass, - author='Project Jupyter', - author_email='jupyter@googlegroups.com', - url='https://github.com/jupyter-widgets/ipyleaflet', - keywords=['ipython', 'jupyter', 'widgets', 'graphics', 'GIS'], - classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'Intended Audience :: Science/Research', - 'Topic :: Multimedia :: Graphics', - 'License :: OSI Approved :: MIT License', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10' - ], -) +is_repo = (ROOT / '.git').exists() +cmdclass['jsdeps'] = js_command if is_repo else skip_if_exists(jstargets, js_command) -setup(**setup_args) +setup(cmdclass=cmdclass)