Skip to content

"subdirectory" argument ignored #7575

@oyvinev

Description

@oyvinev
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.
Using virtualenv: /home/oyvinev/.cache/pypoetry/virtualenvs/gpbuilder-rFATLHJD-py3.8
Installing dependencies from lock file

Finding the necessary packages for the current system

Package operations: 1 install, 0 updates, 0 removals, 1 skipped

  • Installing numpy (1.16.6): Pending...
  • Installing numpy (1.16.6): Skipped for the following reason: Already installed
  • Installing pyd4 (0.3.6.2 39001f4): Pending...
  • Installing pyd4 (0.3.6.2 39001f4): Cloning...
  • Installing pyd4 (0.3.6.2 39001f4): Building...
  • Installing pyd4 (0.3.6.2 39001f4): Preparing...
  • Installing pyd4 (0.3.6.2 39001f4): Failed

  Stack trace:

  10  ~/.local/lib/python3.8/site-packages/poetry/installation/executor.py:271 in _execute_operation
       269│ 
       270│             try:
     → 271│                 result = self._do_execute_operation(operation)
       272│             except EnvCommandError as e:
       273│                 if e.e.returncode == -2:

   9  ~/.local/lib/python3.8/site-packages/poetry/installation/executor.py:357 in _do_execute_operation
       355│             return 0
       356│ 
     → 357│         result: int = getattr(self, f"_execute_{method}")(operation)
       358│ 
       359│         if result != 0:

   8  ~/.local/lib/python3.8/site-packages/poetry/installation/executor.py:477 in _execute_install
       475│ 
       476│     def _execute_install(self, operation: Install | Update) -> int:
     → 477│         status_code = self._install(operation)
       478│ 
       479│         self._save_url_reference(operation)

   7  ~/.local/lib/python3.8/site-packages/poetry/installation/executor.py:504 in _install
       502│         cleanup_archive: bool = False
       503│         if package.source_type == "git":
     → 504│             archive = self._prepare_git_archive(operation)
       505│             cleanup_archive = True
       506│         elif package.source_type == "file":

   6  ~/.local/lib/python3.8/site-packages/poetry/installation/executor.py:622 in _prepare_git_archive
       620│         package._source_url = str(source.path)
       621│ 
     → 622│         archive = self._prepare_directory_archive(operation)
       623│ 
       624│         package._source_url = original_url

   5  ~/.local/lib/python3.8/site-packages/poetry/installation/executor.py:598 in _prepare_directory_archive
       596│             req /= package.source_subdirectory
       597│ 
     → 598│         return self._prepare_archive(operation)
       599│ 
       600│     def _prepare_git_archive(self, operation: Install | Update) -> Path:

   4  ~/.local/lib/python3.8/site-packages/poetry/installation/executor.py:577 in _prepare_archive
       575│         self._populate_hashes_dict(archive, package)
       576│ 
     → 577│         return self._chef.prepare(archive, editable=package.develop)
       578│ 
       579│     def _prepare_directory_archive(self, operation: Install | Update) -> Path:

   3  ~/.local/lib/python3.8/site-packages/poetry/installation/chef.py:105 in prepare
       103│             tmp_dir = tempfile.mkdtemp(prefix="poetry-chef-")
       104│ 
     → 105│             return self._prepare(archive, Path(tmp_dir), editable=editable)
       106│ 
       107│         return self._prepare_sdist(archive, destination=output_dir)

   2  ~/.local/lib/python3.8/site-packages/poetry/installation/chef.py:116 in _prepare
       114│         with ephemeral_environment(self._env.python) as venv:
       115│             env = IsolatedEnv(venv, self._pool)
     → 116│             builder = ProjectBuilder(
       117│                 directory,
       118│                 python_executable=env.executable,

   1  ~/.local/lib/python3.8/site-packages/build/__init__.py:267 in __init__
       265│         """
       266│         self._srcdir: str = os.path.abspath(srcdir)
     → 267│         _validate_source_directory(srcdir)
       268│ 
       269│         spec_file = os.path.join(srcdir, 'pyproject.toml')

  BuildException

  Source /home/oyvinev/.cache/pypoetry/virtualenvs/gpbuilder-rFATLHJD-py3.8/src/d4-format does not appear to be a Python project: no pyproject.toml or setup.py

  at ~/.local/lib/python3.8/site-packages/build/__init__.py:135 in _validate_source_directory
      131│         raise BuildException(f'Source {srcdir} is not a directory')
      132│     pyproject_toml = os.path.join(srcdir, 'pyproject.toml')
      133│     setup_py = os.path.join(srcdir, 'setup.py')
      134│     if not os.path.exists(pyproject_toml) and not os.path.exists(setup_py):
    → 135│         raise BuildException(f'Source {srcdir} does not appear to be a Python project: no pyproject.toml or setup.py')
      136│ 
      137│ 
      138│ def check_dependency(
      139│     req_string: str, ancestral_req_strings: tuple[str, ...] = (), parent_extras: Set[str] = frozenset()

Issue

"subdirectory" seems to be ignored (at least in this specific case). I've verified that it builds on 1.3.2, but fails with 1.4.0.

Expected behaviour: It should enter the subdirectory pyd4 under src/d4-format

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/installerRelated to the dependency installerkind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions