Skip to content

Commit

Permalink
Drop Python 3.6 (#535)
Browse files Browse the repository at this point in the history
* Remove Python 3.6 related code
* Remove Python 3.6 from matrix strategy
* Unpin `twine` version
* Bump `black` version
* Make black target version 3.7
* Unpin `wheel` dependency
* Bump `mkdocs` to 1.3.0
* Unpin `mkdocs`
* Downpin flake8 to 3.9.2
* Pin Jinja2 to 3.0.3
* Attempt: bump pytest-httpbin to 1.0.2
* Pin werkzeug
* Add note about 3.7+ in README/docs

Co-authored-by: Michael Oliver <michael@michaeloliver.dev>
Co-authored-by: Florimond Manca <florimond.manca@protonmail.com>
  • Loading branch information
3 people committed Apr 6, 2022
1 parent 44b8eed commit 1bf9cf2
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-suite.yml
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: "actions/checkout@v2"
Expand Down
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -23,6 +23,10 @@ Some things HTTP Core does do:
* Provides both sync and async interfaces.
* Async backend support for `asyncio` and `trio`.

## Requirements

Python 3.7+

## Installation

For HTTP/1.1 only support, install with:
Expand Down
4 changes: 4 additions & 0 deletions docs/index.md
Expand Up @@ -23,6 +23,10 @@ Some things HTTP Core does do:
* Provides both sync and async interfaces.
* Async backend support for `asyncio` and `trio`.

## Requirements

Python 3.7+

## Installation

For HTTP/1.1 only support, install with:
Expand Down
2 changes: 1 addition & 1 deletion httpcore/_async/interfaces.py
@@ -1,6 +1,6 @@
from contextlib import asynccontextmanager
from typing import AsyncIterator, Optional, Union

from .._compat import asynccontextmanager
from .._models import (
URL,
Origin,
Expand Down
6 changes: 0 additions & 6 deletions httpcore/_compat.py

This file was deleted.

2 changes: 1 addition & 1 deletion httpcore/_sync/interfaces.py
@@ -1,6 +1,6 @@
from contextlib import contextmanager
from typing import Iterator, Optional, Union

from contextlib import contextmanager
from .._models import (
URL,
Origin,
Expand Down
12 changes: 7 additions & 5 deletions requirements.txt
Expand Up @@ -4,25 +4,27 @@
trio==0.19.0

# Docs
mkdocs==1.2.3
mkdocs==1.3.0
mkdocs-autorefs==0.3.1
mkdocs-material==8.2.3
mkdocs-material-extensions==1.0.3
mkdocstrings==0.17.0
jinja2==3.0.3 # See: https://github.com/mkdocs/mkdocs/issues/2799

# Packaging
twine==3.8.0
wheel==0.37.1
twine
wheel

# Tests & Linting
anyio==3.5.0
autoflake==1.4
black==22.1.0
black==22.3.0
coverage==6.2
flake8==4.0.1
flake8==3.9.2 # See: https://github.com/PyCQA/flake8/pull/1438
isort==5.10.1
mypy==0.931
pytest==7.0.1
pytest-httpbin==1.0.1
pytest-trio==0.7.0
pytest-asyncio==0.16.0
werkzeug<2.1 # See: https://github.com/postmanlabs/httpbin/issues/673
2 changes: 1 addition & 1 deletion scripts/check
Expand Up @@ -9,7 +9,7 @@ export SOURCE_FILES="httpcore tests"
set -x

${PREFIX}isort --check --diff --project=httpcore $SOURCE_FILES
${PREFIX}black --exclude '/(_sync|sync_tests)/' --check --diff --target-version=py36 $SOURCE_FILES
${PREFIX}black --exclude '/(_sync|sync_tests)/' --check --diff --target-version=py37 $SOURCE_FILES
${PREFIX}flake8 $SOURCE_FILES
${PREFIX}mypy $SOURCE_FILES
scripts/unasync --check
2 changes: 1 addition & 1 deletion scripts/lint
Expand Up @@ -10,7 +10,7 @@ set -x

${PREFIX}autoflake --in-place --recursive --remove-all-unused-imports $SOURCE_FILES
${PREFIX}isort --project=httpcore $SOURCE_FILES
${PREFIX}black --target-version=py36 --exclude '/(_sync|sync_tests)/' $SOURCE_FILES
${PREFIX}black --target-version=py37 --exclude '/(_sync|sync_tests)/' $SOURCE_FILES

# Run unasync last because its `--check` mode is not aware of code formatters.
# (This means sync code isn't prettified, and that's mostly okay.)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -31,5 +31,5 @@ filterwarnings =
ignore:ssl\.PROTOCOL_TLS is deprecated:DeprecationWarning

[coverage:run]
omit = venv/*, httpcore/_sync/*, httpcore/_compat.py
omit = venv/*, httpcore/_sync/*
include = httpcore/*, tests/*
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -37,7 +37,7 @@ def get_packages(package):

setup(
name="httpcore",
python_requires=">=3.6",
python_requires=">=3.7",
version=get_version("httpcore"),
url="https://github.com/encode/httpcore",
project_urls={
Expand Down Expand Up @@ -73,7 +73,6 @@ def get_packages(package):
"Framework :: AsyncIO",
"Framework :: Trio",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand Down
3 changes: 1 addition & 2 deletions unasync.py
@@ -1,10 +1,9 @@
#!venv/bin/python
import re
import os
import re
import sys

SUBS = [
('from .._compat import asynccontextmanager', 'from contextlib import contextmanager'),
('from ..backends.auto import AutoBackend', 'from ..backends.sync import SyncBackend'),
('import trio as concurrency', 'from tests import concurrency'),
('AsyncByteStream', 'SyncByteStream'),
Expand Down

0 comments on commit 1bf9cf2

Please sign in to comment.