diff --git a/MANIFEST.in b/MANIFEST.in index 79e7891339..22cd7682aa 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,7 +3,7 @@ include README.rst include LONG_DESCRIPTION.rst include CODE_OF_CONDUCT.md CONTRIBUTING.md include test-requirements.txt -include trio/py.typed -recursive-include trio/_tests/test_ssl_certs *.pem +include src/trio/py.typed +recursive-include src/trio/_tests/test_ssl_certs *.pem recursive-include docs * prune docs/build diff --git a/check.sh b/check.sh index 01efd273db..a6f41a6d5d 100755 --- a/check.sh +++ b/check.sh @@ -13,7 +13,7 @@ fi # Test if the generated code is still up to date echo "::group::Generate Exports" -python ./trio/_tools/gen_exports.py --test \ +python ./src/trio/_tools/gen_exports.py --test \ || EXIT_STATUS=$? echo "::endgroup::" @@ -23,10 +23,10 @@ echo "::endgroup::" # autoflake --recursive --in-place . # pyupgrade --py3-plus $(find . -name "*.py") echo "::group::Black" -if ! black --check trio; then +if ! black --check src/trio; then echo "* Black found issues" >> "$GITHUB_STEP_SUMMARY" EXIT_STATUS=1 - black --diff trio + black --diff src/trio echo "::endgroup::" echo "::error:: Black found issues" else @@ -57,16 +57,16 @@ echo "::group::Mypy" rm -f mypy_annotate.dat # Pipefail makes these pipelines fail if mypy does, even if mypy_annotate.py succeeds. set -o pipefail -mypy trio --show-error-end --platform linux | python ./trio/_tools/mypy_annotate.py --dumpfile mypy_annotate.dat --platform Linux \ +mypy src/trio --show-error-end --platform linux | python ./src/trio/_tools/mypy_annotate.py --dumpfile mypy_annotate.dat --platform Linux \ || { echo "* Mypy (Linux) found type errors." >> "$GITHUB_STEP_SUMMARY"; MYPY=1; } # Darwin tests FreeBSD too -mypy trio --show-error-end --platform darwin | python ./trio/_tools/mypy_annotate.py --dumpfile mypy_annotate.dat --platform Mac \ +mypy src/trio --show-error-end --platform darwin | python ./src/trio/_tools/mypy_annotate.py --dumpfile mypy_annotate.dat --platform Mac \ || { echo "* Mypy (Mac) found type errors." >> "$GITHUB_STEP_SUMMARY"; MYPY=1; } -mypy trio --show-error-end --platform win32 | python ./trio/_tools/mypy_annotate.py --dumpfile mypy_annotate.dat --platform Windows \ +mypy src/trio --show-error-end --platform win32 | python ./src/trio/_tools/mypy_annotate.py --dumpfile mypy_annotate.dat --platform Windows \ || { echo "* Mypy (Windows) found type errors." >> "$GITHUB_STEP_SUMMARY"; MYPY=1; } set +o pipefail # Re-display errors using Github's syntax, read out of mypy_annotate.dat -python ./trio/_tools/mypy_annotate.py --dumpfile mypy_annotate.dat +python ./src/trio/_tools/mypy_annotate.py --dumpfile mypy_annotate.dat # Then discard. rm -f mypy_annotate.dat echo "::endgroup::" @@ -97,11 +97,11 @@ fi codespell || EXIT_STATUS=$? echo "::group::Pyright interface tests" -python trio/_tests/check_type_completeness.py --overwrite-file || EXIT_STATUS=$? -if git status --porcelain trio/_tests/verify_types*.json | grep -q "M"; then +python src/trio/_tests/check_type_completeness.py --overwrite-file || EXIT_STATUS=$? +if git status --porcelain src/trio/_tests/verify_types*.json | grep -q "M"; then echo "* Type completeness changed, please update!" >> "$GITHUB_STEP_SUMMARY" echo "::error::Type completeness changed, please update!" - git --no-pager diff --color trio/_tests/verify_types*.json + git --no-pager diff --color src/trio/_tests/verify_types*.json EXIT_STATUS=1 fi @@ -118,8 +118,8 @@ Problems were found by static analysis (listed above). To fix formatting and see remaining errors, run pip install -r test-requirements.txt - black trio - isort trio + black src/trio + ruff check src/trio ./check.sh in your local checkout. diff --git a/ci.sh b/ci.sh index e97bb68754..f808decdae 100755 --- a/ci.sh +++ b/ci.sh @@ -95,7 +95,7 @@ else # when installing, and then running 'certmgr.msc' and exporting the # certificate. See: # http://www.migee.com/2010/09/24/solution-for-unattendedsilent-installs-and-would-you-like-to-install-this-device-software/ - certutil -addstore "TrustedPublisher" trio/_tests/astrill-codesigning-cert.cer + certutil -addstore "TrustedPublisher" src/trio/_tests/astrill-codesigning-cert.cer # Double-slashes are how you tell windows-bash that you want a single # slash, and don't treat this as a unix-style filename that needs to # be replaced by a windows-style filename. diff --git a/docs/source/conf.py b/docs/source/conf.py index 5058c1bd51..af358abf15 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")) # Enable reloading with `typing.TYPE_CHECKING` being True os.environ["SPHINX_AUTODOC_RELOAD_MODULES"] = "1" diff --git a/pyproject.toml b/pyproject.toml index 14c7f7794a..9caa39c3af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,9 +65,6 @@ Changelog = "https://trio.readthedocs.io/en/latest/history.html" # doesn't look like a source file, so long as it appears in MANIFEST.in: include-package-data = true -[tool.setuptools.packages] -find = {namespaces = false} - [tool.setuptools.dynamic] version = {attr = "trio._version.__version__"} @@ -84,7 +81,6 @@ force-exclude = ''' ignore-words-list = 'astroid,crasher,asend' [tool.ruff] -target-version = "py38" respect-gitignore = true fix = true @@ -92,7 +88,7 @@ allowed-confusables = ["–"] # The directories to consider when resolving first vs. third-party imports. # Does not control what files to include/exclude! -src = ["trio", "notes-to-self"] +src = ["src/trio", "notes-to-self"] select = [ "RUF", # Ruff-specific rules @@ -124,13 +120,13 @@ extend-exclude = [ ] [tool.ruff.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.ruff.isort] combine-as-imports = true @@ -184,6 +180,7 @@ issue_format = "`#{issue} `_ # - At release time after bumping version number, run: towncrier # (or towncrier --draft) package = "trio" +package_dir = "src" underlines = ["-", "~", "^"] [[tool.towncrier.type]] @@ -228,7 +225,7 @@ showcontent = true [tool.coverage.run] branch = true -source = ["trio"] +source_pkgs = ["trio"] omit = [ # These are run in subprocesses, but still don't work. We follow # coverage's documentation to no avail. 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/type_tests/check_wraps.py b/src/trio/_tests/type_tests/check_wraps.py similarity index 100% rename from trio/_tests/type_tests/check_wraps.py rename to src/trio/_tests/type_tests/check_wraps.py diff --git a/trio/_tests/type_tests/open_memory_channel.py b/src/trio/_tests/type_tests/open_memory_channel.py similarity index 100% rename from trio/_tests/type_tests/open_memory_channel.py rename to src/trio/_tests/type_tests/open_memory_channel.py diff --git a/trio/_tests/type_tests/path.py b/src/trio/_tests/type_tests/path.py similarity index 100% rename from trio/_tests/type_tests/path.py rename to src/trio/_tests/type_tests/path.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 99% rename from trio/_tools/gen_exports.py rename to src/trio/_tools/gen_exports.py index 8578b1e12d..3227a06018 100755 --- a/trio/_tools/gen_exports.py +++ b/src/trio/_tools/gen_exports.py @@ -313,7 +313,7 @@ def main() -> None: # pragma: no cover source_root = Path.cwd() # Double-check we found the right directory assert (source_root / "LICENSE").exists() - core = source_root / "trio/_core" + core = source_root / "src/trio/_core" to_wrap = [ File(core / "_run.py", "runner", imports=IMPORTS_RUN), File( 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