VOOZH about

URL: https://pypi.org/project/horse-with-no-namespace/

โ‡ฑ horse-with-no-namespace ยท PyPI


Skip to main content

horse-with-no-namespace 20260202.0

pip install horse-with-no-namespace

Latest release

Released:

No project description provided

Navigation

Verified details

These details have been verified by PyPI
Project links
Owner
GitHub Statistics
Maintainers
๐Ÿ‘ Avatar for davisagli from gravatar.com
davisagli

Unverified details

These details have not been verified by PyPI
Meta

Project description

๐ŸŽ Horse with no namespace

๐Ÿ‘ PyPI - Version
๐Ÿ‘ PyPI - Python Version


horse-with-no-namespace is a tool which converts pkg_resources namespace packages to be compatible with PEP 420 implicit namespace packages.

Why is it needed?

The Python ecosystem provides several implementations of namespace packages, which make it possible to split the modules within a single package to be distributed in multiple distribution packages.

See https://packaging.python.org/en/latest/guides/packaging-namespace-packages/ for more background on namespace packages and their various implementations.

The pkg_resources-style namespace packages are considered obsolete, but it is difficult to incrementally migrate a namespace using them to native namespace packages, because there are situations where not all of the packages will be found. For example, this happens if one package within the namespace uses pkg_resources-style namespace packages but another package uses one of the other styles, and they are not installed in the same path.

The goal of horse-with-no-namespace is to provide a temporary solution that can be installed to make things work during the interim period while existing releases of some packages in a namespace still use the pkg_resources style, but other packages are already in the process of being converted to native namespaces packages. Once all packages in the namespace have been converted, horse-with-no-namespace is no longer needed.

How does it work?

horse-with-no-namespace interferes with both of the ways that pkg_resources-style namespace packages can be loaded.

  • For packages that are installed into a site-packages directory, there is a file ending in -nspkg.pth which is automatically loaded by Python's site module to create the namespace package in sys.modules. horse-with-no-namespace removes these namespace packages from sys.modules, so that the namespace packages can be reloaded later without using the .pth machinery. (horse-with-no-namespace actually uses a similar hack with its own .pth file to do this, but arranges for it to be loaded later.)
  • For packages imported from somewhere else in sys.path, pkg_resources-style namespace packages are set up by a call to pkg_resources.declare_namespace from __init__.py. horse-with-no-namespace replaces pkg_resources.declare_namespace with a shim that instead initializes a pkgutil-style namespace package (which is compatible with native namespace packages).

Can I use it with Buildout?

This approach can also help with packages installed using zc.buildout. However, horse-with-no-namespace itself must not be installed using Buildout, but should be installed using pip into the same virtualenv where zc.buildout is installed. If horse-with-no-namespace is installed using Buildout, then its .pth file will not be loaded, since it is not in the site-packages folder.

How can I suppress the log line that is emitted to stderr on startup?

Set the environment variable PYTHONWARNINGS=ignore:::horse_with_no_namespace.

Installation

pip install horse-with-no-namespace

License

horse-with-no-namespace is distributed under the terms of the MIT license.

Project details

Verified details

These details have been verified by PyPI
Project links
Owner
GitHub Statistics
Maintainers
๐Ÿ‘ Avatar for davisagli from gravatar.com
davisagli

Unverified details

These details have not been verified by PyPI
Meta

Download files

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

Source Distribution

horse_with_no_namespace-20260202.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

Filter files by name, interpreter, ABI, and platform.

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

Copy a direct link to the current filters

horse_with_no_namespace-20260202.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file horse_with_no_namespace-20260202.0.tar.gz.

File metadata

File hashes

Hashes for horse_with_no_namespace-20260202.0.tar.gz
Algorithm Hash digest
SHA256 46ec2798612c9f2d0d487477e85f3cca62e79d00deaf29b0f59a0adab2012183
MD5 0b9842937036e2a69913683fd0dd6d5c
BLAKE2b-256 0736c9c42e7a800e8a2efcfb36731f2eb87ea024eb2f0ce9d2b709d00c8880b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for horse_with_no_namespace-20260202.0.tar.gz:

Publisher: publish.yml on davisagli/horse-with-no-namespace

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

File details

Details for the file horse_with_no_namespace-20260202.0-py3-none-any.whl.

File metadata

File hashes

Hashes for horse_with_no_namespace-20260202.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f4049cd460f2abdee4384531b2ec80a8b9420859d37037545169ec7c3ca37fe4
MD5 d340fe38c97ae23ef15b0a0a3ae6a4e2
BLAKE2b-256 c9a264f05feca90f9f8c5d8994a63375f0fbbeb8d305a33dd7e3a2ca36fa8cf0

See more details on using hashes here.

Provenance

The following attestation bundles were made for horse_with_no_namespace-20260202.0-py3-none-any.whl:

Publisher: publish.yml on davisagli/horse-with-no-namespace

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

Supported by

๐Ÿ‘ Image
AWS Cloud computing and Security Sponsor ๐Ÿ‘ Image
Datadog Monitoring ๐Ÿ‘ Image
Depot Continuous Integration ๐Ÿ‘ Image
Fastly CDN ๐Ÿ‘ Image
Google Download Analytics ๐Ÿ‘ Image
Pingdom Monitoring ๐Ÿ‘ Image
Sentry Error logging ๐Ÿ‘ Image
StatusPage Status page