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

Consider adding support for extras_require #76

Closed
wiseaidev opened this issue Feb 19, 2022 · 6 comments
Closed

Consider adding support for extras_require #76

wiseaidev opened this issue Feb 19, 2022 · 6 comments

Comments

@wiseaidev
Copy link

This project is kinda cool. Unfortunately, the current version doesn't support the extras_require section. Apparently, the most extreme case is ethereum/web3.py#2355 where dev depends upon previously defined directives(tester, linter, docs).

Syntax for extras_require is documented here.

@asottile
Copy link
Owner

works fine for me:

from setuptools import setup

setup(
    name='wat',
    extras_require={
        'foo': ['cfgv'],
        'bar': ['astpretty', 'pyupgrade'],
    },
)
$ setup-py-upgrade .
./setup.py and ./setup.cfg written!
[metadata]
name = wat

[options.extras_require]
foo = cfgv
bar =
    astpretty
    pyupgrade

@wiseaidev
Copy link
Author

wiseaidev commented Feb 19, 2022

@asottile Ummm, you are right. However, it doesn't support explicitly changing this section. Take the following as an example:

from setuptools import setup

extra_requires = {
        'foo': ['cfgv'],
        'bar': ['astpretty', 'pyupgrade'],
}

extra_requires['bar'] += extra_requires['foo']

setup(
    name='wat',
    extras_require=extra_requires,
)
$ setup-py-upgrade .

Traceback (most recent call last):
  File ".venv/bin/setup-py-upgrade", line 8, in <module>
    sys.exit(main())
    visitor.visit(tree)
  File "/usr/lib/python3.8/ast.py", line 371, in visit
    return visitor(node)
  File "/usr/lib/python3.8/ast.py", line 379, in generic_visit
    self.visit(item)
  File "/usr/lib/python3.8/ast.py", line 371, in visit
    return visitor(node)
  File "/usr/lib/python3.8/ast.py", line 381, in generic_visit
    self.visit(value)
  File "/usr/lib/python3.8/ast.py", line 371, in visit
    return visitor(node)
  File ".venv/lib/python3.8/site-packages/setup_py_upgrade.py", line 128, in visit_Call
    raise NotImplementedError(f'unparsable: {kwd.arg}=')
NotImplementedError: unparsable: extras_require=

@asottile
Copy link
Owner

yeah it cannot solve the halting problem -- your code needs to be identifiable statically

@wiseaidev
Copy link
Author

Got it! I think It would be great to add support for this dynamic case.

@asottile
Copy link
Owner

the halting problem is unsolvable

@wiseaidev
Copy link
Author

... by any Turing machine. However, I think we, as human species, are not able to determine whether or not a given Turing machine will halt...

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