Giter VIP home page Giter VIP logo

Comments (6)

asottile avatar asottile commented on August 18, 2024

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

from setup-py-upgrade.

wiseaidev avatar wiseaidev commented on August 18, 2024

@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=

from setup-py-upgrade.

asottile avatar asottile commented on August 18, 2024

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

from setup-py-upgrade.

wiseaidev avatar wiseaidev commented on August 18, 2024

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

from setup-py-upgrade.

asottile avatar asottile commented on August 18, 2024

the halting problem is unsolvable

from setup-py-upgrade.

wiseaidev avatar wiseaidev commented on August 18, 2024

... 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...

from setup-py-upgrade.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.