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

support entry_points passed as a string #116

Closed
graingert opened this issue Mar 8, 2023 · 1 comment
Closed

support entry_points passed as a string #116

graingert opened this issue Mar 8, 2023 · 1 comment

Comments

@graingert
Copy link
Contributor

graingert commented Mar 8, 2023

example setup.py:

#!/usr/bin/env python

from __future__ import annotations

import os

from setuptools import find_packages, setup

setup(
    name="distributed",
    version="0.0.0",
    description="Distributed scheduler for Dask",
    url="https://distributed.dask.org",
    project_urls={
        "Source": "https://github.com/dask/distributed",
    },
    maintainer="Matthew Rocklin",
    maintainer_email="mrocklin@gmail.com",
    python_requires=">=3.8",
    license="BSD",
    package_data={
        "": ["templates/index.html", "template.html"],
        "distributed": ["http/templates/*.html", "py.typed"],
    },
    include_package_data=True,
    install_requires=[],
    packages=find_packages(exclude=["*tests*"]),
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Developers",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: BSD License",
        "Operating System :: OS Independent",
        "Programming Language :: Python",
        "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",
        "Topic :: Scientific/Engineering",
        "Topic :: System :: Distributed Computing",
    ],
    entry_points="""
        [console_scripts]
        dask-ssh=distributed.cli.dask_ssh:main
        dask-scheduler=distributed.cli.dask_scheduler:main
        dask-worker=distributed.cli.dask_worker:main
        [dask_cli]
        scheduler=distributed.cli.dask_scheduler:main
        worker=distributed.cli.dask_worker:main
        ssh=distributed.cli.dask_ssh:main
        spec=distributed.cli.dask_spec:main
      """,
    # https://mypy.readthedocs.io/en/latest/installed_packages.html
    zip_safe=False,
)

results in:

Traceback (most recent call last):
  File "/home/graingert/.local/pipx/.cache/f9e756ed0e98ae6/bin/setup-py-upgrade", line 8, in <module>
    sys.exit(main())
  File "/home/graingert/.local/pipx/.cache/f9e756ed0e98ae6/lib/python3.10/site-packages/setup_py_upgrade.py", line 182, in main
    sections = {k: _reformat(v) for k, v in visitor.sections.items() if v}
  File "/home/graingert/.local/pipx/.cache/f9e756ed0e98ae6/lib/python3.10/site-packages/setup_py_upgrade.py", line 182, in <dictcomp>
    sections = {k: _reformat(v) for k, v in visitor.sections.items() if v}
  File "/home/graingert/.local/pipx/.cache/f9e756ed0e98ae6/lib/python3.10/site-packages/setup_py_upgrade.py", line 148, in _reformat
    for key, value in section.items():
AttributeError: 'str' object has no attribute 'items'
@asottile
Copy link
Owner

asottile commented Mar 8, 2023

this is undocumented in setuptools -- I'd rather stick to the convention that's documented

@asottile asottile closed this as completed Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants