sanic-org / sanic-testing

Test clients for Sanic

Home Page:https://sanic.dev/en/plugins/sanic-testing/getting-started.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to install sanic_testing and sanic in Python 3.6

samdbmg opened this issue · comments

Hi,

It looks like sanic and sanic-testing can't be co-installed on Python 3.6, I assume because sanic 20.12 requires httpx==0.15.4 but there's no version of sanic-testing that supports a version that old?

I can apply the obvious workaround to either stop using such an old version of Python, or use "sanic_testing; python_version > '3.6'", and some conditional importing to make it work, but it might be worth dropping the 3.6 classifier from https://github.com/sanic-org/sanic-testing/blob/main/setup.py#L44 to make it more obvious it isn't going to work?

Cheers!

python3 --version
Python 3.6.12python3 -m venv testvenvsource testvenv/bin/activatepip install -U pip
Looking in indexes: https://pypi.org/simple, https://artifactory.virt.ch.bbc.co.uk/artifactory/api/pypi/ap-python/simple
Collecting pip
  Using cached https://files.pythonhosted.org/packages/ca/31/b88ef447d595963c01060998cb329251648acf4a067721b0452c45527eb8/pip-21.2.4-py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 18.1
    Uninstalling pip-18.1:
      Successfully uninstalled pip-18.1
Successfully installed pip-21.2.4
pip install sanic sanic-testing
Looking in indexes: https://pypi.org/simple, https://artifactory.virt.ch.bbc.co.uk/artifactory/api/pypi/ap-python/simple
Collecting sanic
  Using cached sanic-20.12.3-py3-none-any.whl (80 kB)
Collecting sanic-testing
  Using cached sanic_testing-0.6.0-py3-none-any.whl (7.2 kB)
Collecting uvloop<0.15.0,>=0.5.3
  Using cached uvloop-0.14.0-cp36-cp36m-macosx_10_11_x86_64.whl (1.5 MB)
Collecting httptools>=0.0.10
  Using cached httptools-0.3.0-cp36-cp36m-macosx_10_9_x86_64.whl (155 kB)
Collecting ujson>=1.35
  Using cached ujson-4.1.0-cp36-cp36m-macosx_10_14_x86_64.whl (45 kB)
Collecting aiofiles>=0.6.0
  Using cached aiofiles-0.7.0-py3-none-any.whl (13 kB)
Collecting httpx==0.15.4
  Using cached httpx-0.15.4-py3-none-any.whl (65 kB)
Collecting multidict<6.0,>=5.0
  Using cached multidict-5.1.0-cp36-cp36m-macosx_10_14_x86_64.whl (49 kB)
Collecting websockets<9.0,>=8.1
  Using cached websockets-8.1-cp36-cp36m-macosx_10_6_intel.whl (66 kB)
Collecting httpcore==0.11.*
  Using cached httpcore-0.11.1-py3-none-any.whl (52 kB)
Collecting rfc3986[idna2008]<2,>=1.3
  Using cached rfc3986-1.5.0-py2.py3-none-any.whl (31 kB)
Collecting sniffio
  Using cached sniffio-1.2.0-py3-none-any.whl (10 kB)
Collecting certifi
  Using cached certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
Collecting h11<0.10,>=0.8
  Using cached h11-0.9.0-py2.py3-none-any.whl (53 kB)
Collecting contextvars>=2.1
  Using cached contextvars-2.4-py3-none-any.whl
Collecting sanic-testing
  Using cached sanic_testing-0.4.0-py3-none-any.whl (7.1 kB)
  Using cached sanic_testing-0.3.1-py3-none-any.whl (6.3 kB)
  Using cached sanic_testing-0.3.0-py3-none-any.whl (6.3 kB)
  Using cached sanic_testing-0.2.1-py3-none-any.whl (6.0 kB)
  Using cached sanic_testing-0.2.0-py3-none-any.whl (6.0 kB)
  Using cached sanic_testing-0.1.2-py3-none-any.whl (5.7 kB)
  Using cached sanic_testing-0.1.1-py3-none-any.whl (5.6 kB)
  Using cached sanic_testing-0.1.0-py3-none-any.whl (5.5 kB)
INFO: pip is looking at multiple versions of sniffio to determine which version is compatible with other requirements. This could take a while.
Collecting sniffio
  Using cached sniffio-1.1.0-py3-none-any.whl (4.5 kB)
  Downloading sniffio-1.0.0-py3-none-any.whl (4.4 kB)
INFO: pip is looking at multiple versions of httpcore to determine which version is compatible with other requirements. This could take a while.
Collecting httpcore==0.11.*
  Downloading httpcore-0.11.0-py3-none-any.whl (52 kB)
     |████████████████████████████████| 52 kB 628 kB/s 
INFO: pip is looking at multiple versions of httpx to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of <Python from Requires-Python> to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of sanic to determine which version is compatible with other requirements. This could take a while.
Collecting sanic
  Using cached sanic-20.12.2-py3-none-any.whl (79 kB)
INFO: pip is looking at multiple versions of sniffio to determine which version is compatible with other requirements. This could take a while.
  Using cached sanic-20.12.1-py3-none-any.whl (79 kB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
  Using cached sanic-20.12.0-py3-none-any.whl (79 kB)
INFO: pip is looking at multiple versions of httpcore to determine which version is compatible with other requirements. This could take a while.
<snip very long output - gave up after 5min>

This also occurs for Python 3.7, where sanic installs httpx==0.19 and sanic-testing installs httpx==0.18.2

Related to #19

Sorry for the late reply.

It looks like sanic and sanic-testing can't be co-installed on Python 3.6, I assume because sanic 20.12 requires httpx==0.15.4 but there's no version of sanic-testing that supports a version that old?

In v20.12 and earlier, it is available in Sanic itself. Nothing to install, just start using app.test_client.

it might be worth dropping the 3.6 classifier

Yup. We do not support that anymore. We should get that done.

This was fixed and merged in #25