1- # -*- coding: utf-8 -*-
2-
3- import os
4- from setuptools import setup , find_packages
5-
6- from jupyter_packaging import (
7- create_cmdclass ,
8- install_npm ,
9- ensure_targets ,
10- combine_commands ,
11- get_version ,
12- skip_if_exists ,
13- )
14-
15- # the name of the package
16- name = "ipyleaflet"
17- long_description = "A Jupyter widget for dynamic Leaflet maps"
18-
19- here = os .path .dirname (os .path .abspath (__file__ ))
20-
21- # Get ipyleaflet version
22- version = get_version (os .path .join (name , "_version.py" ))
23-
24- js_dir = os .path .join (here , "js" )
25-
26- # Representative files that should exist after a successful build
27- jstargets = [
28- os .path .join ("ipyleaflet/nbextension" , "index.js" ),
29- os .path .join ("ipyleaflet/labextension" , "package.json" ),
30- ]
31-
32- data_files_spec = [
33- ("share/jupyter/nbextensions/jupyter-leaflet" , "ipyleaflet/nbextension" , "*.*" ),
34- ("share/jupyter/labextensions/jupyter-leaflet" , "ipyleaflet/labextension" , "**" ),
35- ("etc/jupyter/nbconfig/notebook.d" , "." , "jupyter-leaflet.json" ),
36- ]
37-
38- cmdclass = create_cmdclass ("jsdeps" , data_files_spec = data_files_spec )
39- js_command = combine_commands (
40- install_npm (js_dir , npm = ["yarn" ], build_cmd = "build" ),
41- ensure_targets (jstargets ),
42- )
43-
44- is_repo = os .path .exists (os .path .join (here , ".git" ))
45- if is_repo :
46- cmdclass ["jsdeps" ] = js_command
47- else :
48- cmdclass ["jsdeps" ] = skip_if_exists (jstargets , js_command )
49-
50- setup_args = dict (
51- name = name ,
52- version = version ,
53- description = "A Jupyter widget for dynamic Leaflet maps" ,
54- long_description = long_description ,
55- license = "MIT License" ,
56- python_requires = ">=3.7" ,
57- include_package_data = True ,
58- install_requires = [
59- "ipywidgets>=7.6.0,<9" ,
60- "traittypes>=0.2.1,<3" ,
61- "xyzservices>=2021.8.1" ,
62- "branca>=0.5.0" ,
63- ],
64- packages = find_packages (),
65- zip_safe = False ,
66- cmdclass = cmdclass ,
67- author = "Project Jupyter" ,
68- author_email = "jupyter@googlegroups.com" ,
69- url = "https://github.com/jupyter-widgets/ipyleaflet" ,
70- keywords = ["ipython" , "jupyter" , "widgets" , "graphics" , "GIS" ],
71- classifiers = [
72- "Development Status :: 4 - Beta" ,
73- "Intended Audience :: Developers" ,
74- "Intended Audience :: Science/Research" ,
75- "Topic :: Multimedia :: Graphics" ,
76- "License :: OSI Approved :: MIT License" ,
77- "Programming Language :: Python :: 3" ,
78- "Programming Language :: Python :: 3.7" ,
79- "Programming Language :: Python :: 3.8" ,
80- "Programming Language :: Python :: 3.9" ,
81- "Programming Language :: Python :: 3.10" ,
82- ],
83- )
84-
85- setup (** setup_args )
1+ # Copyright (c) Jupyter Development Team.
2+ __import__ ("setuptools" ).setup ()
0 commit comments