From b813917528115696e23767d05a84e2fd9140f888 Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Wed, 13 Sep 2023 16:07:54 +0200 Subject: [PATCH 01/14] 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 From 9055147a2ef10f30456b313a800ab87c70fd6af1 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sat, 21 Oct 2023 15:54:47 -0500 Subject: [PATCH 02/14] Fix missing src changes I missed --- check.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/check.sh b/check.sh index 27d952b1d8..db5ad7a10c 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 src/trio/_tools/gen_exports.py --test \ +python ./src/trio/_tools/gen_exports.py --test \ || EXIT_STATUS=$? echo "::endgroup::" @@ -57,12 +57,12 @@ 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 ./src/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 ./src/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 ./src/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 From bd979b190f44f04c45bb1d47ef4a3ec761988f75 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sat, 21 Oct 2023 15:57:43 -0500 Subject: [PATCH 03/14] Update ruff per-file ignores to account for different directory --- pyproject.toml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 091f839948..b137e92f3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,13 +43,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 From 82962482f572b7c2c142be1229c231213b8c320a Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sat, 21 Oct 2023 16:01:38 -0500 Subject: [PATCH 04/14] Move type_tests into src directory --- {trio => src/trio}/_tests/type_tests/check_wraps.py | 0 {trio => src/trio}/_tests/type_tests/path.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {trio => src/trio}/_tests/type_tests/check_wraps.py (100%) rename {trio => src/trio}/_tests/type_tests/path.py (100%) 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/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 From 700b3ebb21bb3774137e19b47825e69e846d5cc5 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sat, 21 Oct 2023 18:46:05 -0500 Subject: [PATCH 05/14] Mypy uses module level things apparently --- pyproject.toml | 58 +++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b137e92f3e..393e48a7a7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,35 +84,35 @@ disallow_untyped_calls = false [[tool.mypy.overrides]] module = [ # tests -"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_unix_stream", -"src/trio/_tests/test_highlevel_serve_listeners", -"src/trio/_tests/test_highlevel_ssl_helpers", -"src/trio/_tests/test_scheduler_determinism", -"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/tools/test_gen_exports", +"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_unix_stream", +"trio/_tests/test_highlevel_serve_listeners", +"trio/_tests/test_highlevel_ssl_helpers", +"trio/_tests/test_scheduler_determinism", +"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/tools/test_gen_exports", ] check_untyped_defs = false disallow_any_decorated = false From 4a7ec59a9fa3c52aeec8d9702707e9560416436a Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sun, 5 Nov 2023 18:13:38 -0600 Subject: [PATCH 06/14] Re-add long description, I thought the pull to remove it had been merged --- LONG_DESCRIPTION.rst | 65 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 LONG_DESCRIPTION.rst diff --git a/LONG_DESCRIPTION.rst b/LONG_DESCRIPTION.rst new file mode 100644 index 0000000000..b0cfb99fbc --- /dev/null +++ b/LONG_DESCRIPTION.rst @@ -0,0 +1,65 @@ +.. image:: https://raw.githubusercontent.com/python-trio/trio/9b0bec646a31e0d0f67b8b6ecc6939726faf3e17/logo/logo-with-background.svg + :width: 200px + :align: right + +The Trio project's goal is to produce a production-quality, `permissively +licensed `__, +async/await-native I/O library for Python. Like all async libraries, +its main purpose is to help you write programs that do **multiple +things at the same time** with **parallelized I/O**. A web spider that +wants to fetch lots of pages in parallel, a web server that needs to +juggle lots of downloads and websocket connections at the same time, a +process supervisor monitoring multiple subprocesses... that sort of +thing. Compared to other libraries, Trio attempts to distinguish +itself with an obsessive focus on **usability** and +**correctness**. Concurrency is complicated; we try to make it *easy* +to get things *right*. + +Trio was built from the ground up to take advantage of the `latest +Python features `__, and +draws inspiration from `many sources +`__, in +particular Dave Beazley's `Curio `__. +The resulting design is radically simpler than older competitors like +`asyncio `__ and +`Twisted `__, yet just as capable. Trio is +the Python I/O library I always wanted; I find it makes building +I/O-oriented programs easier, less error-prone, and just plain more +fun. `Perhaps you'll find the same +`__. + +This project is young and still somewhat experimental: the overall +design is solid and the existing features are fully tested and +documented, but you may encounter missing functionality or rough +edges. We *do* encourage you do use it, but you should `read and +subscribe to issue #1 +`__ to get warning and a +chance to give feedback about any compatibility-breaking changes. + +Vital statistics: + +* Supported environments: Linux, macOS, or Windows running some kind of Python + 3.8-or-better (either CPython or PyPy3 is fine). \*BSD and illumos likely + work too, but are not tested. + +* Install: ``python3 -m pip install -U trio`` (or on Windows, maybe + ``py -3 -m pip install -U trio``). No compiler needed. + +* Tutorial and reference manual: https://trio.readthedocs.io + +* Changelog: https://trio.readthedocs.io/en/latest/history.html + +* Bug tracker and source code: https://github.com/python-trio/trio + +* Real-time chat: https://gitter.im/python-trio/general + +* Discussion forum: https://trio.discourse.group + +* License: MIT or Apache 2, your choice + +* Contributor guide: https://trio.readthedocs.io/en/latest/contributing.html + +* Code of conduct: Contributors are requested to follow our `code of + conduct + `_ + in all project spaces. From 458496b671efdeac1a61ea8d2a1f07e00e9a6633 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sun, 5 Nov 2023 18:19:36 -0600 Subject: [PATCH 07/14] Path updates and remove language version specifier from ruff Ruff infers what version to enable rules for and autofixes for based on the project supported python versions --- pyproject.toml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c0b0c778f3..2b9ea6f38d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,7 +84,6 @@ force-exclude = ''' ignore-words-list = 'astroid,crasher,asend' [tool.ruff] -target-version = "py38" respect-gitignore = true fix = true @@ -92,7 +91,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 @@ -234,15 +233,15 @@ showcontent = true [tool.coverage.run] branch = true -source = ["trio"] +source = ["src/trio"] omit = [ # These are run in subprocesses, but still don't work. We follow # coverage's documentation to no avail. - "*/trio/_core/_tests/test_multierror_scripts/*", + "*/src/trio/_core/_tests/test_multierror_scripts/*", # Omit the generated files in trio/_core starting with _generated_ - "*/trio/_core/_generated_*", + "*/src/trio/_core/_generated_*", # Script used to check type completeness that isn't run in tests - "*/trio/_tests/check_type_completeness.py", + "*/src/trio/_tests/check_type_completeness.py", ] # The test suite spawns subprocesses to test some stuff, so make sure # this doesn't corrupt the coverage files From 8954d8b7cb59f6ebb3b7ddb9e708da61db335251 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sun, 5 Nov 2023 18:29:14 -0600 Subject: [PATCH 08/14] Update path listing and enable namespace discovery --- MANIFEST.in | 4 ++-- pyproject.toml | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) 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/pyproject.toml b/pyproject.toml index 2b9ea6f38d..6f197ce25f 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__"} From 48bf58bb0534170e37bda30bf3e002a0404de347 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sun, 5 Nov 2023 18:33:58 -0600 Subject: [PATCH 09/14] Delete `.coveragerc` (not sure how survived merge) --- .coveragerc | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 4880dc8a4b..0000000000 --- a/.coveragerc +++ /dev/null @@ -1,42 +0,0 @@ -[run] -branch=True -source=trio -omit= - setup.py -# These are run in subprocesses, but still don't work. We follow -# coverage's documentation to no avail. - */trio/_core/_tests/test_multierror_scripts/* -# Omit the generated files in trio/_core starting with _generated_ - */trio/_core/_generated_* -# Script used to check type completeness that isn't run in tests - */trio/_tests/check_type_completeness.py -# The test suite spawns subprocesses to test some stuff, so make sure -# this doesn't corrupt the coverage files -parallel=True - -[paths] -source = - src/trio - **/site-packages/trio - -[report] -precision = 1 -skip_covered = True -exclude_lines = - pragma: no cover - abc.abstractmethod - if TYPE_CHECKING.*: - if _t.TYPE_CHECKING: - if t.TYPE_CHECKING: - @overload - class .*\bProtocol\b.*\): - raise NotImplementedError - -partial_branches = - pragma: no branch - if not TYPE_CHECKING: - if not _t.TYPE_CHECKING: - if not t.TYPE_CHECKING: - if .* or not TYPE_CHECKING: - if .* or not _t.TYPE_CHECKING: - if .* or not t.TYPE_CHECKING: From b03ffe9e7084fade2bfa13c6ab205a996425a1b7 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sun, 5 Nov 2023 19:23:14 -0600 Subject: [PATCH 10/14] Try changing coverage source --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6f197ce25f..9d1b0c370c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -230,7 +230,7 @@ showcontent = true [tool.coverage.run] branch = true -source = ["src/trio"] +source = ["src"] omit = [ # These are run in subprocesses, but still don't work. We follow # coverage's documentation to no avail. From 5fbec0b0527fe50499bd697443e541ee8d756b1b Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sun, 5 Nov 2023 19:29:48 -0600 Subject: [PATCH 11/14] Revert "Try changing coverage source" This reverts commit b03ffe9e7084fade2bfa13c6ab205a996425a1b7. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9d1b0c370c..6f197ce25f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -230,7 +230,7 @@ showcontent = true [tool.coverage.run] branch = true -source = ["src"] +source = ["src/trio"] omit = [ # These are run in subprocesses, but still don't work. We follow # coverage's documentation to no avail. From df3dbff0ce3e96c4de9bb8ec8149014cdd0368f5 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Fri, 10 Nov 2023 16:25:40 -0600 Subject: [PATCH 12/14] Try changing coverage `source` --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 27dbf56c65..4c6680ecd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -225,7 +225,7 @@ showcontent = true [tool.coverage.run] branch = true -source = ["src/trio"] +source = ["src"] omit = [ # These are run in subprocesses, but still don't work. We follow # coverage's documentation to no avail. From 196300a76b0c5b8f10eefa73f52a518504a64595 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Fri, 10 Nov 2023 16:32:43 -0600 Subject: [PATCH 13/14] Try changing coverage to use `source_pkgs` --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4c6680ecd9..e0304ec6d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -225,7 +225,7 @@ showcontent = true [tool.coverage.run] branch = true -source = ["src"] +source_pkgs = ["trio"] omit = [ # These are run in subprocesses, but still don't work. We follow # coverage's documentation to no avail. From 3b582ca37c09eded4a007a712cf482a72cac5481 Mon Sep 17 00:00:00 2001 From: CoolCat467 <52022020+CoolCat467@users.noreply.github.com> Date: Sat, 11 Nov 2023 02:28:16 -0600 Subject: [PATCH 14/14] Remove src prefix in coverage config --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e0304ec6d1..9caa39c3af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -229,11 +229,11 @@ source_pkgs = ["trio"] omit = [ # These are run in subprocesses, but still don't work. We follow # coverage's documentation to no avail. - "*/src/trio/_core/_tests/test_multierror_scripts/*", + "*/trio/_core/_tests/test_multierror_scripts/*", # Omit the generated files in trio/_core starting with _generated_ - "*/src/trio/_core/_generated_*", + "*/trio/_core/_generated_*", # Script used to check type completeness that isn't run in tests - "*/src/trio/_tests/check_type_completeness.py", + "*/trio/_tests/check_type_completeness.py", ] # The test suite spawns subprocesses to test some stuff, so make sure # this doesn't corrupt the coverage files