Skip to content

Commit bcd9dad

Browse files
Updates structure and imports of api interface and fixes tests.
As a side effect of change of test run order it was uncovered that virtualenvs_folder fixture was leaking environment variable between tests. Fix uncovered that that fixture is required in many other tests.
1 parent 0a26c26 commit bcd9dad

17 files changed

+307
-174
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import getpass
55

6-
from pythonanywhere.api import call_api, get_api_endpoint
6+
from pythonanywhere.api.base import call_api, get_api_endpoint
77

88

99
class Schedule:

pythonanywhere/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
22
import uuid
33

4-
from pythonanywhere.api import Webapp
4+
from pythonanywhere.api.webapp import Webapp
55
from pythonanywhere.exceptions import SanityException
66
from pythonanywhere.virtualenvs import Virtualenv
77
from pythonanywhere.launch_bash_in_virtualenv import launch_bash_in_virtualenv

pythonanywhere/project.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pathlib import Path
22

3-
from pythonanywhere.api import Webapp
3+
from pythonanywhere.api.webapp import Webapp
44
from pythonanywhere.virtualenvs import Virtualenv
55

66
class Project:

pythonanywhere/task.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import logging
66

7-
from pythonanywhere.schedule_api import Schedule
7+
from pythonanywhere.api.schedule import Schedule
88
from pythonanywhere.snakesay import snakesay
99

1010
logger = logging.getLogger(name=__name__)
@@ -33,7 +33,7 @@ class Task:
3333
defined by user.
3434
3535
`Task` class is API agnostic meaning all API calls are made using the
36-
`pythonanywhere.schedule_api.Schedule` interface via `Task.schedule`
36+
`pythonanywhere.api.schedule.Schedule` interface via `Task.schedule`
3737
attribute."""
3838

3939
def __init__(self):

pythonanywhere/task.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ from typing import List, Optional, Type, TypeVar, Union
22

33
from typing_extensions import Literal
44

5-
from pythonanywhere.schedule_api import Schedule
5+
from pythonanywhere.api.schedule import Schedule
66

77
T = TypeVar("T", bound="Task")
88

scripts/pa_delete_webapp_logs.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
"""
1515

1616
from docopt import docopt
17-
import getpass
18-
import os
1917

20-
from pythonanywhere.api import Webapp
18+
from pythonanywhere.api.webapp import Webapp
2119
from pythonanywhere.snakesay import snakesay
2220
from pythonanywhere.utils import ensure_domain
2321

scripts/pa_install_webapp_letsencrypt_ssl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import os
1818
import sys
1919

20-
from pythonanywhere.api import Webapp
20+
from pythonanywhere.api.webapp import Webapp
2121
from pythonanywhere.snakesay import snakesay
2222

2323

scripts/pa_install_webapp_ssl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import os
2020
import sys
2121

22-
from pythonanywhere.api import Webapp
22+
from pythonanywhere.api.webapp import Webapp
2323
from pythonanywhere.snakesay import snakesay
2424

2525

scripts/pa_reload_webapp.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
"""
1010

1111
from docopt import docopt
12-
import os
13-
import sys
1412

15-
from pythonanywhere.api import Webapp
13+
from pythonanywhere.api.webapp import Webapp
1614
from pythonanywhere.snakesay import snakesay
1715

1816

0 commit comments

Comments
 (0)