reflectivity / orsopy

http://www.reflectometry.org/orsopy/
MIT License
0 stars 8 forks source link

Ships tests in top-level 'tests' directory #103

Closed llimeht closed 1 year ago

llimeht commented 1 year ago

The orsopy module installs its tests into a top-level tests directory. This will conflict with any other module that also (accidentally) installs its tests into that location. There is frequent debate about whether or not to install tests but that is not the issue here; it is the location of the installed tests that is the concern.

$ python3 setup.py bdist_wheel
...
$ unzip -l dist/orsopy-1.1.0-py2.py3-none-any.whl 
Archive:  dist/orsopy-1.1.0-py2.py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
       59  2023-04-24 00:48   orsopy/__init__.py
...
     1016  2023-04-24 00:48   orsopy/utils/resolver_slddb.py
       36  2023-04-24 00:48   tests/__init__.py
       36  2023-04-24 00:48   tests/not_orso.ort
     2687  2023-04-24 00:48   tests/test_example.ort
...
$ pip install --user .
$ ls ~/.local/lib/python3.11/site-packages/orsopy
dataclasses.py  fileio/  __init__.py  __pycache__/  slddb/  utils/
 ls ~/.local/lib/python3.11/site-packages/tests/
__init__.py  not_orso.ort  __pycache__/  test_example2.ort  test_example.ort  test_fileio/  test_slddb/

(tested with setuptools v 66.1.1 and this is a moving target; it might also be another example of https://github.com/pypa/setuptools/issues/3260)

arm61 commented 1 year ago

Interesting, we used the python package cookie-cutter to set all of the infrastructure up. I am happy to move the tests into the orsopy directory if no one else is opposed.

andyfaff commented 1 year ago

I think we need to move the tests for a conda forge recipe anyway.