From f0786e56cc2a2621c13d2223eb8c81ccad269f28 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Sat, 6 Jan 2024 15:12:56 -0800 Subject: [PATCH] Switch to a src-layout style repository layout It's been shown that this style of layout has multiple advantages, and most tools now support it out-of-the-box. This allows us to simplify a bit of our configuration. - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#src-layout --- .github/workflows/ci.yml | 4 ++-- pyproject.toml | 13 ++----------- {vesta => src/vesta}/__init__.py | 0 {vesta => src/vesta}/chars.py | 0 {vesta => src/vesta}/clients.py | 0 {vesta => src/vesta}/py.typed | 0 6 files changed, 4 insertions(+), 13 deletions(-) rename {vesta => src/vesta}/__init__.py (100%) rename {vesta => src/vesta}/chars.py (100%) rename {vesta => src/vesta}/clients.py (100%) rename {vesta => src/vesta}/py.typed (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b22a61a..458179f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: isort --check --diff . - name: Typing run: | - python -m mypy -p vesta -p tests + python -m mypy - name: Tests run: | - python -m pytest -v --cov-config=setup.cfg + python -m pytest -v diff --git a/pyproject.toml b/pyproject.toml index 81cc0e4..28737a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,15 +38,9 @@ Changelog = "https://github.com/jparise/vesta/blob/main/CHANGELOG.md" [tool.setuptools.dynamic] version = {attr = "vesta.__version__"} -[tool.setuptools.package-data] -vesta = ["py.typed"] - [tool.coverage.run] branch = true -source = [ - "vesta", - "tests", -] +source = ["src"] [tool.isort] profile = "black" @@ -54,11 +48,8 @@ force_single_line = true multi_line_output = 3 [tool.mypy] +packages = ["vesta", "tests"] python_version = 3.8 [tool.pytest.ini_options] addopts = "--cov=vesta --cov-report=term-missing --doctest-modules" -testpaths = [ - "vesta", - "tests", -] diff --git a/vesta/__init__.py b/src/vesta/__init__.py similarity index 100% rename from vesta/__init__.py rename to src/vesta/__init__.py diff --git a/vesta/chars.py b/src/vesta/chars.py similarity index 100% rename from vesta/chars.py rename to src/vesta/chars.py diff --git a/vesta/clients.py b/src/vesta/clients.py similarity index 100% rename from vesta/clients.py rename to src/vesta/clients.py diff --git a/vesta/py.typed b/src/vesta/py.typed similarity index 100% rename from vesta/py.typed rename to src/vesta/py.typed