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

[Python][Dev] Source install yields unexpected keyword argument: 'version_file' #41992

Closed
WillAyd opened this issue Jun 5, 2024 · 4 comments
Closed

Comments

@WillAyd
Copy link
Contributor

WillAyd commented Jun 5, 2024

Describe the bug, including details regarding any error messages, version, and platform.

Seems to have started with #41041

$ python setup.py build_ext --inplace -j14
/home/willayd/clones/arrow/python/setup.py:34: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
Traceback (most recent call last):
  File "/home/willayd/clones/arrow/python/setup.py", line 372, in <module>
    setup(
  File "/home/willayd/mambaforge/envs/arrow-dev/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/willayd/mambaforge/envs/arrow-dev/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 147, in setup
    _setup_distribution = dist = klass(attrs)
                                 ^^^^^^^^^^^^
  File "/home/willayd/mambaforge/envs/arrow-dev/lib/python3.12/site-packages/setuptools/dist.py", line 303, in __init__
    _Distribution.__init__(self, dist_attrs)
  File "/home/willayd/mambaforge/envs/arrow-dev/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 283, in __init__
    self.finalize_options()
  File "/home/willayd/mambaforge/envs/arrow-dev/lib/python3.12/site-packages/setuptools/dist.py", line 654, in finalize_options
    ep(self)
  File "/home/willayd/mambaforge/envs/arrow-dev/lib/python3.12/site-packages/setuptools_scm/integration.py", line 123, in infer_version
    config = Configuration.from_file(dist_name=dist_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/willayd/mambaforge/envs/arrow-dev/lib/python3.12/site-packages/setuptools_scm/config.py", line 216, in from_file
    return cls(relative_to=name, **args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Configuration.__init__() got an unexpected keyword argument 'version_file'

Component(s)

Python

@assignUser
Copy link
Member

Thanks for the report!
Directly calling setup.py is deprecated and apparently no longer compatible with the recent changes, could you try python -m pip install .? (we probably need to update some docs too)

@WillAyd
Copy link
Contributor Author

WillAyd commented Jun 6, 2024

Ah simple enough - makes sense and yes that did work

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Jun 6, 2024

And to be clear, you can continue to use calling built_ext inplace directly (I also still do that, until we move away from setuptools, that is fine), you just need to ran the pip install -e . once before that works again (as you initially also did once, I assume).

@jorisvandenbossche jorisvandenbossche changed the title Python: Source install yields unexpected keyword argument: 'version_file' [Python][Dev] Source install yields unexpected keyword argument: 'version_file' Jun 6, 2024
@jorisvandenbossche
Copy link
Member

It's also quite likely that you see that error just because of having a too old setuptools_scm in your environment (that's the error I got in another env where I tried to build inplace with --no-build-isolation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants