Skip to content

Parent directory isn't available on pip install (e.g. to determine version with setuptools-scm) #4180

@tuukkamustonen

Description

@tuukkamustonen
  • Pip version: 19.2.3, 19.2.3
  • Python version: 2.7, 3.5.5
  • Operating System: Ubuntu 14.04, Ubuntu 18.04

Description:

When using setuptools-scm in a git sub-directory, version detection mechanism fails.

With GIT_REPO/subdir/requirements.txt:

.

With GIT_REPO/subdir/setup.py:

from setuptools import setup, find_packages
from setuptools_scm import get_version

setup(
    name='pastry-auth',
    version=get_version(root='..', relative_to=__file__),
)

Executing pip install -r requirements.txt in GIT_REPO/subdir, pip copies GIT_REPO/subdir to /tmp/pip-<hash>-build/ and so when setuptools-scm attempts to determine the version of parent directory (root='..' declaration), it then looks up /tmp, which doesn't have the repository information, and fails.

I faced this in pypa/setuptools-scm#138. It prevents setuptools_scm from detecting git version when you hold multiple components in one git repository (in sub-directories), when having . in requirements.txt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: vcspip's interaction with version control systems like git, svn and bzrauto-lockedOutdated issues that have been locked by automationstate: needs reproducerNeed to reproduce issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions