Skip to content

Commit

Permalink
Move to src-layout.
Browse files Browse the repository at this point in the history
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 python-trio#2790.
  • Loading branch information
apollo13 committed Sep 13, 2023
1 parent c16003f commit a26e18f
Show file tree
Hide file tree
Showing 137 changed files with 49 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[run]
branch=True
source=trio
source=src/trio
omit=
setup.py
# These are run in subprocesses, but still don't work. We follow
Expand Down
90 changes: 45 additions & 45 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit a26e18f

Please sign in to comment.