diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4259262..c6dab70 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -7,12 +7,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.6', '3.7', '3.8', '3.9', '3.10' ] + python-version: [ '3.7', '3.8', '3.9', '3.10' ] name: Python ${{ matrix.python-version }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup timezone uses: zcong1993/setup-timezone@master @@ -20,7 +20,7 @@ jobs: timezone: UTC - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/README.md b/README.md index eba75c8..f09f86d 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,12 @@ from your own machine (see [usage](#Usage) below). ### On PythonAnywhere In a PythonAnywhere Bash console, run: - pip3.9 install --user pythonanywhere + pip3.10 install --user pythonanywhere If there is no `python3.9` on your PythonAnywhere account, you should upgrade your account to the newest system image. See [here](https://help.pythonanywhere.com/pages/ChangingSystemImage) how to do that. -`pa` works with python 3.6, 3.7 and 3.8, but we recommend using the latest system image. +`pa` works with python 3.7, 3.8 and 3.9, but we recommend using the latest system image. ### On your own machine Install the `pythonanywhere` package from [PyPI](https://pypi.org/project/pythonanywhere/). @@ -61,7 +61,7 @@ Some legacy [scripts](https://github.com/pythonanywhere/helper_scripts/blob/mast Pull requests are welcome! You'll find tests in the [tests](https://github.com/pythonanywhere/helper_scripts/blob/master/tests) folder... # prep your dev environment - mkvirtualenv --python=python3.6 helper_scripts + mkvirtualenv --python=python3.10 helper_scripts pip install -r requirements.txt pip install -e . diff --git a/cli/django.py b/cli/django.py index 0a59f79..2d81ce3 100644 --- a/cli/django.py +++ b/cli/django.py @@ -19,10 +19,10 @@ def autoconfigure( help="Domain name, eg www.mydomain.com", ), python_version: str = typer.Option( - "3.6", + "3.7", "-p", "--python-version", - help="Python version, eg '3.8'", + help="Python version, eg '3.9'", ), nuke: bool = typer.Option( False, diff --git a/cli/webapp.py b/cli/webapp.py index b75ac60..a8428b4 100644 --- a/cli/webapp.py +++ b/cli/webapp.py @@ -22,10 +22,10 @@ def create( help="Domain name, eg www.mydomain.com", ), python_version: str = typer.Option( - "3.6", + "3.7", "-p", "--python-version", - help="Python version, eg '3.8'", + help="Python version, eg '3.9'", ), nuke: bool = typer.Option( False, diff --git a/pythonanywhere/api/base.py b/pythonanywhere/api/base.py index dd0505c..9e420f4 100644 --- a/pythonanywhere/api/base.py +++ b/pythonanywhere/api/base.py @@ -3,7 +3,6 @@ import requests PYTHON_VERSIONS = { - "3.6": "python36", "3.7": "python37", "3.8": "python38", "3.9": "python39", diff --git a/pythonanywhere/snakesay.py b/pythonanywhere/snakesay.py index eab09b4..f6f197c 100755 --- a/pythonanywhere/snakesay.py +++ b/pythonanywhere/snakesay.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3.6 +#!/usr/bin/env python3.7 import sys import textwrap diff --git a/requirements.txt b/requirements.txt index 6008f69..159d3fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,17 +1,17 @@ -python-dateutil==2.8.1 -click==8.0.3 +python-dateutil==2.8.2 +click==8.1.3 docopt==0.6.2 -importlib-metadata==4.8.3 +importlib-metadata==4.13.0 packaging -psutil==5.7.0 -pytest==6.2.5 -pytest-cov==3.0.0 -pytest-mock==3.6.1 -pytest-mypy==0.6.2 -requests==2.26.0 -responses==0.16.0 +psutil==5.9.4 +pytest==7.2.0 +pytest-cov==4.0.0 +pytest-mock==3.10.0 +pytest-mypy==0.10.3 +requests==2.28.2 +responses==0.22.0 schema==0.7.2 -tabulate==0.8.9 -typer==0.4.0 -urllib3==1.26.7 +tabulate==0.9.0 +typer==0.7.0 +urllib3==1.26.14 virtualenvwrapper==4.8.4 diff --git a/scripts/pa_autoconfigure_django.py b/scripts/pa_autoconfigure_django.py index 5c41ecf..255f671 100755 --- a/scripts/pa_autoconfigure_django.py +++ b/scripts/pa_autoconfigure_django.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Autoconfigure a Django project from on a github URL. - downloads the repo @@ -13,7 +13,7 @@ Options: --branch= Branch name in case of multiple branches [default: None] --domain= Domain name, eg www.mydomain.com [default: your-username.pythonanywhere.com] - --python= Python version, eg "3.8" [default: 3.6] + --python= Python version, eg "3.8" [default: 3.7] --nuke *Irrevocably* delete any existing web app config on this domain. Irrevocably. """ diff --git a/scripts/pa_create_scheduled_task.py b/scripts/pa_create_scheduled_task.py index d3dd937..6590fec 100755 --- a/scripts/pa_create_scheduled_task.py +++ b/scripts/pa_create_scheduled_task.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Create a scheduled task. Two categories of tasks are available: daily and hourly. diff --git a/scripts/pa_create_webapp_with_virtualenv.py b/scripts/pa_create_webapp_with_virtualenv.py index 99dd899..c2cdf46 100755 --- a/scripts/pa_create_webapp_with_virtualenv.py +++ b/scripts/pa_create_webapp_with_virtualenv.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Create a web app with a virtualenv - creates a simple hello world web app @@ -11,7 +11,7 @@ Options: --domain= Domain name, eg www.mydomain.com [default: your-username.pythonanywhere.com] - --python= Python version, eg "3.8" [default: 3.6] + --python= Python version, eg "3.8" [default: 3.7] --nuke *Irrevocably* delete any existing web app config on this domain. Irrevocably. """ diff --git a/scripts/pa_delete_scheduled_task.py b/scripts/pa_delete_scheduled_task.py index 84122b7..b1103cb 100755 --- a/scripts/pa_delete_scheduled_task.py +++ b/scripts/pa_delete_scheduled_task.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Delete scheduled task(s) by id or nuke'em all. Usage: diff --git a/scripts/pa_delete_webapp_logs.py b/scripts/pa_delete_webapp_logs.py index a828912..d854142 100755 --- a/scripts/pa_delete_webapp_logs.py +++ b/scripts/pa_delete_webapp_logs.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Deletes webapp logs. - gets list of logs via api diff --git a/scripts/pa_get_scheduled_task_specs.py b/scripts/pa_get_scheduled_task_specs.py index 39d20ea..1332b68 100755 --- a/scripts/pa_get_scheduled_task_specs.py +++ b/scripts/pa_get_scheduled_task_specs.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Get current scheduled task's specs file by task id. Available specs are: command, enabled, interval, hour, minute, printable-time, diff --git a/scripts/pa_get_scheduled_tasks_list.py b/scripts/pa_get_scheduled_tasks_list.py index e5236c7..7bfcc4c 100755 --- a/scripts/pa_get_scheduled_tasks_list.py +++ b/scripts/pa_get_scheduled_tasks_list.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Get list of user's scheduled tasks as a table with columns: id, interval, at (hour:minute/minute past), status (enabled/disabled), command. diff --git a/scripts/pa_install_webapp_letsencrypt_ssl.py b/scripts/pa_install_webapp_letsencrypt_ssl.py index 66038cb..7fa13aa 100755 --- a/scripts/pa_install_webapp_letsencrypt_ssl.py +++ b/scripts/pa_install_webapp_letsencrypt_ssl.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Set the HTTPS certificate and private key for a website, assuming that these have been generated by the dehydrated script that gets them from Let's Encrypt, and that they're in the standard place. This script should normally only be run on PythonAnywhere. diff --git a/scripts/pa_install_webapp_ssl.py b/scripts/pa_install_webapp_ssl.py index ca42eba..44faaf4 100755 --- a/scripts/pa_install_webapp_ssl.py +++ b/scripts/pa_install_webapp_ssl.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Set the HTTPS certificate and private key for a website to the contents of two files, and reload the site. Usage: diff --git a/scripts/pa_reload_webapp.py b/scripts/pa_reload_webapp.py index 0119aa0..61cfed7 100755 --- a/scripts/pa_reload_webapp.py +++ b/scripts/pa_reload_webapp.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Reloads the given site Usage: diff --git a/scripts/pa_start_django_webapp_with_virtualenv.py b/scripts/pa_start_django_webapp_with_virtualenv.py index c857a72..017b51d 100755 --- a/scripts/pa_start_django_webapp_with_virtualenv.py +++ b/scripts/pa_start_django_webapp_with_virtualenv.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Create a new Django webapp with a virtualenv. Defaults to your free domain, the latest version of Django and Python 3.6 @@ -8,7 +8,7 @@ Options: --domain= Domain name, eg www.mydomain.com [default: your-username.pythonanywhere.com] --django= Django version, eg "1.8.4" [default: latest] - --python= Python version, eg "2.7" [default: 3.6] + --python= Python version, eg "2.7" [default: 3.7] --nuke *Irrevocably* delete any existing web app config on this domain. Irrevocably. """ diff --git a/scripts/pa_update_scheduled_task.py b/scripts/pa_update_scheduled_task.py index efc2910..0641010 100755 --- a/scripts/pa_update_scheduled_task.py +++ b/scripts/pa_update_scheduled_task.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3.6 +#!/usr/bin/python3.7 """Update a scheduled task using id and proper specs. Note that logfile name will change after updating the task but it won't be diff --git a/setup.py b/setup.py index ee0b8a4..0142bd3 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name="pythonanywhere", - version="0.10.3", + version="0.11.0", description="PythonAnywhere helper tools for users", long_description=long_description, long_description_content_type="text/markdown", @@ -26,7 +26,6 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.6", ], keywords="pythonanywhere api cloud web hosting", packages=["cli", "pythonanywhere", "pythonanywhere.api"], @@ -40,7 +39,7 @@ "typer", ], extras_require={}, - python_requires=">=3.6", + python_requires=">=3.7", package_data={}, data_files=[], entry_points={}, diff --git a/tests/test_virtualenvs.py b/tests/test_virtualenvs.py index 2eb860c..7edc3cc 100644 --- a/tests/test_virtualenvs.py +++ b/tests/test_virtualenvs.py @@ -12,7 +12,7 @@ def test_path(self, virtualenvs_folder): assert v.path == Path(virtualenvs_folder) / "domain.com" def test_create_uses_bash_and_sources_virtualenvwrapper(self, mock_subprocess, virtualenvs_folder): - v = Virtualenv("domain.com", "3.6") + v = Virtualenv("domain.com", "3.7") v.create(nuke=False) args, kwargs = mock_subprocess.check_call.call_args command_list = args[0] @@ -20,15 +20,15 @@ def test_create_uses_bash_and_sources_virtualenvwrapper(self, mock_subprocess, v assert command_list[2].startswith("source virtualenvwrapper.sh && mkvirtualenv") def test_create_calls_mkvirtualenv_with_python_version_and_domain(self, mock_subprocess, virtualenvs_folder): - v = Virtualenv("domain.com", "3.6") + v = Virtualenv("domain.com", "3.7") v.create(nuke=False) args, kwargs = mock_subprocess.check_call.call_args command_list = args[0] bash_command = command_list[2] - assert "mkvirtualenv --python=python3.6 domain.com" in bash_command + assert "mkvirtualenv --python=python3.7 domain.com" in bash_command def test_nuke_option_deletes_virtualenv(self, mock_subprocess, virtualenvs_folder): - v = Virtualenv("domain.com", "3.6") + v = Virtualenv("domain.com", "3.7") v.create(nuke=True) args, kwargs = mock_subprocess.check_call.call_args command_list = args[0] @@ -36,7 +36,7 @@ def test_nuke_option_deletes_virtualenv(self, mock_subprocess, virtualenvs_folde assert command_list[2].startswith("source virtualenvwrapper.sh && rmvirtualenv domain.com") def test_install_pip_installs_each_package(self, mock_subprocess, virtualenvs_folder): - v = Virtualenv("domain.com", "3.6") + v = Virtualenv("domain.com", "3.7") v.create(nuke=False) v.pip_install("package1 package2==1.1.2") args, kwargs = mock_subprocess.check_call.call_args_list[-1]