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

update packaging #1131

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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 ipyleaflet/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
47 changes: 45 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]"

[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"]
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

77 changes: 12 additions & 65 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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 = [
Expand All @@ -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='[email protected]',
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)