Forbid External Packages contract
A contract for [import-linter] that forbids imports of external (i.e. not in the standard library) packages.
Usage
-
Install this package in the same virtual environment as import-linter.
-
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_packagesmust be enabled for this contract type to have any effect. -
Create a contract with
type = forbid_external_packages. This contract must specify thesource_modulesvalue, as documented for the built-inforbiddencontract 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.*
Metadata
Release files for import-linter-forbid-external-packages 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| import_linter_forbid_external_packages-0.1.0.tar.gz | 3.4 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| import_linter_forbid_external_packages-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.2 kB
Release files / import_linter_forbid_external_packages-0.1.0.tar.gz
| Download URL | import_linter_forbid_external_packages-0.1.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d657ce8e7d6fe504a4d5a5be89a0817459d4fe367c834ea8e43566ebb4f99cd6
|
|
BLAKE2b-256 checksum How to use checksums |
5ff1a7e60f52d33974932e46849030e5fca65e29db75f814bd1674e28793ed19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.
Transparency logRelease files / import_linter_forbid_external_packages-0.1.0-py3-none-any.whl
| Download URL | import_linter_forbid_external_packages-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
01ace407bfb7e4b5c61ae63fe7fb005dc4f22a94ad8920f90f4c9b72de34a7f8
|
|
BLAKE2b-256 checksum How to use checksums |
e6eba7cbef285e2d989cf3221a211d9534c8fa41c86df68732c72a5462a5d0fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.
Transparency logSecurity for import-linter-forbid-external-packages 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for import_linter_forbid_external_packages-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.