Skip to content
Snippets Groups Projects
Commit f59eccb4 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[project] Use src layout; Move tests to outside project runtime

parent 044df1eb
No related branches found
No related tags found
No related merge requests found
Pipeline #64989 passed
Showing
with 26 additions and 37 deletions
*~
*.swp
*.pyc
bin
eggs
parts
.installed.cfg
.mr.developer.cfg
*.egg-info
src
develop-eggs
sphinx/
html/
doc/api/
dist
.nfs*
.gdb_history
build
.coverage
record.txt
*.DS_Store
.envrc
coverage.xml
test_results.xml
junit-coverage.xml
.tox/
html/
build/
doc/api/
dist/
include LICENSE README.rst
recursive-include doc *.rst *.txt *.py *.ico *.png
recursive-include exposed/tests/data *.cfg
recursive-include tests/data *.py *.cfg
......@@ -5,6 +5,7 @@
[project]
name = "exposed"
version = "1.0.0b0"
requires-python = ">=3.9"
description = "Configuration Support for Python Packages and CLIs"
dynamic = ["readme"]
license = {text = "BSD 3-Clause License"}
......@@ -48,24 +49,20 @@ test = [
]
[project.entry-points."exposed.test.config"]
first = "exposed.tests.data.basic_config"
first-a = "exposed.tests.data.basic_config:a"
first-b = "exposed.tests.data.basic_config:b"
second = "exposed.tests.data.second_config"
second-b = "exposed.tests.data.second_config:b"
second-c = "exposed.tests.data.second_config:c"
complex = "exposed.tests.data.complex"
complex-var = "exposed.tests.data.complex:cplx"
verbose-config = "exposed.tests.data.verbose_config"
error-config = "exposed.tests.data.doesnt_exist"
first = "tests.data.basic_config"
first-a = "tests.data.basic_config:a"
first-b = "tests.data.basic_config:b"
second = "tests.data.second_config"
second-b = "tests.data.second_config:b"
second-c = "tests.data.second_config:c"
complex = "tests.data.complex"
complex-var = "tests.data.complex:cplx"
verbose-config = "tests.data.verbose_config"
error-config = "tests.data.doesnt_exist"
[tool.setuptools]
zip-safe = false
packages = [
"exposed",
"exposed.tests",
"exposed.tests.data",
]
zip-safe = true
package-dir = {"" = "src"}
[tool.setuptools.dynamic]
version = {file = "version.txt"}
......@@ -80,11 +77,12 @@ lines_between_types = 1
[tool.black]
line-length = 80
[tool.coverage.report]
omit = ["*/tests/*"]
[tool.coverage.run]
relative_files = true
[tool.pytest.ini_options]
addopts = [
"--import-mode=append",
"--cov-report=term-missing",
"--cov=exposed",
]
......
File moved
File moved
......@@ -380,4 +380,5 @@ def resource_keys(
and (not k.name.startswith(strip))
)
]
ret_list = list(dict.fromkeys(ret_list)) # order-preserving uniq
return sorted(ret_list)
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
......@@ -266,7 +266,7 @@ def test_resource_option():
assert a == 1
runner = CliRunner()
result = runner.invoke(cli1, ["-a", "exposed.tests.data.basic_config"])
result = runner.invoke(cli1, ["-a", "tests.data.basic_config"])
assert result.exit_code == 0
# test usage without ConfigCommand and without entry_point_group
......@@ -288,12 +288,12 @@ def test_resource_option():
"-a",
"--a",
cls=ResourceOption,
string_exceptions=("exposed.tests.data.basic_config"),
string_exceptions=("tests.data.basic_config"),
entry_point_group="exposed.test.config",
)
def cli3(a):
assert a == "exposed.tests.data.basic_config"
assert a == "tests.data.basic_config"
runner = CliRunner()
result = runner.invoke(cli3, ["-a", "exposed.tests.data.basic_config"])
result = runner.invoke(cli3, ["-a", "tests.data.basic_config"])
assert result.exit_code == 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment