From b813917528115696e23767d05a84e2fd9140f888 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Wed, 13 Sep 2023 16:07:54 +0200 Subject: [PATCH] Move to src-layout. The intention of this is better isolation. `trio` is no longer accidentally on the (python) path and as such requires an explicit installation for usage, this helps uncover issues in packaging data etc early on (see https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/). This serves as the basis for switching to another build system as well; refs #2790. --- .coveragerc | 5 + check.sh | 30 +++--- ci.sh | 2 +- docs/source/conf.py | 2 +- pyproject.toml | 91 +++++++++--------- setup.py | 5 +- {trio => src/trio}/__init__.py | 0 {trio => src/trio}/_abc.py | 0 {trio => src/trio}/_channel.py | 0 {trio => src/trio}/_core/__init__.py | 0 {trio => src/trio}/_core/_asyncgens.py | 0 {trio => src/trio}/_core/_entry_queue.py | 0 {trio => src/trio}/_core/_exceptions.py | 0 .../trio}/_core/_generated_instrumentation.py | 0 .../trio}/_core/_generated_io_epoll.py | 0 .../trio}/_core/_generated_io_kqueue.py | 0 .../trio}/_core/_generated_io_windows.py | 0 {trio => src/trio}/_core/_generated_run.py | 0 {trio => src/trio}/_core/_instrumentation.py | 0 {trio => src/trio}/_core/_io_common.py | 0 {trio => src/trio}/_core/_io_epoll.py | 0 {trio => src/trio}/_core/_io_kqueue.py | 0 {trio => src/trio}/_core/_io_windows.py | 0 {trio => src/trio}/_core/_ki.py | 0 {trio => src/trio}/_core/_local.py | 0 {trio => src/trio}/_core/_mock_clock.py | 0 {trio => src/trio}/_core/_multierror.py | 0 {trio => src/trio}/_core/_parking_lot.py | 0 {trio => src/trio}/_core/_run.py | 0 {trio => src/trio}/_core/_tests/__init__.py | 0 .../trio}/_core/_tests/test_asyncgen.py | 0 .../trio}/_core/_tests/test_guest_mode.py | 0 .../_core/_tests/test_instrumentation.py | 0 {trio => src/trio}/_core/_tests/test_io.py | 0 {trio => src/trio}/_core/_tests/test_ki.py | 0 {trio => src/trio}/_core/_tests/test_local.py | 0 .../trio}/_core/_tests/test_mock_clock.py | 0 .../trio}/_core/_tests/test_multierror.py | 0 .../test_multierror_scripts/__init__.py | 0 .../_tests/test_multierror_scripts/_common.py | 0 .../apport_excepthook.py | 0 .../simple_excepthook.py | 0 .../trio}/_core/_tests/test_parking_lot.py | 0 {trio => src/trio}/_core/_tests/test_run.py | 0 .../trio}/_core/_tests/test_thread_cache.py | 0 {trio => src/trio}/_core/_tests/test_tutil.py | 0 .../_core/_tests/test_unbounded_queue.py | 0 .../trio}/_core/_tests/test_windows.py | 0 {trio => src/trio}/_core/_tests/tutil.py | 0 {trio => src/trio}/_core/_thread_cache.py | 0 {trio => src/trio}/_core/_traps.py | 0 {trio => src/trio}/_core/_unbounded_queue.py | 0 .../trio}/_core/_wakeup_socketpair.py | 0 {trio => src/trio}/_core/_windows_cffi.py | 0 {trio => src/trio}/_deprecate.py | 0 {trio => src/trio}/_dtls.py | 0 {trio => src/trio}/_file_io.py | 0 {trio => src/trio}/_highlevel_generic.py | 0 .../trio}/_highlevel_open_tcp_listeners.py | 0 .../trio}/_highlevel_open_tcp_stream.py | 0 .../trio}/_highlevel_open_unix_stream.py | 0 .../trio}/_highlevel_serve_listeners.py | 0 {trio => src/trio}/_highlevel_socket.py | 0 {trio => src/trio}/_highlevel_ssl_helpers.py | 0 {trio => src/trio}/_path.py | 0 {trio => src/trio}/_signals.py | 0 {trio => src/trio}/_socket.py | 0 {trio => src/trio}/_ssl.py | 0 {trio => src/trio}/_subprocess.py | 0 .../trio}/_subprocess_platform/__init__.py | 0 .../trio}/_subprocess_platform/kqueue.py | 0 .../trio}/_subprocess_platform/waitid.py | 0 .../trio}/_subprocess_platform/windows.py | 0 {trio => src/trio}/_sync.py | 0 {trio => src/trio}/_tests/__init__.py | 0 .../trio}/_tests/astrill-codesigning-cert.cer | Bin .../trio}/_tests/check_type_completeness.py | 0 .../trio}/_tests/module_with_deprecations.py | 0 {trio => src/trio}/_tests/pytest_plugin.py | 0 {trio => src/trio}/_tests/test_abc.py | 0 {trio => src/trio}/_tests/test_channel.py | 0 {trio => src/trio}/_tests/test_contextvars.py | 0 {trio => src/trio}/_tests/test_deprecate.py | 0 {trio => src/trio}/_tests/test_dtls.py | 0 {trio => src/trio}/_tests/test_exports.py | 0 {trio => src/trio}/_tests/test_fakenet.py | 0 {trio => src/trio}/_tests/test_file_io.py | 0 .../trio}/_tests/test_highlevel_generic.py | 0 .../test_highlevel_open_tcp_listeners.py | 0 .../_tests/test_highlevel_open_tcp_stream.py | 0 .../_tests/test_highlevel_open_unix_stream.py | 0 .../_tests/test_highlevel_serve_listeners.py | 0 .../trio}/_tests/test_highlevel_socket.py | 0 .../_tests/test_highlevel_ssl_helpers.py | 0 {trio => src/trio}/_tests/test_path.py | 0 .../_tests/test_scheduler_determinism.py | 0 {trio => src/trio}/_tests/test_signals.py | 0 {trio => src/trio}/_tests/test_socket.py | 0 {trio => src/trio}/_tests/test_ssl.py | 0 {trio => src/trio}/_tests/test_subprocess.py | 0 {trio => src/trio}/_tests/test_sync.py | 0 {trio => src/trio}/_tests/test_testing.py | 0 {trio => src/trio}/_tests/test_threads.py | 0 {trio => src/trio}/_tests/test_timeouts.py | 0 {trio => src/trio}/_tests/test_tracing.py | 0 {trio => src/trio}/_tests/test_unix_pipes.py | 0 {trio => src/trio}/_tests/test_util.py | 0 .../trio}/_tests/test_wait_for_object.py | 0 .../trio}/_tests/test_windows_pipes.py | 0 {trio => src/trio}/_tests/tools/__init__.py | 0 .../trio}/_tests/tools/test_gen_exports.py | 0 .../trio}/_tests/tools/test_mypy_annotate.py | 0 .../trio}/_tests/verify_types_darwin.json | 0 .../trio}/_tests/verify_types_linux.json | 0 .../trio}/_tests/verify_types_windows.json | 0 {trio => src/trio}/_threads.py | 0 {trio => src/trio}/_timeouts.py | 0 {trio => src/trio}/_tools/__init__.py | 0 {trio => src/trio}/_tools/gen_exports.py | 2 +- {trio => src/trio}/_tools/mypy_annotate.py | 0 {trio => src/trio}/_unix_pipes.py | 0 {trio => src/trio}/_util.py | 0 {trio => src/trio}/_version.py | 0 {trio => src/trio}/_wait_for_object.py | 0 {trio => src/trio}/_windows_pipes.py | 0 {trio => src/trio}/abc.py | 0 {trio => src/trio}/from_thread.py | 0 {trio => src/trio}/lowlevel.py | 0 {trio => src/trio}/py.typed | 0 {trio => src/trio}/socket.py | 0 {trio => src/trio}/testing/__init__.py | 0 {trio => src/trio}/testing/_check_streams.py | 0 {trio => src/trio}/testing/_checkpoints.py | 0 {trio => src/trio}/testing/_fake_net.py | 0 {trio => src/trio}/testing/_memory_streams.py | 0 {trio => src/trio}/testing/_network.py | 0 {trio => src/trio}/testing/_sequencer.py | 0 {trio => src/trio}/testing/_trio_test.py | 0 {trio => src/trio}/tests.py | 0 {trio => src/trio}/to_thread.py | 0 140 files changed, 72 insertions(+), 65 deletions(-) rename {trio => src/trio}/__init__.py (100%) rename {trio => src/trio}/_abc.py (100%) rename {trio => src/trio}/_channel.py (100%) rename {trio => src/trio}/_core/__init__.py (100%) rename {trio => src/trio}/_core/_asyncgens.py (100%) rename {trio => src/trio}/_core/_entry_queue.py (100%) rename {trio => src/trio}/_core/_exceptions.py (100%) rename {trio => src/trio}/_core/_generated_instrumentation.py (100%) rename {trio => src/trio}/_core/_generated_io_epoll.py (100%) rename {trio => src/trio}/_core/_generated_io_kqueue.py (100%) rename {trio => src/trio}/_core/_generated_io_windows.py (100%) rename {trio => src/trio}/_core/_generated_run.py (100%) rename {trio => src/trio}/_core/_instrumentation.py (100%) rename {trio => src/trio}/_core/_io_common.py (100%) rename {trio => src/trio}/_core/_io_epoll.py (100%) rename {trio => src/trio}/_core/_io_kqueue.py (100%) rename {trio => src/trio}/_core/_io_windows.py (100%) rename {trio => src/trio}/_core/_ki.py (100%) rename {trio => src/trio}/_core/_local.py (100%) rename {trio => src/trio}/_core/_mock_clock.py (100%) rename {trio => src/trio}/_core/_multierror.py (100%) rename {trio => src/trio}/_core/_parking_lot.py (100%) rename {trio => src/trio}/_core/_run.py (100%) rename {trio => src/trio}/_core/_tests/__init__.py (100%) rename {trio => src/trio}/_core/_tests/test_asyncgen.py (100%) rename {trio => src/trio}/_core/_tests/test_guest_mode.py (100%) rename {trio => src/trio}/_core/_tests/test_instrumentation.py (100%) rename {trio => src/trio}/_core/_tests/test_io.py (100%) rename {trio => src/trio}/_core/_tests/test_ki.py (100%) rename {trio => src/trio}/_core/_tests/test_local.py (100%) rename {trio => src/trio}/_core/_tests/test_mock_clock.py (100%) rename {trio => src/trio}/_core/_tests/test_multierror.py (100%) rename {trio => src/trio}/_core/_tests/test_multierror_scripts/__init__.py (100%) rename {trio => src/trio}/_core/_tests/test_multierror_scripts/_common.py (100%) rename {trio => src/trio}/_core/_tests/test_multierror_scripts/apport_excepthook.py (100%) rename {trio => src/trio}/_core/_tests/test_multierror_scripts/simple_excepthook.py (100%) rename {trio => src/trio}/_core/_tests/test_parking_lot.py (100%) rename {trio => src/trio}/_core/_tests/test_run.py (100%) rename {trio => src/trio}/_core/_tests/test_thread_cache.py (100%) rename {trio => src/trio}/_core/_tests/test_tutil.py (100%) rename {trio => src/trio}/_core/_tests/test_unbounded_queue.py (100%) rename {trio => src/trio}/_core/_tests/test_windows.py (100%) rename {trio => src/trio}/_core/_tests/tutil.py (100%) rename {trio => src/trio}/_core/_thread_cache.py (100%) rename {trio => src/trio}/_core/_traps.py (100%) rename {trio => src/trio}/_core/_unbounded_queue.py (100%) rename {trio => src/trio}/_core/_wakeup_socketpair.py (100%) rename {trio => src/trio}/_core/_windows_cffi.py (100%) rename {trio => src/trio}/_deprecate.py (100%) rename {trio => src/trio}/_dtls.py (100%) rename {trio => src/trio}/_file_io.py (100%) rename {trio => src/trio}/_highlevel_generic.py (100%) rename {trio => src/trio}/_highlevel_open_tcp_listeners.py (100%) rename {trio => src/trio}/_highlevel_open_tcp_stream.py (100%) rename {trio => src/trio}/_highlevel_open_unix_stream.py (100%) rename {trio => src/trio}/_highlevel_serve_listeners.py (100%) rename {trio => src/trio}/_highlevel_socket.py (100%) rename {trio => src/trio}/_highlevel_ssl_helpers.py (100%) rename {trio => src/trio}/_path.py (100%) rename {trio => src/trio}/_signals.py (100%) rename {trio => src/trio}/_socket.py (100%) rename {trio => src/trio}/_ssl.py (100%) rename {trio => src/trio}/_subprocess.py (100%) rename {trio => src/trio}/_subprocess_platform/__init__.py (100%) rename {trio => src/trio}/_subprocess_platform/kqueue.py (100%) rename {trio => src/trio}/_subprocess_platform/waitid.py (100%) rename {trio => src/trio}/_subprocess_platform/windows.py (100%) rename {trio => src/trio}/_sync.py (100%) rename {trio => src/trio}/_tests/__init__.py (100%) rename {trio => src/trio}/_tests/astrill-codesigning-cert.cer (100%) rename {trio => src/trio}/_tests/check_type_completeness.py (100%) rename {trio => src/trio}/_tests/module_with_deprecations.py (100%) rename {trio => src/trio}/_tests/pytest_plugin.py (100%) rename {trio => src/trio}/_tests/test_abc.py (100%) rename {trio => src/trio}/_tests/test_channel.py (100%) rename {trio => src/trio}/_tests/test_contextvars.py (100%) rename {trio => src/trio}/_tests/test_deprecate.py (100%) rename {trio => src/trio}/_tests/test_dtls.py (100%) rename {trio => src/trio}/_tests/test_exports.py (100%) rename {trio => src/trio}/_tests/test_fakenet.py (100%) rename {trio => src/trio}/_tests/test_file_io.py (100%) rename {trio => src/trio}/_tests/test_highlevel_generic.py (100%) rename {trio => src/trio}/_tests/test_highlevel_open_tcp_listeners.py (100%) rename {trio => src/trio}/_tests/test_highlevel_open_tcp_stream.py (100%) rename {trio => src/trio}/_tests/test_highlevel_open_unix_stream.py (100%) rename {trio => src/trio}/_tests/test_highlevel_serve_listeners.py (100%) rename {trio => src/trio}/_tests/test_highlevel_socket.py (100%) rename {trio => src/trio}/_tests/test_highlevel_ssl_helpers.py (100%) rename {trio => src/trio}/_tests/test_path.py (100%) rename {trio => src/trio}/_tests/test_scheduler_determinism.py (100%) rename {trio => src/trio}/_tests/test_signals.py (100%) rename {trio => src/trio}/_tests/test_socket.py (100%) rename {trio => src/trio}/_tests/test_ssl.py (100%) rename {trio => src/trio}/_tests/test_subprocess.py (100%) rename {trio => src/trio}/_tests/test_sync.py (100%) rename {trio => src/trio}/_tests/test_testing.py (100%) rename {trio => src/trio}/_tests/test_threads.py (100%) rename {trio => src/trio}/_tests/test_timeouts.py (100%) rename {trio => src/trio}/_tests/test_tracing.py (100%) rename {trio => src/trio}/_tests/test_unix_pipes.py (100%) rename {trio => src/trio}/_tests/test_util.py (100%) rename {trio => src/trio}/_tests/test_wait_for_object.py (100%) rename {trio => src/trio}/_tests/test_windows_pipes.py (100%) rename {trio => src/trio}/_tests/tools/__init__.py (100%) rename {trio => src/trio}/_tests/tools/test_gen_exports.py (100%) rename {trio => src/trio}/_tests/tools/test_mypy_annotate.py (100%) rename {trio => src/trio}/_tests/verify_types_darwin.json (100%) rename {trio => src/trio}/_tests/verify_types_linux.json (100%) rename {trio => src/trio}/_tests/verify_types_windows.json (100%) rename {trio => src/trio}/_threads.py (100%) rename {trio => src/trio}/_timeouts.py (100%) rename {trio => src/trio}/_tools/__init__.py (100%) rename {trio => src/trio}/_tools/gen_exports.py (99%) rename {trio => src/trio}/_tools/mypy_annotate.py (100%) rename {trio => src/trio}/_unix_pipes.py (100%) rename {trio => src/trio}/_util.py (100%) rename {trio => src/trio}/_version.py (100%) rename {trio => src/trio}/_wait_for_object.py (100%) rename {trio => src/trio}/_windows_pipes.py (100%) rename {trio => src/trio}/abc.py (100%) rename {trio => src/trio}/from_thread.py (100%) rename {trio => src/trio}/lowlevel.py (100%) rename {trio => src/trio}/py.typed (100%) rename {trio => src/trio}/socket.py (100%) rename {trio => src/trio}/testing/__init__.py (100%) rename {trio => src/trio}/testing/_check_streams.py (100%) rename {trio => src/trio}/testing/_checkpoints.py (100%) rename {trio => src/trio}/testing/_fake_net.py (100%) rename {trio => src/trio}/testing/_memory_streams.py (100%) rename {trio => src/trio}/testing/_network.py (100%) rename {trio => src/trio}/testing/_sequencer.py (100%) rename {trio => src/trio}/testing/_trio_test.py (100%) rename {trio => src/trio}/tests.py (100%) rename {trio => src/trio}/to_thread.py (100%) diff --git a/.coveragerc b/.coveragerc index de12642263..a44aae1376 100644 --- a/.coveragerc +++ b/.coveragerc @@ -14,6 +14,11 @@ omit= # this doesn't corrupt the coverage files parallel=True +[paths] +source = + src/trio + **/site-packages/trio + [report] precision = 1 skip_covered = True diff --git a/check.sh b/check.sh index 95049080f3..e385e4602e 100755 --- a/check.sh +++ b/check.sh @@ -11,7 +11,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::" @@ -21,10 +21,10 @@ echo "::endgroup::" # autoflake --recursive --in-place . # pyupgrade --py3-plus $(find . -name "*.py") echo "::group::Black" -if ! black --check setup.py trio; then +if ! black --check setup.py src/trio; then echo "* Black found issues" >> $GITHUB_STEP_SUMMARY EXIT_STATUS=1 - black --diff setup.py trio + black --diff setup.py src/trio echo "::endgroup::" echo "::error:: Black found issues" else @@ -32,10 +32,10 @@ else fi echo "::group::ISort" -if ! isort --check setup.py trio; then +if ! isort --check setup.py src/trio; then echo "* isort found issues." >> $GITHUB_STEP_SUMMARY EXIT_STATUS=1 - isort --diff setup.py trio + isort --diff setup.py src/trio echo "::endgroup::" echo "::error:: isort found issues" else @@ -44,7 +44,7 @@ fi # Run flake8, configured in pyproject.toml echo "::group::Flake8" -flake8 trio/ || EXIT_STATUS=$? +flake8 src/trio/ || EXIT_STATUS=$? echo "::endgroup::" # Run mypy on all supported platforms @@ -55,16 +55,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::" @@ -94,11 +94,11 @@ fi codespell || EXIT_STATUS=$? -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 @@ -112,8 +112,8 @@ Problems were found by static analysis (listed above). To fix formatting and see remaining errors, run pip install -r test-requirements.txt - black setup.py trio - isort setup.py trio + black setup.py src/trio + isort setup.py src/trio ./check.sh in your local checkout. diff --git a/ci.sh b/ci.sh index e469c0243a..ad162a62cb 100755 --- a/ci.sh +++ b/ci.sh @@ -87,7 +87,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 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..253b2b2dd8 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 @@ -142,6 +142,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]] 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 99% rename from trio/_tools/gen_exports.py rename to src/trio/_tools/gen_exports.py index 6549d473ab..d40f8d5c78 100755 --- a/trio/_tools/gen_exports.py +++ b/src/trio/_tools/gen_exports.py @@ -252,7 +252,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