Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
ignore = E501,W191,C901,E265,E402,E117
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
name: CI

'on':
push:
branches: ["master"]
pull_request:

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9"]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -Ue .[test]
pip install -Ue .

- name: Run tests
run: |
python -m pytest

- name: Upload coverage to codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage to coveralls
if: success()
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
pip install coveralls
coveralls --service=github-actions

lint:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.9"]

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install flake8
run: pip install -U flake8

- name: Run flake8
run: |
flake8
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Build Status](https://travis-ci.org/spaceone/httoop.svg)](https://travis-ci.org/spaceone/httoop)
[![codecov](https://codecov.io/gh/spaceone/httoop/branch/master/graph/badge.svg)](https://codecov.io/gh/spaceone/httoop)
[![Build Status](https://github.com/spaceone/httoop/actions/workflows/ci.yml/badge.svg)](https://github.com/spaceone/httoop/actions/workflows/ci.yml)
[![Coverage](https://codecov.io/gh/spaceone/httoop/branch/master/graph/badge.svg)](https://codecov.io/gh/spaceone/httoop)
[![Code Climate](https://codeclimate.com/github/spaceone/httoop/badges/gpa.svg)](https://codeclimate.com/github/spaceone/httoop)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/spaceone/httoop/raw/master/LICENSE)

Expand Down
5 changes: 0 additions & 5 deletions httoop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,3 @@
'__version__', 'ServerProtocol', 'UserAgentHeader', 'ServerHeader',
'cache', 'ComposedRequest', 'ComposedResponse',
]

try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError: # pragma: no cover
__path___ = __import__('pkgutil').extend_path(__path__, __name__)
1 change: 1 addition & 0 deletions httoop/authentication/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
import re
from typing import Any, Dict, List, Tuple, Union

Expand Down
1 change: 1 addition & 0 deletions httoop/authentication/basic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

from __future__ import annotations
from binascii import Error as Base64Error
from typing import Dict, Union

Expand Down
1 change: 1 addition & 0 deletions httoop/authentication/digest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

from __future__ import annotations
from hashlib import md5, sha256
from typing import Callable, Dict, List, Tuple, Union

Expand Down
1 change: 1 addition & 0 deletions httoop/codecs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
u"""Module containing various codecs which are
common used in combination with HTTP.
"""
from __future__ import annotations

import inspect
from typing import Any, Type
Expand Down
1 change: 1 addition & 0 deletions httoop/codecs/application/hal_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"""JSON Hypertext Application Language (application/hal+json) codec."""

from __future__ import absolute_import
from __future__ import annotations

from typing import Any, Dict, Iterator, List, Optional, Union

Expand Down
1 change: 1 addition & 0 deletions httoop/codecs/application/json.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import annotations

from json import dumps as json_encode, loads as json_decode
from typing import Any, Dict, Optional, Union
Expand Down
1 change: 1 addition & 0 deletions httoop/codecs/application/x_www_form_urlencoded.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import Any, List, Optional, Tuple, Union

from httoop.codecs.codec import Codec
Expand Down
1 change: 1 addition & 0 deletions httoop/codecs/application/zlib.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

from __future__ import absolute_import
from __future__ import annotations

import zlib
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions httoop/codecs/codec.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import annotations

from typing import Any

Expand Down
1 change: 1 addition & 0 deletions httoop/codecs/message/http.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import annotations

from typing import Optional, Union

Expand Down
1 change: 1 addition & 0 deletions httoop/codecs/multipart/multipart.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

from __future__ import annotations
from typing import List, Optional

from httoop.codecs.codec import Codec
Expand Down
1 change: 1 addition & 0 deletions httoop/codecs/text/plain.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import Optional

from httoop.codecs.codec import Codec
Expand Down
1 change: 1 addition & 0 deletions httoop/date.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""

from __future__ import absolute_import
from __future__ import annotations

import locale
import time
Expand Down
1 change: 1 addition & 0 deletions httoop/gateway/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

.. seealso:: `PEP 333 <http://www.python.org/dev/peps/pep-0333/>`_
"""
from __future__ import annotations

from typing import Any, Callable, Dict, Iterator, Optional, Tuple, Union

Expand Down
1 change: 1 addition & 0 deletions httoop/header/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.. seealso:: :rfc:`2616#section-14`
"""
from __future__ import annotations

import re
from binascii import b2a_base64
Expand Down
1 change: 1 addition & 0 deletions httoop/header/headers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
import re
from typing import Any, Dict, List, Optional, Union

Expand Down
1 change: 1 addition & 0 deletions httoop/header/messaging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# TODO: Via, Server, User-Agent can contain comments → parse them
from __future__ import annotations
import re
from typing import Any, List, Optional

Expand Down
1 change: 1 addition & 0 deletions httoop/header/range.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

from __future__ import annotations
from io import BytesIO
from math import sqrt
from os import SEEK_END, SEEK_SET
Expand Down
1 change: 1 addition & 0 deletions httoop/header/security.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
"""Security related header."""
from __future__ import annotations

import re
from typing import List
Expand Down
1 change: 1 addition & 0 deletions httoop/messages/body.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

.. seealso:: :rfc:`2616#section-4.3`
"""
from __future__ import annotations

from io import BytesIO
from os import fstat
Expand Down
1 change: 1 addition & 0 deletions httoop/messages/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

.. seealso:: :rfc:`2616#section-4`
"""
from __future__ import annotations

import re
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions httoop/messages/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

.. seealso:: :rfc:`2616#section-4`
"""
from __future__ import annotations

import re
from typing import Any, Tuple, Union
Expand Down
1 change: 1 addition & 0 deletions httoop/meta.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""MetaClasses for HTTOOP types."""

from __future__ import absolute_import
from __future__ import annotations

from typing import Any, Dict, Tuple, Type, Union

Expand Down
1 change: 1 addition & 0 deletions httoop/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# TODO: translation API

from __future__ import absolute_import
from __future__ import annotations

from typing import Iterator, Optional, Tuple, Union

Expand Down
1 change: 1 addition & 0 deletions httoop/semantic/response.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import Any, Iterator, Union

from httoop.date import Date
Expand Down
1 change: 1 addition & 0 deletions httoop/server/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import Optional, Tuple, Union

import httoop.messages.request
Expand Down
1 change: 1 addition & 0 deletions httoop/status/client_error.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

from __future__ import annotations
from typing import Dict, Union

from httoop.status.types import StatusException
Expand Down
1 change: 1 addition & 0 deletions httoop/status/redirect.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

from __future__ import annotations
from typing import Dict, Optional, Tuple, Union

from httoop.status.types import StatusException
Expand Down
1 change: 1 addition & 0 deletions httoop/status/server_error.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

from __future__ import annotations
from typing import Dict, Union

from httoop.status.types import StatusException
Expand Down
1 change: 1 addition & 0 deletions httoop/status/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.. seealso:: :rfc:`2616#section-6.2`
.. seealso:: :rfc:`2616#section-10`
"""
from __future__ import annotations

import re
from typing import Any, Optional, Union
Expand Down
1 change: 1 addition & 0 deletions httoop/status/success.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-

from __future__ import annotations
from typing import Dict, Union

from httoop.status.types import StatusException
Expand Down
1 change: 1 addition & 0 deletions httoop/status/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

.. seealso:: :rfc:`2616#section-10`
"""
from __future__ import annotations

from typing import Any, Dict, Optional, Type, Union

Expand Down
1 change: 1 addition & 0 deletions httoop/uri/query_string.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
import stringprep
from typing import Optional, Tuple, Union

Expand Down
1 change: 1 addition & 0 deletions httoop/uri/type.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from __future__ import annotations
from typing import Any, Dict, Tuple, Type, Union

from httoop.meta import HTTPSemantic
Expand Down
1 change: 1 addition & 0 deletions httoop/uri/uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
# TODO: parse HTTP/1.0-';'-params?

from __future__ import annotations
import re
from socket import AF_INET, AF_INET6, error as SocketError, inet_ntop, inet_pton
from typing import Any, Iterator, Optional, Union
Expand Down
1 change: 1 addition & 0 deletions httoop/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
u"""Utilities for python2/3 compatibility."""

from __future__ import absolute_import
from __future__ import annotations

import codecs
import sys
Expand Down
Loading
Loading