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

Deprecated installation of tests #284

Open
dschwoerer opened this issue Mar 20, 2023 · 5 comments
Open

Deprecated installation of tests #284

dschwoerer opened this issue Mar 20, 2023 · 5 comments

Comments

@dschwoerer
Copy link
Contributor

It seems some tests are currently installed as data, but that might change in the future.

See the output of setuptools below:

/usr/lib/python3.11/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'xbout.calc.tests' as data is deprecated, please list it in `packages`.
    !!
    ############################
    # Package would be ignored #
    ############################
    Python recognizes 'xbout.calc.tests' as an importable package,
    but it is not listed in the `packages` configuration of setuptools.
    'xbout.calc.tests' has been automatically added to the distribution only
    because it may contain data files, but this behavior is likely to change
    in future versions of setuptools (and therefore is considered deprecated).
    Please make sure that 'xbout.calc.tests' is included as a package by using
    the `packages` configuration field or the proper discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).
    You can read more about "package discovery" and "data files" on setuptools
    documentation page.
!!
  check.warn(importable)
/usr/lib/python3.11/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'xbout.tests.data.options' as data is deprecated, please list it in `packages`.
/usr/lib/python3.11/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'xbout.tests.data.restart' as data is deprecated, please list it in `packages`.
/usr/lib/python3.11/site-packages/setuptools/command/build_py.py:202: SetuptoolsDeprecationWarning:     Installing 'xbout.tests.inputs' as data is deprecated, please list it in `packages`.
@ZedThree
Copy link
Member

Might be better to just move all the tests to a top-level directory so they're not installed at all?

@dschwoerer
Copy link
Contributor Author

Would that not still be pulled in (and than provide a top-level package)?
https://github.com/boutproject/xBOUT/blob/master/setup.cfg#L41

@johnomotani
Copy link
Collaborator

Might be better to just move all the tests to a top-level directory so they're not installed at all?

I think having tests installed is a feature - it means you can test the installed package by doing

$ pytest --pyargs xbout

@ZedThree
Copy link
Member

For finding the packages, it's trivial to just have packages = ["xbout"] as there's only the one package to install.

Ah, I didn't realise people tested installed packages! When developing, I usually do an editable install into a virtual env, which does test the package as it would be installed, but I can't say I ever test any package I've installed from pypi.

@johnomotani
Copy link
Collaborator

johnomotani commented Mar 20, 2023

Ah, I didn't realise people tested installed packages! When developing, I usually do an editable install into a virtual env, which does test the package as it would be installed, but I can't say I ever test any package I've installed from pypi.

I don't know if it's actually useful, but it seems nice to have as a possibility!

Edit: also we use that method at the moment to run the tests on conda-forge, although it would probably be possible to change that.

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

No branches or pull requests

3 participants