docs: document more experiments with overlays in docs
This commit is contained in:
parent
adbc0e73a2
commit
a8f8858cb1
7 changed files with 196 additions and 2 deletions
17
doc/overlays/overlay3/setup.py
Normal file
17
doc/overlays/overlay3/setup.py
Normal 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-overlay3',
|
||||
zip_safe=False,
|
||||
packages=pkgs,
|
||||
package_dir={'': 'src'},
|
||||
package_data={pkg: ['py.typed']},
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
0
doc/overlays/overlay3/src/my/py.typed
Normal file
0
doc/overlays/overlay3/src/my/py.typed
Normal file
9
doc/overlays/overlay3/src/my/twitter/_hook.py
Normal file
9
doc/overlays/overlay3/src/my/twitter/_hook.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import importhook
|
||||
|
||||
@importhook.on_import('my.twitter.gdpr')
|
||||
def on_import(gdpr):
|
||||
print("EXECUTING IMPORT HOOK!")
|
||||
tweets_orig = gdpr.tweets
|
||||
def tweets_patched():
|
||||
return [t.replace('gdpr', 'GDPR') for t in tweets_orig()]
|
||||
gdpr.tweets = tweets_patched
|
Loading…
Add table
Add a link
Reference in a new issue