gage-russell / pandas-lineage

Apache License 2.0
13 stars 6 forks source link

Test directory inappropriately being included in package distribution #32

Open dlstadther opened 1 year ago

dlstadther commented 1 year ago

Currently (0.0.2), the tests directory is being included in the installation of this package.

Steps to repeat:

> python --version
Python 3.9.12

> python -m venv ~/venv/lineage
> ~/venv/lineage/bin/python -m pip install pandas-lineage==0.0.2
...
> ls ~/venv/lineage/lib/python3.9/site-packages/pandas_lineage
__init__.py  __pycache__  convention   custom_types decorators   io           tests

Suggestion: Move tests directory outside of package location and update CI and pyproject.toml.

Typically, i see tests directories at the same file path hierarchy as the pkg itself. e.g.

pandas-lineage
|_ docs
|_ examples
|_ pandas_lineage
|_ tests
gage-russell commented 1 year ago

Honestly, I just started out following the same folder structure as pandas: ls venv/lib/python3.10/site-packages/pandas/tests

https://docs.python-guide.org/writing/structure/ favors your test location though. I'm in favor of moving it out of the package.

gage-russell commented 1 year ago

pytest docs also favor tests located outside of the package: https://docs.pytest.org/en/latest/explanation/goodpractices.html

gage-russell commented 1 year ago

Addressing here: https://github.com/gage-russell/pandas-lineage/pull/33

Taking a couple steps further though -- going ahead and redoing CI step to use poetry and expanding test matrix. Currently getting a memory error (exit code 134) on one step. Will reduce the change to just be movement of test directory and create separate issue for better usage of poetry in CI if I continue running into issues.