diff --git a/.coveragerc b/.coveragerc index de12642263..19c173c00d 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,6 @@ [run] branch=True -source=trio +source=src/trio omit= setup.py # These are run in subprocesses, but still don't work. We follow diff --git a/docs/source/conf.py b/docs/source/conf.py index 66aa8dea05..82ec6a23a7 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -22,7 +22,7 @@ # For our local_customization module sys.path.insert(0, os.path.abspath(".")) # For trio itself -sys.path.insert(0, os.path.abspath("../..")) +sys.path.insert(0, os.path.abspath("../../src")) # https://docs.readthedocs.io/en/stable/builds.html#build-environment if "READTHEDOCS" in os.environ: diff --git a/pyproject.toml b/pyproject.toml index 79beab840d..3edc1329a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,13 +13,13 @@ ignore-words-list = 'astroid,crasher,asend' [tool.flake8] extend-ignore = ['D', 'E', 'W', 'F403', 'F405', 'F821', 'F822'] per-file-ignores = [ - 'trio/__init__.py: F401', - 'trio/_core/__init__.py: F401', - 'trio/_core/_tests/test_multierror_scripts/*: F401', - 'trio/abc.py: F401', - 'trio/lowlevel.py: F401', - 'trio/socket.py: F401', - 'trio/testing/__init__.py: F401' + 'src/trio/__init__.py: F401', + 'src/trio/_core/__init__.py: F401', + 'src/trio/_core/_tests/test_multierror_scripts/*: F401', + 'src/trio/abc.py: F401', + 'src/trio/lowlevel.py: F401', + 'src/trio/socket.py: F401', + 'src/trio/testing/__init__.py: F401' ] [tool.isort] @@ -61,48 +61,48 @@ disallow_untyped_calls = false [[tool.mypy.overrides]] module = [ # 2761 -"trio/_core/_generated_io_windows", -"trio/_core/_io_windows", +"src/trio/_core/_generated_io_windows", +"src/trio/_core/_io_windows", # internal -"trio/_windows_pipes", +"src/trio/_windows_pipes", # tests -"trio/testing/_fake_net", -"trio/_core/_tests/test_guest_mode", -"trio/_core/_tests/test_instrumentation", -"trio/_core/_tests/test_ki", -"trio/_core/_tests/test_local", -"trio/_core/_tests/test_mock_clock", -"trio/_core/_tests/test_multierror", -"trio/_core/_tests/test_multierror_scripts/ipython_custom_exc", -"trio/_core/_tests/test_multierror_scripts/simple_excepthook", -"trio/_core/_tests/test_parking_lot", -"trio/_core/_tests/test_thread_cache", -"trio/_core/_tests/test_unbounded_queue", -"trio/_tests/test_exports", -"trio/_tests/test_file_io", -"trio/_tests/test_highlevel_generic", -"trio/_tests/test_highlevel_open_tcp_listeners", -"trio/_tests/test_highlevel_open_tcp_stream", -"trio/_tests/test_highlevel_open_unix_stream", -"trio/_tests/test_highlevel_serve_listeners", -"trio/_tests/test_highlevel_socket", -"trio/_tests/test_highlevel_ssl_helpers", -"trio/_tests/test_path", -"trio/_tests/test_scheduler_determinism", -"trio/_tests/test_socket", -"trio/_tests/test_ssl", -"trio/_tests/test_subprocess", -"trio/_tests/test_sync", -"trio/_tests/test_testing", -"trio/_tests/test_threads", -"trio/_tests/test_timeouts", -"trio/_tests/test_tracing", -"trio/_tests/test_util", -"trio/_tests/test_wait_for_object", -"trio/_tests/test_windows_pipes", -"trio/_tests/tools/test_gen_exports", +"src/trio/testing/_fake_net", +"src/trio/_core/_tests/test_guest_mode", +"src/trio/_core/_tests/test_instrumentation", +"src/trio/_core/_tests/test_ki", +"src/trio/_core/_tests/test_local", +"src/trio/_core/_tests/test_mock_clock", +"src/trio/_core/_tests/test_multierror", +"src/trio/_core/_tests/test_multierror_scripts/ipython_custom_exc", +"src/trio/_core/_tests/test_multierror_scripts/simple_excepthook", +"src/trio/_core/_tests/test_parking_lot", +"src/trio/_core/_tests/test_thread_cache", +"src/trio/_core/_tests/test_unbounded_queue", +"src/trio/_tests/test_exports", +"src/trio/_tests/test_file_io", +"src/trio/_tests/test_highlevel_generic", +"src/trio/_tests/test_highlevel_open_tcp_listeners", +"src/trio/_tests/test_highlevel_open_tcp_stream", +"src/trio/_tests/test_highlevel_open_unix_stream", +"src/trio/_tests/test_highlevel_serve_listeners", +"src/trio/_tests/test_highlevel_socket", +"src/trio/_tests/test_highlevel_ssl_helpers", +"src/trio/_tests/test_path", +"src/trio/_tests/test_scheduler_determinism", +"src/trio/_tests/test_socket", +"src/trio/_tests/test_ssl", +"src/trio/_tests/test_subprocess", +"src/trio/_tests/test_sync", +"src/trio/_tests/test_testing", +"src/trio/_tests/test_threads", +"src/trio/_tests/test_timeouts", +"src/trio/_tests/test_tracing", +"src/trio/_tests/test_util", +"src/trio/_tests/test_wait_for_object", +"src/trio/_tests/test_windows_pipes", +"src/trio/_tests/tools/test_gen_exports", ] check_untyped_defs = false disallow_any_decorated = false diff --git a/setup.py b/setup.py index dbce61c0fd..f6cb207375 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import find_packages, setup -exec(open("trio/_version.py", encoding="utf-8").read()) +exec(open("src/trio/_version.py", encoding="utf-8").read()) LONG_DESC = """\ .. image:: https://raw.githubusercontent.com/python-trio/trio/9b0bec646a31e0d0f67b8b6ecc6939726faf3e17/logo/logo-with-background.svg @@ -80,7 +80,8 @@ author_email="njs@pobox.com", url="https://github.com/python-trio/trio", license="MIT OR Apache-2.0", - packages=find_packages(), + packages=find_packages(where="src"), + package_dir={"": "src"}, install_requires=[ # attrs 19.2.0 adds `eq` option to decorators # attrs 20.1.0 adds @frozen diff --git a/trio/__init__.py b/src/trio/__init__.py similarity index 100% rename from trio/__init__.py rename to src/trio/__init__.py diff --git a/trio/_abc.py b/src/trio/_abc.py similarity index 100% rename from trio/_abc.py rename to src/trio/_abc.py diff --git a/trio/_channel.py b/src/trio/_channel.py similarity index 100% rename from trio/_channel.py rename to src/trio/_channel.py diff --git a/trio/_core/__init__.py b/src/trio/_core/__init__.py similarity index 100% rename from trio/_core/__init__.py rename to src/trio/_core/__init__.py diff --git a/trio/_core/_asyncgens.py b/src/trio/_core/_asyncgens.py similarity index 100% rename from trio/_core/_asyncgens.py rename to src/trio/_core/_asyncgens.py diff --git a/trio/_core/_entry_queue.py b/src/trio/_core/_entry_queue.py similarity index 100% rename from trio/_core/_entry_queue.py rename to src/trio/_core/_entry_queue.py diff --git a/trio/_core/_exceptions.py b/src/trio/_core/_exceptions.py similarity index 100% rename from trio/_core/_exceptions.py rename to src/trio/_core/_exceptions.py diff --git a/trio/_core/_generated_instrumentation.py b/src/trio/_core/_generated_instrumentation.py similarity index 100% rename from trio/_core/_generated_instrumentation.py rename to src/trio/_core/_generated_instrumentation.py diff --git a/trio/_core/_generated_io_epoll.py b/src/trio/_core/_generated_io_epoll.py similarity index 100% rename from trio/_core/_generated_io_epoll.py rename to src/trio/_core/_generated_io_epoll.py diff --git a/trio/_core/_generated_io_kqueue.py b/src/trio/_core/_generated_io_kqueue.py similarity index 100% rename from trio/_core/_generated_io_kqueue.py rename to src/trio/_core/_generated_io_kqueue.py diff --git a/trio/_core/_generated_io_windows.py b/src/trio/_core/_generated_io_windows.py similarity index 100% rename from trio/_core/_generated_io_windows.py rename to src/trio/_core/_generated_io_windows.py diff --git a/trio/_core/_generated_run.py b/src/trio/_core/_generated_run.py similarity index 100% rename from trio/_core/_generated_run.py rename to src/trio/_core/_generated_run.py diff --git a/trio/_core/_instrumentation.py b/src/trio/_core/_instrumentation.py similarity index 100% rename from trio/_core/_instrumentation.py rename to src/trio/_core/_instrumentation.py diff --git a/trio/_core/_io_common.py b/src/trio/_core/_io_common.py similarity index 100% rename from trio/_core/_io_common.py rename to src/trio/_core/_io_common.py diff --git a/trio/_core/_io_epoll.py b/src/trio/_core/_io_epoll.py similarity index 100% rename from trio/_core/_io_epoll.py rename to src/trio/_core/_io_epoll.py diff --git a/trio/_core/_io_kqueue.py b/src/trio/_core/_io_kqueue.py similarity index 100% rename from trio/_core/_io_kqueue.py rename to src/trio/_core/_io_kqueue.py diff --git a/trio/_core/_io_windows.py b/src/trio/_core/_io_windows.py similarity index 100% rename from trio/_core/_io_windows.py rename to src/trio/_core/_io_windows.py diff --git a/trio/_core/_ki.py b/src/trio/_core/_ki.py similarity index 100% rename from trio/_core/_ki.py rename to src/trio/_core/_ki.py diff --git a/trio/_core/_local.py b/src/trio/_core/_local.py similarity index 100% rename from trio/_core/_local.py rename to src/trio/_core/_local.py diff --git a/trio/_core/_mock_clock.py b/src/trio/_core/_mock_clock.py similarity index 100% rename from trio/_core/_mock_clock.py rename to src/trio/_core/_mock_clock.py diff --git a/trio/_core/_multierror.py b/src/trio/_core/_multierror.py similarity index 100% rename from trio/_core/_multierror.py rename to src/trio/_core/_multierror.py diff --git a/trio/_core/_parking_lot.py b/src/trio/_core/_parking_lot.py similarity index 100% rename from trio/_core/_parking_lot.py rename to src/trio/_core/_parking_lot.py diff --git a/trio/_core/_run.py b/src/trio/_core/_run.py similarity index 100% rename from trio/_core/_run.py rename to src/trio/_core/_run.py diff --git a/trio/_core/_tests/__init__.py b/src/trio/_core/_tests/__init__.py similarity index 100% rename from trio/_core/_tests/__init__.py rename to src/trio/_core/_tests/__init__.py diff --git a/trio/_core/_tests/test_asyncgen.py b/src/trio/_core/_tests/test_asyncgen.py similarity index 100% rename from trio/_core/_tests/test_asyncgen.py rename to src/trio/_core/_tests/test_asyncgen.py diff --git a/trio/_core/_tests/test_guest_mode.py b/src/trio/_core/_tests/test_guest_mode.py similarity index 100% rename from trio/_core/_tests/test_guest_mode.py rename to src/trio/_core/_tests/test_guest_mode.py diff --git a/trio/_core/_tests/test_instrumentation.py b/src/trio/_core/_tests/test_instrumentation.py similarity index 100% rename from trio/_core/_tests/test_instrumentation.py rename to src/trio/_core/_tests/test_instrumentation.py diff --git a/trio/_core/_tests/test_io.py b/src/trio/_core/_tests/test_io.py similarity index 100% rename from trio/_core/_tests/test_io.py rename to src/trio/_core/_tests/test_io.py diff --git a/trio/_core/_tests/test_ki.py b/src/trio/_core/_tests/test_ki.py similarity index 100% rename from trio/_core/_tests/test_ki.py rename to src/trio/_core/_tests/test_ki.py diff --git a/trio/_core/_tests/test_local.py b/src/trio/_core/_tests/test_local.py similarity index 100% rename from trio/_core/_tests/test_local.py rename to src/trio/_core/_tests/test_local.py diff --git a/trio/_core/_tests/test_mock_clock.py b/src/trio/_core/_tests/test_mock_clock.py similarity index 100% rename from trio/_core/_tests/test_mock_clock.py rename to src/trio/_core/_tests/test_mock_clock.py diff --git a/trio/_core/_tests/test_multierror.py b/src/trio/_core/_tests/test_multierror.py similarity index 100% rename from trio/_core/_tests/test_multierror.py rename to src/trio/_core/_tests/test_multierror.py diff --git a/trio/_core/_tests/test_multierror_scripts/__init__.py b/src/trio/_core/_tests/test_multierror_scripts/__init__.py similarity index 100% rename from trio/_core/_tests/test_multierror_scripts/__init__.py rename to src/trio/_core/_tests/test_multierror_scripts/__init__.py diff --git a/trio/_core/_tests/test_multierror_scripts/_common.py b/src/trio/_core/_tests/test_multierror_scripts/_common.py similarity index 100% rename from trio/_core/_tests/test_multierror_scripts/_common.py rename to src/trio/_core/_tests/test_multierror_scripts/_common.py diff --git a/trio/_core/_tests/test_multierror_scripts/apport_excepthook.py b/src/trio/_core/_tests/test_multierror_scripts/apport_excepthook.py similarity index 100% rename from trio/_core/_tests/test_multierror_scripts/apport_excepthook.py rename to src/trio/_core/_tests/test_multierror_scripts/apport_excepthook.py diff --git a/trio/_core/_tests/test_multierror_scripts/simple_excepthook.py b/src/trio/_core/_tests/test_multierror_scripts/simple_excepthook.py similarity index 100% rename from trio/_core/_tests/test_multierror_scripts/simple_excepthook.py rename to src/trio/_core/_tests/test_multierror_scripts/simple_excepthook.py diff --git a/trio/_core/_tests/test_parking_lot.py b/src/trio/_core/_tests/test_parking_lot.py similarity index 100% rename from trio/_core/_tests/test_parking_lot.py rename to src/trio/_core/_tests/test_parking_lot.py diff --git a/trio/_core/_tests/test_run.py b/src/trio/_core/_tests/test_run.py similarity index 100% rename from trio/_core/_tests/test_run.py rename to src/trio/_core/_tests/test_run.py diff --git a/trio/_core/_tests/test_thread_cache.py b/src/trio/_core/_tests/test_thread_cache.py similarity index 100% rename from trio/_core/_tests/test_thread_cache.py rename to src/trio/_core/_tests/test_thread_cache.py diff --git a/trio/_core/_tests/test_tutil.py b/src/trio/_core/_tests/test_tutil.py similarity index 100% rename from trio/_core/_tests/test_tutil.py rename to src/trio/_core/_tests/test_tutil.py diff --git a/trio/_core/_tests/test_unbounded_queue.py b/src/trio/_core/_tests/test_unbounded_queue.py similarity index 100% rename from trio/_core/_tests/test_unbounded_queue.py rename to src/trio/_core/_tests/test_unbounded_queue.py diff --git a/trio/_core/_tests/test_windows.py b/src/trio/_core/_tests/test_windows.py similarity index 100% rename from trio/_core/_tests/test_windows.py rename to src/trio/_core/_tests/test_windows.py diff --git a/trio/_core/_tests/tutil.py b/src/trio/_core/_tests/tutil.py similarity index 100% rename from trio/_core/_tests/tutil.py rename to src/trio/_core/_tests/tutil.py diff --git a/trio/_core/_thread_cache.py b/src/trio/_core/_thread_cache.py similarity index 100% rename from trio/_core/_thread_cache.py rename to src/trio/_core/_thread_cache.py diff --git a/trio/_core/_traps.py b/src/trio/_core/_traps.py similarity index 100% rename from trio/_core/_traps.py rename to src/trio/_core/_traps.py diff --git a/trio/_core/_unbounded_queue.py b/src/trio/_core/_unbounded_queue.py similarity index 100% rename from trio/_core/_unbounded_queue.py rename to src/trio/_core/_unbounded_queue.py diff --git a/trio/_core/_wakeup_socketpair.py b/src/trio/_core/_wakeup_socketpair.py similarity index 100% rename from trio/_core/_wakeup_socketpair.py rename to src/trio/_core/_wakeup_socketpair.py diff --git a/trio/_core/_windows_cffi.py b/src/trio/_core/_windows_cffi.py similarity index 100% rename from trio/_core/_windows_cffi.py rename to src/trio/_core/_windows_cffi.py diff --git a/trio/_deprecate.py b/src/trio/_deprecate.py similarity index 100% rename from trio/_deprecate.py rename to src/trio/_deprecate.py diff --git a/trio/_dtls.py b/src/trio/_dtls.py similarity index 100% rename from trio/_dtls.py rename to src/trio/_dtls.py diff --git a/trio/_file_io.py b/src/trio/_file_io.py similarity index 100% rename from trio/_file_io.py rename to src/trio/_file_io.py diff --git a/trio/_highlevel_generic.py b/src/trio/_highlevel_generic.py similarity index 100% rename from trio/_highlevel_generic.py rename to src/trio/_highlevel_generic.py diff --git a/trio/_highlevel_open_tcp_listeners.py b/src/trio/_highlevel_open_tcp_listeners.py similarity index 100% rename from trio/_highlevel_open_tcp_listeners.py rename to src/trio/_highlevel_open_tcp_listeners.py diff --git a/trio/_highlevel_open_tcp_stream.py b/src/trio/_highlevel_open_tcp_stream.py similarity index 100% rename from trio/_highlevel_open_tcp_stream.py rename to src/trio/_highlevel_open_tcp_stream.py diff --git a/trio/_highlevel_open_unix_stream.py b/src/trio/_highlevel_open_unix_stream.py similarity index 100% rename from trio/_highlevel_open_unix_stream.py rename to src/trio/_highlevel_open_unix_stream.py diff --git a/trio/_highlevel_serve_listeners.py b/src/trio/_highlevel_serve_listeners.py similarity index 100% rename from trio/_highlevel_serve_listeners.py rename to src/trio/_highlevel_serve_listeners.py diff --git a/trio/_highlevel_socket.py b/src/trio/_highlevel_socket.py similarity index 100% rename from trio/_highlevel_socket.py rename to src/trio/_highlevel_socket.py diff --git a/trio/_highlevel_ssl_helpers.py b/src/trio/_highlevel_ssl_helpers.py similarity index 100% rename from trio/_highlevel_ssl_helpers.py rename to src/trio/_highlevel_ssl_helpers.py diff --git a/trio/_path.py b/src/trio/_path.py similarity index 100% rename from trio/_path.py rename to src/trio/_path.py diff --git a/trio/_signals.py b/src/trio/_signals.py similarity index 100% rename from trio/_signals.py rename to src/trio/_signals.py diff --git a/trio/_socket.py b/src/trio/_socket.py similarity index 100% rename from trio/_socket.py rename to src/trio/_socket.py diff --git a/trio/_ssl.py b/src/trio/_ssl.py similarity index 100% rename from trio/_ssl.py rename to src/trio/_ssl.py diff --git a/trio/_subprocess.py b/src/trio/_subprocess.py similarity index 100% rename from trio/_subprocess.py rename to src/trio/_subprocess.py diff --git a/trio/_subprocess_platform/__init__.py b/src/trio/_subprocess_platform/__init__.py similarity index 100% rename from trio/_subprocess_platform/__init__.py rename to src/trio/_subprocess_platform/__init__.py diff --git a/trio/_subprocess_platform/kqueue.py b/src/trio/_subprocess_platform/kqueue.py similarity index 100% rename from trio/_subprocess_platform/kqueue.py rename to src/trio/_subprocess_platform/kqueue.py diff --git a/trio/_subprocess_platform/waitid.py b/src/trio/_subprocess_platform/waitid.py similarity index 100% rename from trio/_subprocess_platform/waitid.py rename to src/trio/_subprocess_platform/waitid.py diff --git a/trio/_subprocess_platform/windows.py b/src/trio/_subprocess_platform/windows.py similarity index 100% rename from trio/_subprocess_platform/windows.py rename to src/trio/_subprocess_platform/windows.py diff --git a/trio/_sync.py b/src/trio/_sync.py similarity index 100% rename from trio/_sync.py rename to src/trio/_sync.py diff --git a/trio/_tests/__init__.py b/src/trio/_tests/__init__.py similarity index 100% rename from trio/_tests/__init__.py rename to src/trio/_tests/__init__.py diff --git a/trio/_tests/astrill-codesigning-cert.cer b/src/trio/_tests/astrill-codesigning-cert.cer similarity index 100% rename from trio/_tests/astrill-codesigning-cert.cer rename to src/trio/_tests/astrill-codesigning-cert.cer diff --git a/trio/_tests/check_type_completeness.py b/src/trio/_tests/check_type_completeness.py similarity index 100% rename from trio/_tests/check_type_completeness.py rename to src/trio/_tests/check_type_completeness.py diff --git a/trio/_tests/module_with_deprecations.py b/src/trio/_tests/module_with_deprecations.py similarity index 100% rename from trio/_tests/module_with_deprecations.py rename to src/trio/_tests/module_with_deprecations.py diff --git a/trio/_tests/pytest_plugin.py b/src/trio/_tests/pytest_plugin.py similarity index 100% rename from trio/_tests/pytest_plugin.py rename to src/trio/_tests/pytest_plugin.py diff --git a/trio/_tests/test_abc.py b/src/trio/_tests/test_abc.py similarity index 100% rename from trio/_tests/test_abc.py rename to src/trio/_tests/test_abc.py diff --git a/trio/_tests/test_channel.py b/src/trio/_tests/test_channel.py similarity index 100% rename from trio/_tests/test_channel.py rename to src/trio/_tests/test_channel.py diff --git a/trio/_tests/test_contextvars.py b/src/trio/_tests/test_contextvars.py similarity index 100% rename from trio/_tests/test_contextvars.py rename to src/trio/_tests/test_contextvars.py diff --git a/trio/_tests/test_deprecate.py b/src/trio/_tests/test_deprecate.py similarity index 100% rename from trio/_tests/test_deprecate.py rename to src/trio/_tests/test_deprecate.py diff --git a/trio/_tests/test_dtls.py b/src/trio/_tests/test_dtls.py similarity index 100% rename from trio/_tests/test_dtls.py rename to src/trio/_tests/test_dtls.py diff --git a/trio/_tests/test_exports.py b/src/trio/_tests/test_exports.py similarity index 100% rename from trio/_tests/test_exports.py rename to src/trio/_tests/test_exports.py diff --git a/trio/_tests/test_fakenet.py b/src/trio/_tests/test_fakenet.py similarity index 100% rename from trio/_tests/test_fakenet.py rename to src/trio/_tests/test_fakenet.py diff --git a/trio/_tests/test_file_io.py b/src/trio/_tests/test_file_io.py similarity index 100% rename from trio/_tests/test_file_io.py rename to src/trio/_tests/test_file_io.py diff --git a/trio/_tests/test_highlevel_generic.py b/src/trio/_tests/test_highlevel_generic.py similarity index 100% rename from trio/_tests/test_highlevel_generic.py rename to src/trio/_tests/test_highlevel_generic.py diff --git a/trio/_tests/test_highlevel_open_tcp_listeners.py b/src/trio/_tests/test_highlevel_open_tcp_listeners.py similarity index 100% rename from trio/_tests/test_highlevel_open_tcp_listeners.py rename to src/trio/_tests/test_highlevel_open_tcp_listeners.py diff --git a/trio/_tests/test_highlevel_open_tcp_stream.py b/src/trio/_tests/test_highlevel_open_tcp_stream.py similarity index 100% rename from trio/_tests/test_highlevel_open_tcp_stream.py rename to src/trio/_tests/test_highlevel_open_tcp_stream.py diff --git a/trio/_tests/test_highlevel_open_unix_stream.py b/src/trio/_tests/test_highlevel_open_unix_stream.py similarity index 100% rename from trio/_tests/test_highlevel_open_unix_stream.py rename to src/trio/_tests/test_highlevel_open_unix_stream.py diff --git a/trio/_tests/test_highlevel_serve_listeners.py b/src/trio/_tests/test_highlevel_serve_listeners.py similarity index 100% rename from trio/_tests/test_highlevel_serve_listeners.py rename to src/trio/_tests/test_highlevel_serve_listeners.py diff --git a/trio/_tests/test_highlevel_socket.py b/src/trio/_tests/test_highlevel_socket.py similarity index 100% rename from trio/_tests/test_highlevel_socket.py rename to src/trio/_tests/test_highlevel_socket.py diff --git a/trio/_tests/test_highlevel_ssl_helpers.py b/src/trio/_tests/test_highlevel_ssl_helpers.py similarity index 100% rename from trio/_tests/test_highlevel_ssl_helpers.py rename to src/trio/_tests/test_highlevel_ssl_helpers.py diff --git a/trio/_tests/test_path.py b/src/trio/_tests/test_path.py similarity index 100% rename from trio/_tests/test_path.py rename to src/trio/_tests/test_path.py diff --git a/trio/_tests/test_scheduler_determinism.py b/src/trio/_tests/test_scheduler_determinism.py similarity index 100% rename from trio/_tests/test_scheduler_determinism.py rename to src/trio/_tests/test_scheduler_determinism.py diff --git a/trio/_tests/test_signals.py b/src/trio/_tests/test_signals.py similarity index 100% rename from trio/_tests/test_signals.py rename to src/trio/_tests/test_signals.py diff --git a/trio/_tests/test_socket.py b/src/trio/_tests/test_socket.py similarity index 100% rename from trio/_tests/test_socket.py rename to src/trio/_tests/test_socket.py diff --git a/trio/_tests/test_ssl.py b/src/trio/_tests/test_ssl.py similarity index 100% rename from trio/_tests/test_ssl.py rename to src/trio/_tests/test_ssl.py diff --git a/trio/_tests/test_subprocess.py b/src/trio/_tests/test_subprocess.py similarity index 100% rename from trio/_tests/test_subprocess.py rename to src/trio/_tests/test_subprocess.py diff --git a/trio/_tests/test_sync.py b/src/trio/_tests/test_sync.py similarity index 100% rename from trio/_tests/test_sync.py rename to src/trio/_tests/test_sync.py diff --git a/trio/_tests/test_testing.py b/src/trio/_tests/test_testing.py similarity index 100% rename from trio/_tests/test_testing.py rename to src/trio/_tests/test_testing.py diff --git a/trio/_tests/test_threads.py b/src/trio/_tests/test_threads.py similarity index 100% rename from trio/_tests/test_threads.py rename to src/trio/_tests/test_threads.py diff --git a/trio/_tests/test_timeouts.py b/src/trio/_tests/test_timeouts.py similarity index 100% rename from trio/_tests/test_timeouts.py rename to src/trio/_tests/test_timeouts.py diff --git a/trio/_tests/test_tracing.py b/src/trio/_tests/test_tracing.py similarity index 100% rename from trio/_tests/test_tracing.py rename to src/trio/_tests/test_tracing.py diff --git a/trio/_tests/test_unix_pipes.py b/src/trio/_tests/test_unix_pipes.py similarity index 100% rename from trio/_tests/test_unix_pipes.py rename to src/trio/_tests/test_unix_pipes.py diff --git a/trio/_tests/test_util.py b/src/trio/_tests/test_util.py similarity index 100% rename from trio/_tests/test_util.py rename to src/trio/_tests/test_util.py diff --git a/trio/_tests/test_wait_for_object.py b/src/trio/_tests/test_wait_for_object.py similarity index 100% rename from trio/_tests/test_wait_for_object.py rename to src/trio/_tests/test_wait_for_object.py diff --git a/trio/_tests/test_windows_pipes.py b/src/trio/_tests/test_windows_pipes.py similarity index 100% rename from trio/_tests/test_windows_pipes.py rename to src/trio/_tests/test_windows_pipes.py diff --git a/trio/_tests/tools/__init__.py b/src/trio/_tests/tools/__init__.py similarity index 100% rename from trio/_tests/tools/__init__.py rename to src/trio/_tests/tools/__init__.py diff --git a/trio/_tests/tools/test_gen_exports.py b/src/trio/_tests/tools/test_gen_exports.py similarity index 100% rename from trio/_tests/tools/test_gen_exports.py rename to src/trio/_tests/tools/test_gen_exports.py diff --git a/trio/_tests/tools/test_mypy_annotate.py b/src/trio/_tests/tools/test_mypy_annotate.py similarity index 100% rename from trio/_tests/tools/test_mypy_annotate.py rename to src/trio/_tests/tools/test_mypy_annotate.py diff --git a/trio/_tests/verify_types_darwin.json b/src/trio/_tests/verify_types_darwin.json similarity index 100% rename from trio/_tests/verify_types_darwin.json rename to src/trio/_tests/verify_types_darwin.json diff --git a/trio/_tests/verify_types_linux.json b/src/trio/_tests/verify_types_linux.json similarity index 100% rename from trio/_tests/verify_types_linux.json rename to src/trio/_tests/verify_types_linux.json diff --git a/trio/_tests/verify_types_windows.json b/src/trio/_tests/verify_types_windows.json similarity index 100% rename from trio/_tests/verify_types_windows.json rename to src/trio/_tests/verify_types_windows.json diff --git a/trio/_threads.py b/src/trio/_threads.py similarity index 100% rename from trio/_threads.py rename to src/trio/_threads.py diff --git a/trio/_timeouts.py b/src/trio/_timeouts.py similarity index 100% rename from trio/_timeouts.py rename to src/trio/_timeouts.py diff --git a/trio/_tools/__init__.py b/src/trio/_tools/__init__.py similarity index 100% rename from trio/_tools/__init__.py rename to src/trio/_tools/__init__.py diff --git a/trio/_tools/gen_exports.py b/src/trio/_tools/gen_exports.py similarity index 100% rename from trio/_tools/gen_exports.py rename to src/trio/_tools/gen_exports.py diff --git a/trio/_tools/mypy_annotate.py b/src/trio/_tools/mypy_annotate.py similarity index 100% rename from trio/_tools/mypy_annotate.py rename to src/trio/_tools/mypy_annotate.py diff --git a/trio/_unix_pipes.py b/src/trio/_unix_pipes.py similarity index 100% rename from trio/_unix_pipes.py rename to src/trio/_unix_pipes.py diff --git a/trio/_util.py b/src/trio/_util.py similarity index 100% rename from trio/_util.py rename to src/trio/_util.py diff --git a/trio/_version.py b/src/trio/_version.py similarity index 100% rename from trio/_version.py rename to src/trio/_version.py diff --git a/trio/_wait_for_object.py b/src/trio/_wait_for_object.py similarity index 100% rename from trio/_wait_for_object.py rename to src/trio/_wait_for_object.py diff --git a/trio/_windows_pipes.py b/src/trio/_windows_pipes.py similarity index 100% rename from trio/_windows_pipes.py rename to src/trio/_windows_pipes.py diff --git a/trio/abc.py b/src/trio/abc.py similarity index 100% rename from trio/abc.py rename to src/trio/abc.py diff --git a/trio/from_thread.py b/src/trio/from_thread.py similarity index 100% rename from trio/from_thread.py rename to src/trio/from_thread.py diff --git a/trio/lowlevel.py b/src/trio/lowlevel.py similarity index 100% rename from trio/lowlevel.py rename to src/trio/lowlevel.py diff --git a/trio/py.typed b/src/trio/py.typed similarity index 100% rename from trio/py.typed rename to src/trio/py.typed diff --git a/trio/socket.py b/src/trio/socket.py similarity index 100% rename from trio/socket.py rename to src/trio/socket.py diff --git a/trio/testing/__init__.py b/src/trio/testing/__init__.py similarity index 100% rename from trio/testing/__init__.py rename to src/trio/testing/__init__.py diff --git a/trio/testing/_check_streams.py b/src/trio/testing/_check_streams.py similarity index 100% rename from trio/testing/_check_streams.py rename to src/trio/testing/_check_streams.py diff --git a/trio/testing/_checkpoints.py b/src/trio/testing/_checkpoints.py similarity index 100% rename from trio/testing/_checkpoints.py rename to src/trio/testing/_checkpoints.py diff --git a/trio/testing/_fake_net.py b/src/trio/testing/_fake_net.py similarity index 100% rename from trio/testing/_fake_net.py rename to src/trio/testing/_fake_net.py diff --git a/trio/testing/_memory_streams.py b/src/trio/testing/_memory_streams.py similarity index 100% rename from trio/testing/_memory_streams.py rename to src/trio/testing/_memory_streams.py diff --git a/trio/testing/_network.py b/src/trio/testing/_network.py similarity index 100% rename from trio/testing/_network.py rename to src/trio/testing/_network.py diff --git a/trio/testing/_sequencer.py b/src/trio/testing/_sequencer.py similarity index 100% rename from trio/testing/_sequencer.py rename to src/trio/testing/_sequencer.py diff --git a/trio/testing/_trio_test.py b/src/trio/testing/_trio_test.py similarity index 100% rename from trio/testing/_trio_test.py rename to src/trio/testing/_trio_test.py diff --git a/trio/tests.py b/src/trio/tests.py similarity index 100% rename from trio/tests.py rename to src/trio/tests.py diff --git a/trio/to_thread.py b/src/trio/to_thread.py similarity index 100% rename from trio/to_thread.py rename to src/trio/to_thread.py