Skip to main content

🐎 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.

Metadata

Release files for horse-with-no-namespace 20260202.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for horse-with-no-namespace 20260202.0
File Size Uploaded Provenance Actions
horse_with_no_namespace-20260202.0.tar.gz 6.1 kB With provenance Details for horse_with_no_namespace-20260202.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for horse-with-no-namespace 20260202.0
File Interpreter ABI Platform Actions
horse_with_no_namespace-20260202.0-py3-none-any.whl Python 3 none any Details for horse_with_no_namespace-20260202.0-py3-none-any.whl

Total release size: 12.3 kB

Release files / horse_with_no_namespace-20260202.0.tar.gz

Download URL horse_with_no_namespace-20260202.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
46ec2798612c9f2d0d487477e85f3cca62e79d00deaf29b0f59a0adab2012183
BLAKE2b-256 checksum
How to use checksums
0736c9c42e7a800e8a2efcfb36731f2eb87ea024eb2f0ce9d2b709d00c8880b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Feb 3, 2026.

Transparency log

Release files / horse_with_no_namespace-20260202.0-py3-none-any.whl

Download URL horse_with_no_namespace-20260202.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4049cd460f2abdee4384531b2ec80a8b9420859d37037545169ec7c3ca37fe4
BLAKE2b-256 checksum
How to use checksums
c9a264f05feca90f9f8c5d8994a63375f0fbbeb8d305a33dd7e3a2ca36fa8cf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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 Feb 3, 2026.

Transparency log

Security for horse-with-no-namespace 20260202.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.

Select from 2 files

Attestation for horse_with_no_namespace-20260202.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 Feb 3, 2026.

Transparency log

A 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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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