Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py installs the tests package #69

Closed
dgilman opened this issue Feb 1, 2020 · 5 comments
Closed

setup.py installs the tests package #69

dgilman opened this issue Feb 1, 2020 · 5 comments

Comments

@dgilman
Copy link

dgilman commented Feb 1, 2020

This might be partly a bug in poetry but the sdist tarball's setup.py installs the tests package alongside the tomlkit package.

@jtrakk
Copy link

jtrakk commented Mar 3, 2020

tomlkit's tests directory caused a collision in nixpkgs. As I said in my Poetry PR,

If multiple distributions have tests as a top-level package, they'll conflict whenever both are installed. (Examples here and here). Two common alternative strategies are:

  1. not distributing tests (as here), or
  2. placing tests in a subdirectory of the main package, rather than adjacent (as here and here).

Either of these strategies will avoid this issue.

@wgjak47
Copy link

wgjak47 commented Jan 26, 2021

This problem also happen in gentoo.

 * ERROR: dev-python/tomlkit-0.7.0::gentoo-zh failed (install phase):
 *   Package installs 'tests' package which is forbidden and likely a bug in the build system.
 * 
 * Call stack:
 *     ebuild.sh, line  125:  Called src_install
 *   environment, line 2962:  Called distutils-r1_src_install
 *   environment, line 1187:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_install'
 *   environment, line  439:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line 2576:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line 2058:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line 2056:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line  778:  Called distutils-r1_run_phase 'distutils-r1_python_install'
 *   environment, line 1155:  Called distutils-r1_python_install
 *   environment, line 1074:  Called die
 * The specific snippet of code:
 *               die "Package installs '${p}' package which is forbidden and likely a bug in the build system.";
 * 
 * If you need support, post the output of `emerge --info '=dev-python/tomlkit-0.7.0::gentoo-zh'`,
 * the complete build log and the output of `emerge -pqv '=dev-python/tomlkit-0.7.0::gentoo-zh'`.
 * The complete build log is located at '/var/tmp/portage/dev-python/tomlkit-0.7.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-python/tomlkit-0.7.0/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-python/tomlkit-0.7.0/work/tomlkit-0.7.0'
 * S: '/var/tmp/portage/dev-python/tomlkit-0.7.0/work/tomlkit-0.7.0'

@bollwyvl
Copy link

Also conda-forge: conda-forge/tomlkit-feedstock#24

We'd love the tests to be present in the sdist (a la recursive-include tests * and include_package_data=True) so we can run them, but excluded (a la find_packages(".", exclude=["tests*"]) so they don't cause this conflict. Alas, I do not know the poetry constructs for these techniques.

@bollwyvl
Copy link

Perhaps:

[tool.poetry]
# ...
include = ["tests"]

and omit the line about including the tests in the sdist. I presume the whl will then have them, too, but that's another issue for another day, i suppose...

@kwshi
Copy link
Contributor

kwshi commented Apr 30, 2021

Relevant issue from Poetry: python-poetry/poetry#2353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants