question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SpecifierSet has no attribute split

See original GitHub issue

Running the tests on cheroot, I’m seeing this error:

  Installing backend dependencies: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /Users/jaraco/code/public/cherrypy/cheroot/.tox/python/bin/python /Users/jaraco/code/public/cherrypy/cheroot/.tox/python/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/tmpkxgh82j6
         cwd: /Users/jaraco/code/public/cherrypy/cheroot
    Complete output (28 lines):
    Traceback (most recent call last):
      File "/Users/jaraco/code/public/cherrypy/cheroot/.tox/python/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
        main()
      File "/Users/jaraco/code/public/cherrypy/cheroot/.tox/python/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/Users/jaraco/code/public/cherrypy/cheroot/.tox/python/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 69, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-2krlo7y7/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 156, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-2krlo7y7/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 142, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 138, in <module>
        __name__ == '__main__' and setuptools.setup(**setup_params)
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-2krlo7y7/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-2krlo7y7/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 446, in __init__
        _Distribution.__init__(self, {
      File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 292, in __init__
        self.finalize_options()
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-2krlo7y7/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 735, in finalize_options
        ep.load()(self, ep.name, value)
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-2krlo7y7/overlay/lib/python3.8/site-packages/setuptools/dist.py", line 291, in check_specifier
        packaging.specifiers.SpecifierSet(value)
      File "/private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-build-env-2krlo7y7/overlay/lib/python3.8/site-packages/setuptools/_vendor/packaging/specifiers.py", line 594, in __init__
        specifiers = [s.strip() for s in specifiers.split(",") if s.strip()]
    AttributeError: 'SpecifierSet' object has no attribute 'split'

I suspect this issue is brought about by #1847, and what’s happening is the declarative config python_requires is transforming the value and later the value is parsed again. This code illustrates how the same error is elicited by a double construction:

>>> packaging.specifiers.SpecifierSet(packaging.specifiers.SpecifierSet('>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jaraco/code/public/pypa/setuptools/setuptools/_vendor/packaging/specifiers.py", line 594, in __init__
    specifiers = [s.strip() for s in specifiers.split(",") if s.strip()]
AttributeError: 'SpecifierSet' object has no attribute 'split'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
jaracocommented, Oct 16, 2019

Indeed, I’m extremely reluctant to support projects that wish to read declarative config on their own. I suggest if you wish to continue to read declarative config and pass it into setup(), then you’ll need to support that interface and (conditionally) normalize any contents before passing into setup(). Maybe it makes sense for setuptools to support accepting a SpecifierSet for python_requires. I’d probably accept a patch for that, though I’d say it is something of a feature request.

0reactions
webknjazcommented, Oct 16, 2019

@ssbarnea it only breaks hacks

Read more comments on GitHub >

github_iconTop Results From Across the Web

698864 – app-admin/ansible-lint-4.0.1 : AttributeError
... 'SpecifierSet' object has no attribute 'split' * ERROR: app-admin/ansible-lint-4.0.1::gentoo failed (compile phase): * (no error ...
Read more >
#59297 (py36-astor: AttributeError: 'SpecifierSet' object has no ...
Summary: py36-astor fails to build on macOS 10.15 Catalina → py36-astor: AttributeError: 'SpecifierSet' object has no attribute 'split' ...
Read more >
'NoneType' object has no attribute 'split' building a client for an ...
str = str.split(",") AttributeError: 'NoneType' object has no attribute 'split' building a client for an online game running into this error.
Read more >
1794279 – python-molecule fails to build in Fedora 32
python-molecule fails to build with Python 3.9.0a2. ... AttributeError: 'SpecifierSet' object has no attribute 'split' To my best knowledge, ...
Read more >
Python attributeerror: 'list' object has no attribute 'split' Solution
On Career Karma, learn about the Python attributeerror: 'list' object has no attribute 'split', how the error works, and how to solve the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found