Skip to main content

Vendorize packages from PyPI

Project description

python-vendorize allows pure-Python dependencies to be vendorized: that is, the Python source of the dependency is copied into your own package. Best used for small, pure-Python dependencies to avoid version conflicts when other packages require a different version of the same dependency.

Dependencies you want vendorizing should be specified in vendorize.ini. In the vendorize section, the target option describes where vendorized dependencies should be placed. Each dependency should have its own section named require:${REQUIREMENT}. $REQUIREMENT can be anything that pip would understand, such as a package name, a package name with version constraints or an URL. Dependencies can then be vendorized using python-vendorize.

For instance, suppose I want to vendorize six so it can be used from the package hello. The directory structure would be something like:

- hello
  - __init__.py
- setup.py
- vendorize.ini

vendorize.ini might look something like:

[vendorize]
target=hello/_vendor
[require:six]

I can then run python-vendorize in the same directory as vendorize.ini. The directory structure would then be something like:

- hello
  - _vendor
    - six.dist-info
      - ...
    - __init__.py
    - six.py
  - __init__.py
- setup.py
- vendorize.ini

In hello/__init__.py, six can be imported from _vendor:

from ._vendor import six

Installation

pip install vendorize

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

vendorize-0.1.0.tar.gz (12.6 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: vendorize-0.1.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for vendorize-0.1.0.tar.gz
Algorithm Hash digest
SHA256 25f42cbcad74cb9612e51d0c5ffe3875df3f883436c7413dbe103cac5c2bce25
MD5 fbaf51f0fc3407ecfa74507017f10ab5
BLAKE2b-256 fe4eedc45649b99e676e85930aa8fc46bb34dbac0a2505a9a7e2ff424fde0f64

See more details on using hashes here.

Supported by

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