Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2812c81

Browse files
authoredMay 30, 2024
Merge pull request #2889 from pygame-community/ankith26-docs-dev
Fix `python -m docs` dev time convenience command
2 parents 4dbcd4f + 289815a commit 2812c81

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed
 

‎docs/__main__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import platform
22

3-
from pygame.docs.serve import main as serve
4-
from pygame.docs.static import main as static
3+
# use relative import here and not absolute, so that `python -m docs` works at
4+
# development time
5+
from .serve import main as serve
6+
from .static import main as static
57

68

79
def main():

‎docs/serve.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
import webbrowser
55
from http.server import ThreadingHTTPServer, SimpleHTTPRequestHandler
66

7-
from pygame.docs import PKG_DIR, has_local_docs
7+
# use relative import here and not absolute, so that `python -m docs` works at
8+
# development time
9+
from . import PKG_DIR, has_local_docs
810

911

1012
class DocsHandler(SimpleHTTPRequestHandler):

‎docs/static.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import webbrowser
22

3-
from pygame.docs import PKG_DIR
3+
# use relative import here and not absolute, so that `python -m docs` works at
4+
# development time
5+
from . import PKG_DIR
46

57

68
def open_docs():

0 commit comments

Comments
 (0)
Please sign in to comment.