Skip to content

Including tests dir in sdist breaks install #2353

@TheErk

Description

@TheErk
  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Linux Debian Stretch

  • Poetry version: 1.0.2

  • Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/TheErk/21ebdae3b0a22a492c05bbacc495ebd0

Issue

I have a project whose structure is:

sdist-issue/
├── poetry.lock
├── pyproject.toml
├── README.rst
├── src
│   └── sdist_issue
│       └── __init__.py
└── tests
    ├── __init__.py
    └── test_sdist_issue.py

I want tp include the 'sdist-issue/tests' directory in my source distribution.
But when I use:

packages = [
    { include = "sdist_issue", from = "src" },
    { include = "tests", format = "sdist" }
]

poetry build works as expected while poetry install fails:

$ poetry install -vvv

[EnvCommandError]
Command ['/home/eric/VEnvs/py36/bin/pip', 'install', '-e', '/home/eric/Poetry/sdist-issue/sdist-issue'] errored with the following return code 1, and output: 
Obtaining file:///home/eric/Poetry/sdist-issue/sdist-issue
    ERROR: Command errored out with exit status 1:
     command: /home/eric/VEnvs/py36/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/eric/Poetry/sdist-issue/sdist-issue/setup.py'"'"'; __file__='"'"'/home/eric/Poetry/sdist-issue/sdist-issue/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info
         cwd: /home/eric/Poetry/sdist-issue/sdist-issue/
    Complete output (7 lines):
    running egg_info
    creating src/sdist_issue.egg-info
    writing src/sdist_issue.egg-info/PKG-INFO
    writing dependency_links to src/sdist_issue.egg-info/dependency_links.txt
    writing top-level names to src/sdist_issue.egg-info/top_level.txt
    writing manifest file 'src/sdist_issue.egg-info/SOURCES.txt'
    error: package directory 'src/tests' does not exist
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.


Traceback (most recent call last):
  File "/home/eric/.poetry/lib/poetry/_vendor/py3.6/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/home/eric/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/home/eric/.poetry/lib/poetry/_vendor/py3.6/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/home/eric/.poetry/lib/poetry/_vendor/py3.6/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/home/eric/.poetry/lib/poetry/console/commands/install.py", line 88, in handle
    builder.build()
  File "/home/eric/.poetry/lib/poetry/masonry/builders/editable.py", line 17, in build
    return self._setup_build()
  File "/home/eric/.poetry/lib/poetry/masonry/builders/editable.py", line 41, in _setup_build
    self._env.run_pip('install', '-e', str(self._path))
  File "/home/eric/.poetry/lib/poetry/utils/env.py", line 843, in run_pip
    return self._run(cmd, **kwargs)
  File "/home/eric/.poetry/lib/poetry/utils/env.py", line 1071, in _run
    return super(VirtualEnv, self)._run(cmd, **kwargs)
  File "/home/eric/.poetry/lib/poetry/utils/env.py", line 875, in _run
    raise EnvCommandError(e, input=input_)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions