Skip to content

LookupError: setuptools-scm was unable to detect version for '/tmp' #357

Open
@radugrosu

Description

@radugrosu

I'm using the following namespace-package structure (the namespace is in this example nametest):

root
├── name-common
│   ├── nametest
│   │   ├── metrics.py
│   │   └── utils.py
│   ├── requirements.txt
│   └── setup.py
├── name-serve
│   ├── nametest
│   │   └── serve
│   │       ├── __init__.py
│   │       └── selector.py
│   ├── requirements.txt
│   └── setup.py
└── setup.py

The full error message when doing pip install . in any of name-common or name-serve is:

    ERROR: Command errored out with exit status 1:
     command: /home/radu/bin/anaconda3/envs/aimtest/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-cx0dk49_/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-cx0dk49_/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /tmp/pip-req-build-cx0dk49_/
    Complete output (25 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-cx0dk49_/setup.py", line 11, in <module>
        packages=find_namespace_packages(include=['nametest.*'], exclude=['tests']),
      File "/home/radu/bin/anaconda3/envs/aimtest/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "/home/radu/bin/anaconda3/envs/aimtest/lib/python3.6/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/home/radu/bin/anaconda3/envs/aimtest/lib/python3.6/site-packages/setuptools/dist.py", line 446, in __init__
        k: v for k, v in attrs.items()
      File "/home/radu/bin/anaconda3/envs/aimtest/lib/python3.6/distutils/dist.py", line 281, in __init__
        self.finalize_options()
      File "/home/radu/bin/anaconda3/envs/aimtest/lib/python3.6/site-packages/setuptools/dist.py", line 734, in finalize_options
        ep.load()(self, ep.name, value)
      File "/home/radu/bin/anaconda3/envs/aimtest/lib/python3.6/site-packages/setuptools_scm/integration.py", line 17, in version_keyword
        dist.metadata.version = get_version(**value)
      File "/home/radu/bin/anaconda3/envs/aimtest/lib/python3.6/site-packages/setuptools_scm/__init__.py", line 150, in get_version
        parsed_version = _do_parse(config)
      File "/home/radu/bin/anaconda3/envs/aimtest/lib/python3.6/site-packages/setuptools_scm/__init__.py", line 113, in _do_parse
        "use git+https://github.com/user/proj.git#egg=proj" % config.absolute_root
    LookupError: setuptools-scm was unable to detect version for '/tmp'.
    
    Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.
    
    For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

The contents of setup.py are:

from setuptools import setup, find_namespace_packages


setup(
    name='name.common',
    use_scm_version={"root": "..", "relative_to": __file__},
    setup_requires=['setuptools_scm'],
    packages=find_namespace_packages(include=['nametest.*'], exclude=['tests']),
)

When running pip install -e . everything works fine.
I'm not sure how to get around this, would appreciate any input. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions