Skip to main content

Forbid External Packages contract

A contract for [import-linter] that forbids imports of external (i.e. not in the standard library) packages.

Usage

  1. Install this package in the same virtual environment as import-linter.

  2. Add the contract type to your config file, e.g:

      [importlinter]
      root_package = my_project
      include_external_packages = True
    + contract_types=
    +     forbid_external_packages: importlinter_forbid_external_packages.Contract
    

    N.B. include_external_packages must be enabled for this contract type to have any effect.

  3. Create a contract with type = forbid_external_packages. This contract must specify the source_modules value, as documented for the built-in forbidden contract type

Example

[importlinter]
root_package = my_project
include_external_packages = True
contract_types=
    forbid_external_packages: importlinter_forbid_external_packages.Contract

[importlinter:contract:external-packages]
name = External packages
type = forbid_external_packages
source_modules =
    my_project.*

Download files

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

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file import_linter_forbid_external_packages-0.1.0.tar.gz.

File metadata

File hashes

Hashes for import_linter_forbid_external_packages-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d657ce8e7d6fe504a4d5a5be89a0817459d4fe367c834ea8e43566ebb4f99cd6
MD5 ad8c79e27b6d5f2ffdbb548ffa21b19f
BLAKE2b-256 5ff1a7e60f52d33974932e46849030e5fca65e29db75f814bd1674e28793ed19

See more details on using hashes here.

Provenance

The following attestation bundles were made for import_linter_forbid_external_packages-0.1.0.tar.gz:

Publisher: build_and_publish.yaml on samueljsb/import-linter-forbid-external-packages

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file import_linter_forbid_external_packages-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for import_linter_forbid_external_packages-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01ace407bfb7e4b5c61ae63fe7fb005dc4f22a94ad8920f90f4c9b72de34a7f8
MD5 8a9cee98405f3aa96b5728aaa4a936a5
BLAKE2b-256 e6eba7cbef285e2d989cf3221a211d9534c8fa41c86df68732c72a5462a5d0fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for import_linter_forbid_external_packages-0.1.0-py3-none-any.whl:

Publisher: build_and_publish.yaml on samueljsb/import-linter-forbid-external-packages

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page