Reputation: 7827
I have two or more Python packages in one versioned folder:
.
├── .git
├── api
│ ├── mf_hub_api
│ │ └── __init__.py
│ └── setup.py
├── pkg
│ ├── mf_hub
│ │ └── __init__.py
│ └── setup.py
└── README.rst
From both ./api and pkg python package pip install -e .
work well but pip install .
give me the traceback:
mf_hub/pkg$ pip install .
Processing .../mf_hub/pkg
...
LookupError: setuptools-scm was unable to detect version for '/tmp'.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
My config.py
::
mf_hub$ cat pkg/setup.py
from setuptools import find_packages
from setuptools import setup
requirements = """
pip
setuptools
wheel
setuptools_scm
"""
setup(
name="mf_hub",
setup_requires=["setuptools_scm"],
use_scm_version={
"write_to": "../version.txt",
"root": "..",
"relative_to": __file__,
},
packages=find_packages(),
test_suite="tests",
install_requires=requirements,
include_package_data=True,
zip_safe=False,
)
mf_hub$
What could be a temporary workaround ?
I saw that there is an open issue related to that: https://github.com/pypa/setuptools_scm/issues/357
Upvotes: 4
Views: 9367
Reputation: 3274
You have to use in-tree-build
feature. It's enabled by default in newer pip releases. There are two solutions:
pip install -U pip
pip install .
pip install --use-feature=in-tree-build .
Upvotes: 1