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

Doesn't support variables for metadata values in setup.py #74

Closed
jmao-denver opened this issue Jan 18, 2022 · 3 comments
Closed

Doesn't support variables for metadata values in setup.py #74

jmao-denver opened this issue Jan 18, 2022 · 3 comments

Comments

@jmao-denver
Copy link

This is a simplified version of the setup.py used for our Python package. We'd like to move to the declarative metadata based packaging approach. I tried this tool after watching Anthony's Youtube video on this very topic. The problem I ran into seems minor but I don't have the capacity to debug it at the moment.

#
#  Copyright (c) 2016-2021 Deephaven Data Labs and Patent Pending
#
import os
import pathlib
from setuptools.extern import packaging
from setuptools import find_packages, setup

dh_version = os.environ['DEEPHAVEN_VERSION']

setup(name='deephaven',
      version=dh_version,
      packages=find_packages(exclude=("tests",)),
      url='https://deephaven.io/',
      author='Deephaven Data Labs',
      author_email='python@deephaven.io',
      license='Deephaven Community License',
      test_loader='unittest:TestLoader',
      classifiers=[
          'Development Status :: 2 - Pre-Alpha',
          'Intended Audience :: Developers, Data Scientists',
          'Topic :: Software Development :: Build Tools',
          'License :: Other/Proprietary License',
          'Programming Language :: Python :: 3.7',
      ],
      keywords='Deephaven Development'
      )

will except out:

/tmp setup-py-upgrade .
Traceback (most recent call last):
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/site-packages/setup_py_upgrade.py", line 126, in visit_Call
    value = ast.literal_eval(kwd.value)
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/ast.py", line 91, in literal_eval
    return _convert(node_or_string)
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/ast.py", line 90, in _convert
    return _convert_signed_num(node)
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/ast.py", line 63, in _convert_signed_num
    return _convert_num(node)
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/ast.py", line 55, in _convert_num
    raise ValueError('malformed node or string: ' + repr(node))
ValueError: malformed node or string: <_ast.Name object at 0x10505c1d0>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/bin/setup-py-upgrade", line 8, in <module>
    sys.exit(main())
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/site-packages/setup_py_upgrade.py", line 168, in main
    visitor.visit(tree)
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/ast.py", line 271, in visit
    return visitor(node)
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/ast.py", line 279, in generic_visit
    self.visit(item)
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/ast.py", line 271, in visit
    return visitor(node)
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/ast.py", line 281, in generic_visit
    self.visit(value)
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/ast.py", line 271, in visit
    return visitor(node)
  File "/Users/jianfengmao/.pyenv/versions/3.7.10/lib/python3.7/site-packages/setup_py_upgrade.py", line 128, in visit_Call
    raise NotImplementedError(f'unparsable: {kwd.arg}=')
NotImplementedError: unparsable: version=
@asottile
Copy link
Owner

asottile commented Jan 18, 2022

intentionally, what you're asking it to do is impossible

https://github.com/asottile/setup-py-upgrade#what-is-not-supported

@asottile
Copy link
Owner

see also #7 #16

@jmao-denver
Copy link
Author

thanks, should have searched in the closed issues first 😄

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