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

Symlink pathspec_meta.py breaks Windows #53

Closed
jayvdb opened this issue Oct 29, 2021 · 1 comment
Closed

Symlink pathspec_meta.py breaks Windows #53

jayvdb opened this issue Oct 29, 2021 · 1 comment

Comments

@jayvdb
Copy link

jayvdb commented Oct 29, 2021

setup.cfg refers to https://github.com/cpburnz/python-path-specification/blob/master/pathspec_meta.py with

version: attr: pathspec_meta.__version__

On a git checkout on Windows, unless git config core.symlinks was enabled explicitly, the following occurs when trying to install the package.

Traceback (most recent call last):
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\site-packages\setuptools\config.py", line 40, in __getattr__
    for statement in self.module.body
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\site-packages\setuptools\config.py", line 391, in _parse_attr
    return getattr(StaticModule(module_name), attr_name)
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\site-packages\setuptools\config.py", line 47, in __getattr__
    "{self.name} has no attribute {attr}".format(**locals()))
AttributeError: pathspec_meta has no attribute __version__

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    setup()
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\site-packages\setuptools\__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\distutils\core.py", line 121, in setup
    dist.parse_config_files()
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\site-packages\setuptools\dist.py", line 690, in parse_config_files
    ignore_option_errors=ignore_option_errors)
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\site-packages\setuptools\config.py", line 161, in parse_configuration
    meta.parse()
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\site-packages\setuptools\config.py", line 467, in parse
    section_parser_method(section_options)
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\site-packages\setuptools\config.py", line 440, in parse_section
    self[name] = value
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\site-packages\setuptools\config.py", line 224, in __setitem__
    value = parser(value)
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\site-packages\setuptools\config.py", line 556, in _parse_version
    version = self._parse_attr(value, self.package_dir)
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\site-packages\setuptools\config.py", line 394, in _parse_attr
    module = importlib.import_module(module_name)
  File "C:\Users\vandjohn\Downloads\WPy64-3771\python-3.7.7.amd64\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\vandjohn\gh\python-path-specification\pathspec_meta.py", line 1, in <module>
    pathspec/_meta.py
NameError: name 'pathspec' is not defined

Using the following in setup.cfg works for me, but I suspect there was some problem with this (possibly a setuptools issue?) which the symlink was intended to workaround.

version: attr: pathspec._meta.__version__
@cpburnz
Copy link
Owner

cpburnz commented Aug 13, 2022

This is fixed and will be in v0.10.0 when it is released.

@cpburnz cpburnz closed this as completed Aug 13, 2022
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