Skip to content

Conversation

@avalentino
Copy link

  • Closes # (insert issue number)
  • Executed pre-commit run --all-files with no errors
  • The change is fully covered by automated unit tests
  • Added an entry to the CHANGES file

When I build the package in debian sid I get the following warning:

/usr/lib/python3/dist-packages/setuptools/command/build_py.py:215: _Warning: Package 'flexparser.testsuite' is absent from the `packages` configuration.
!!

        ********************************************************************************
        ############################
        # Package would be ignored #
        ############################
        Python recognizes 'flexparser.testsuite' as an importable package[^1],
        but it is absent from setuptools' `packages` configuration.

        This leads to an ambiguous overall configuration. If you want to distribute this
        package, please make sure that 'flexparser.testsuite' is explicitly added
        to the `packages` configuration field.

        Alternatively, you can also rely on setuptools' discovery methods
        (for example by using `find_namespace_packages(...)`/`find_namespace:`
        instead of `find_packages(...)`/`find:`).

        You can read more about "package discovery" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

        If you don't want 'flexparser.testsuite' to be distributed and are
        already explicitly excluding 'flexparser.testsuite' via
        `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
        you can try to use `exclude_package_data`, or `include-package-data=False` in
        combination with a more fine grained `package-data` configuration.

        You can read more about "package data files" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


        [^1]: For Python, any directory (with suitable naming) can be imported,
              even if it does not contain any `.py` files.
              On the other hand, currently there is no concept of package data
              directory, all directories are treated like packages.
        ********************************************************************************

!!
  check.warn(importable)

This PR fixes the warning.

@musicinmybrain
Copy link

I suspect it would be even nicer not to install the test suite, but I don’t know what fix to suggest given pypa/setuptools#3260.

@avalentino
Copy link
Author

avalentino commented Aug 20, 2024

IMHO if you do not intend to install the tests then it is better to move them to a separate tests folder outside the main package.
In this way it is easier to manage and also it is easier to run unittests on the installed package.

@hgrecco
Copy link
Owner

hgrecco commented Nov 8, 2024

I like when the testsuite is included in the package so you can test easily that everything is fine for your particular installation.

@hgrecco hgrecco closed this Nov 8, 2024
@avalentino avalentino deleted the bugfix/fix-pyproject.toml branch November 9, 2024 09:55
@avalentino avalentino restored the bugfix/fix-pyproject.toml branch November 9, 2024 10:25
@avalentino avalentino deleted the bugfix/fix-pyproject.toml branch November 9, 2024 10:26
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 this pull request may close these issues.

3 participants