Repository: tmux-python/tmuxp (language: python)

Issue:
conftest.py should not be part of the package
### Step 1: Provide a summary of your problem

When packaging tmuxp for Arch Linux I realized that the conftest.py file is still packaged in the context of tmuxp:
`usr/lib/python3.10/site-packages/tmuxp/conftest.py`.

This file is only used for pytest and should not be part of the package.

### Step 2: Provide tmuxp details

tmuxp 1.15.1

### Step 3: Describe the problem:

#### Steps to reproduce:

```
python -m build --wheel --no-isolation
python -m installer --destdir="$pkgdir" dist/*.whl
```

#### Observed Results:

`usr/lib/python3.10/site-packages/tmuxp/conftest.py` is packaged.

#### Expected Results:

`usr/lib/python3.10/site-packages/tmuxp/conftest.py` is not packaged

#### Relevant Code:
n/a


Discussion / hints:
@dvzrv Thanks, I want to make packaging convenient as possible downstream

Do you run the tests directly from the source? (the reason why is, if conftest.py is excluded, you won't be able to run the tests - do you use the source itself rather than the built package for running tests?)

Secondly - the package itself has the conftest.py - rather than tests/conftest.py - due to us running [`doctest`](https://docs.python.org/3/library/doctest.html) + [pytest doctest plugin](https://docs.pytest.org/en/7.1.x/how-to/doctest.html) in the source code docstrings. Some examples of this:

- https://github.com/google/jax/blob/main/conftest.py
- https://github.com/numpy/numpy/blob/main/numpy/conftest.py
@dvzrv Did you see my reply here? https://github.com/tmux-python/libtmux/issues/441#issuecomment-1254342853
I had to run the tests against a temporary install location as otherwise tmuxp is no longer found.
The conftest.py file can be located in an sdist tarball, but I don't think it should be included in the installed package (e.g. the wheel, or rather what is then actually used by the user later on).

Fix patch:
diff --git a/CHANGES b/CHANGES
index 1294dcecb2..22fd604d66 100644
--- a/CHANGES
+++ b/CHANGES
@@ -19,6 +19,14 @@ $ pipx install --suffix=@next 'tmuxp' --pip-args '\--pre' --force
 
 - _Insert changes/features/fixes for next release here_
 
+## tmuxp 1.15.2 (unreleased)
+
+**Maintenance release, no features or fixes**
+
+### Packaging
+
+- Move conftest.py to root, to avoid packaging in wheel (#826 vs #825)
+
 ## tmuxp 1.15.1 (2022-09-23)
 
 **Maintenance release, no features or fixes**
diff --git a/pyproject.toml b/pyproject.toml
index 43aeae50bf..a68f19c30a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -32,6 +32,7 @@ include = [
   { path = "tests", format = "sdist" },
   { path = "examples", format = "sdist" },
   { path = "docs", format = "sdist" },
+  { path = "conftest.py", format = "sdist" },
 ]
 
 [tool.poetry.urls]


Test patch:
diff --git a/src/tmuxp/conftest.py b/conftest.py
similarity index 92%
rename from src/tmuxp/conftest.py
rename to conftest.py
index b753bdd9e8..368f68fdc2 100644
--- a/src/tmuxp/conftest.py
+++ b/conftest.py
@@ -1,3 +1,8 @@
+"""Conftest.py (root-level)
+
+We keep this in root pytest fixtures in pytest's doctest plugin to be available, as well
+as avoiding conftest.py from being included in the wheel.
+"""
 import logging
 import os
 import pathlib
diff --git a/tests/conftest.py b/tests/conftest.py
deleted file mode 100644
index 44a4317726..0000000000
--- a/tests/conftest.py
+++ /dev/null
@@ -1,1 +0,0 @@
-from tmuxp.conftest import *  # noqa F40