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
38 changes: 38 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Python package

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4

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

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtual envs-create: true
virtualenvs-in-project: true
virtualenvs-path: .venv
installer-parallel: true

- name: Install project
run: poetry install --no-interaction

- name: Launch tests
run: poetry run pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ tests/oauth2_client_tests/sandbox.py
build/
dist/
oauth2_client.egg-info/
.venv/

File renamed without changes.
File renamed without changes.
295 changes: 295 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions poetry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[virtualenvs]
create = true
in-project = true
prefer-active-python = true
prompt = "oauth2-client"
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[tool.poetry]
name = "oauth2-client"
version = "1.4.2"
description = "A client library for OAuth2"
authors = ["Benjamin Einaudi <antechrestos@gmail.com>"]
readme = "README.rst"
homepage = "https://pypi.org/project/oauth2-client/"
documentation = "https://pypi.org/project/oauth2-client/"
repository = "https://github.com/antechrestos/OAuth2Client"
keywords = ["oauth2"]

[tool.poetry.dependencies]
python = ">=3.9"
requests = ">=2.5.0"

[tool.poetry.group.dev.dependencies]
pytest = "~8.2.2"

[tool.pytest.ini_options]
console_output_style = "count"
pythonpath = [".", "tests",]
testpaths = ["tests"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

47 changes: 0 additions & 47 deletions setup.py

This file was deleted.

5 changes: 2 additions & 3 deletions tests/oauth2_client_tests/test_credential_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import logging
import threading
import unittest
from cgi import parse_header
from http import HTTPStatus
from http.server import BaseHTTPRequestHandler
from urllib.parse import urlparse, parse_qs
Expand Down Expand Up @@ -64,10 +63,10 @@ def do_GET(self):

def do_POST(self):
try:
ctype, pdict = parse_header(self.headers['content-type'])
ctype = self.headers.get_content_type()
if ctype == 'application/x-www-form-urlencoded':
length = int(self.headers['content-length'])
parameters = parse_qs(self.rfile.read(length), keep_blank_values=1)
parameters = parse_qs(self.rfile.read(length), keep_blank_values=True)
self._handle_post(parameters)
else:
_logger.debug('FakeOAuthHandler - invalid content type')
Expand Down
Loading