mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-15 07:53:23 -05:00
chore: declare scripts as a package
The modules are run directly, run with -m, and imported by the tests and the type checker. Only the first form puts this directory on the path, so the package marker carries the bootstrap the other two need; without it the first sibling import fails. Three tests hold the three forms open.
This commit is contained in:
1 parent
b8bdeec5ce
commit
306637d90e
2 files changed
+50
No files matched your search
@@ -0,0 +1,19 @@
|
||||
"""Build and verification tooling for the collection.
|
||||
|
||||
These modules are run as scripts (``python scripts/verify.py``), as modules
|
||||
(``python -m scripts.scraper.libretro_scraper``), and imported as a package by
|
||||
the tests and the type checker. The first form puts this directory on the path
|
||||
itself; the other two do not, so importing the package adds it. Without that,
|
||||
``import scripts.common`` fails on the first sibling import it reaches, and
|
||||
every absolute import between siblings would have to be rewritten to be
|
||||
relative -a change that would break running a script directly.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
_HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
if _HERE not in sys.path:
|
||||
sys.path.insert(0, _HERE)
|
||||
Reference in new issue
Block a user