borderline-0.3.0
توضیحات
Tests that new imports within a module respect the public API boundary.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | borderline-0.3.0 |
| نام | borderline |
| نسخه کتابخانه | 0.3.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Christoph Klein |
| ایمیل نویسنده | ckleinemail@gmail.com |
| آدرس صفحه اصلی | https://github.com/ctk3b/borderline |
| آدرس اینترنتی | https://pypi.org/project/borderline/ |
| مجوز | MIT |
# Borderline
Stop letting modules reach into other modules.
---

[](https://pypi.python.org/pypi/borderline/)
This library provides one thing and one thing only: a test class called `TestModuleImports`.
To use the test, subclass it in the test suite of the module you want to isolate and define that module's borderlines.
The test will fail if a module is not respecting those borderlines.
For example, a module called `report_builder` could have the following definition:
```python
class TestReportBuilder(ModuleImports):
module = "reporting.report_builder"
# The public API of the module.
# External modules should only import from here.
public_submodules = (
"reporting.report_builder.api",
)
# Modules that are considered outside of `module` and should not be imported
# by `module` unless they are a legitimate dependency.
external_modules = (
"reporting",
)
# Modules outside of `module` that ARE legitimate dependencies.
external_dependencies = (
"reporting.review.api",
"reporting.common",
)
# Directory to store imports that are currently allowed.
# This is useful when you are trying to isolate an existing module
# that is not respecting its borderlines.
grandfather_filedir = Path(
"reporting/report_builder/tests/data/borderline", parents=True, exist_ok=True
)
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6.2,<4.0 | Python |
نحوه نصب
نصب پکیج whl borderline-0.3.0:
pip install borderline-0.3.0.whl
نصب پکیج tar.gz borderline-0.3.0:
pip install borderline-0.3.0.tar.gz