Skip to main content

No project description provided

Project description

pylint module boundaries

a pylint plugin to enforce boundaries between modules in your project. similar to nx's enforce-module-boundaries eslint plugin

example

say you have three packages in your project - common, package1, and package2 - you can use the banned-imports rule to prevent common from importing anything from package1 or package2, thus avoiding issues such as circular dependencies.

Pylint can then be used to detect any violations of this rule:

see usage below for a config example

installing

poetry install pylint-module-boundaries

usage

# pyproject.toml
[tool.pylint.MASTER]
load-plugins = "pylint_module_boundaries"
# (currently uses regex but i want to replace it with something better in the future)
banned-imports = '''
{
    "common(\\..*)?": ["package1(\\..*)?", "package2(\\..*)?"],
    "scripts(\\..*)?": ["package1(\\..*)?", "package2(\\..*)?"]
}
'''

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylint_module_boundaries-1.0.0.post2.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page