docs: document more experiments with overlays in docs

This commit is contained in:
Dima Gerasimov 2023-12-22 02:46:41 +00:00 committed by karlicoss
parent adbc0e73a2
commit a8f8858cb1
7 changed files with 196 additions and 2 deletions

View file

@ -0,0 +1,17 @@
from setuptools import setup, find_namespace_packages # type: ignore
def main() -> None:
pkgs = find_namespace_packages('src')
pkg = min(pkgs)
setup(
name='hpi-overlay2',
zip_safe=False,
packages=pkgs,
package_dir={'': 'src'},
package_data={pkg: ['py.typed']},
)
if __name__ == '__main__':
main()

View file

View file

@ -0,0 +1,13 @@
print(f'[overlay2] {__name__} hello')
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
def hack_gdpr_module() -> None:
from . import gdpr
tweets_orig = gdpr.tweets
def tweets_patched():
return [t.replace('gdpr', 'GDPR') for t in tweets_orig()]
gdpr.tweets = tweets_patched
hack_gdpr_module()