diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml new file mode 100644 index 00000000..d37d460f --- /dev/null +++ b/.github/workflows/pypi-publish.yml @@ -0,0 +1,11 @@ +name: Publish + +on: + push: + tags: + - v* + +jobs: + Publish: + uses: inveniosoftware/workflows/.github/workflows/pypi-publish.yml@master + secrets: inherit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3f0934b1..00000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: python - -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "pypy" - -script: - - nosetests -s - -after_success: - - pip install coveralls - - coverage run --source=flask_oauthlib setup.py -q nosetests - - coveralls - -branches: - only: - - master - -notifications: - email: false diff --git a/MANIFEST.in b/MANIFEST.in index 0a0fbdb4..2ab0319f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include README.rst include CHANGES.rst include LICENSE +exclude tests/* diff --git a/README.rst b/README.rst index f7688983..b19db117 100644 --- a/README.rst +++ b/README.rst @@ -1,85 +1,4 @@ -Flask-OAuthlib +Flask-OAuthlib-Invenio ============== -.. image:: https://img.shields.io/badge/donate-lepture-green.svg - :target: https://lepture.com/donate - :alt: Donate lepture -.. image:: https://img.shields.io/pypi/wheel/flask-oauthlib.svg - :target: https://pypi.python.org/pypi/flask-OAuthlib/ - :alt: Wheel Status -.. image:: https://img.shields.io/pypi/v/flask-oauthlib.svg - :target: https://pypi.python.org/pypi/flask-oauthlib/ - :alt: Latest Version -.. image:: https://travis-ci.org/lepture/flask-oauthlib.svg?branch=master - :target: https://travis-ci.org/lepture/flask-oauthlib - :alt: Travis CI Status -.. image:: https://coveralls.io/repos/lepture/flask-oauthlib/badge.svg?branch=master - :target: https://coveralls.io/r/lepture/flask-oauthlib - :alt: Coverage Status - - -Notice ------- - -**You SHOULD use https://github.com/lepture/authlib instead**. - -Flask-OAuthlib is an extension to Flask that allows you to interact with -remote OAuth enabled applications. On the client site, it is a replacement -for Flask-OAuth. But it does more than that, it also helps you to create -OAuth providers. - -Flask-OAuthlib relies on oauthlib_. - -.. _oauthlib: https://github.com/idan/oauthlib - - -Sponsored by ------------- - -If you want to quickly add secure authentication to Flask, feel free to -check out Auth0's Python API SDK and free plan at `auth0.com/developers`_ -|auth0 image| - -.. _`auth0.com/developers`: https://auth0.com/developers?utm_source=GHsponsor&utm_medium=GHsponsor&utm_campaign=flask-oauthlib&utm_content=auth - -.. |auth0 image| image:: https://user-images.githubusercontent.com/290496/31718461-031a6710-b44b-11e7-80f8-7c5920c73b8f.png - :target: https://auth0.com/developers?utm_source=GHsponsor&utm_medium=GHsponsor&utm_campaign=flask-oauthlib&utm_content=auth - :alt: Coverage Status - :width: 18px - :height: 18px - - -Features --------- - -- Support for OAuth 1.0a, 1.0, 1.1, OAuth2 client -- Friendly API (same as Flask-OAuth) -- Direct integration with Flask -- Basic support for remote method invocation of RESTful APIs -- Support OAuth1 provider with HMAC and RSA signature -- Support OAuth2 provider with Bearer token - - -Security Reporting ------------------- - -If you found security bugs which can not be public, send me email at `me@lepture.com`. -Attachment with patch is welcome. - - -Installation ------------- - -Installing flask-oauthlib is simple with pip:: - - $ pip install Flask-OAuthlib - -There is also a `development version `_ on GitHub. - - -Links ------ - -- Documentation: https://flask-oauthlib.readthedocs.io -- PyPI: https://pypi.org/project/Flask-OAuthlib/ -- Client Examples: https://github.com/lepture/flask-oauthlib/tree/master/example +WARNING: This is a private fork of Flask-OAuthlib used for Invenio. Please follow the notes of `Flask-OAuthlib `_ instead. diff --git a/flask_oauthlib/__init__.py b/flask_oauthlib/__init__.py index a8d492e3..e842ceed 100644 --- a/flask_oauthlib/__init__.py +++ b/flask_oauthlib/__init__.py @@ -8,10 +8,11 @@ OAuth servers. :copyright: (c) 2013 by Hsiaoming Yang. + :copyright: (c) Graz University of Technology :license: BSD, see LICENSE for more details. """ __version__ = "0.9.6" __author__ = "Hsiaoming Yang " -__homepage__ = 'https://github.com/lepture/flask-oauthlib' +__homepage__ = 'https://github.com/inveniosoftware/flask-oauthlib-invenio' __license__ = 'BSD' diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..f00e7785 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,4 @@ +[build-system] +requires = ["setuptools", "wheel", "babel>2.8"] +build-backend = "setuptools.build_meta" + diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..6246ac24 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Invenio. +# Copyright (C) 2024 CERN. +# Copyright (C) 2024 Graz University of Technology. +# +# Flask-OAuthlib is free software; you can redistribute it and/or modify it +# under the terms of the BSD 3 Clause License; see LICENSE file for more details. + +[metadata] +name = Flask-OAuthlib-Invenio +version = attr: flask_oauthlib.__version__ +description = OAuthlib for Flask. +long_description = file: README.rst +keywords = flask OAuth2 +license = BSD +author = flask_oauthlib.__author__ +author_email = flask_oauthlib.__email__ +platforms = any +url = https://github.com/inveniosoftware/flask-oauthlib-invenio +classifiers = + Development Status :: 5 - Production/Stable + +[options] +include_package_data = True +packages = find: +python_requires = >=3.9 +zip_safe = False +install_requires = + Flask>=3.0 + cachelib>=0.13.0 + oauthlib>=3.0.0 + requests-oauthlib>=1.0 + +[options.extras_require] +tests = + pytest-black-ng>=0.4.0 + pytest-invenio>=3.0.0,<4.0.0 + mock>=5.1.0 + +[build_sphinx] +source-dir = docs/ +build-dir = docs/_build +all_files = 1 + +[bdist_wheel] +universal = 1 + +[pydocstyle] +add_ignore = D401 + +[isort] +profile=black + +[check-manifest] +ignore = + *-requirements.txt + +[tool:pytest] +addopts = --black --isort --pydocstyle --doctest-glob="*.rst" --doctest-modules --cov=flask_oauthlib --cov-report=term-missing +testpaths = tests flask_oauthlib diff --git a/setup.py b/setup.py index 018c131e..8b95793a 100644 --- a/setup.py +++ b/setup.py @@ -1,74 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +from setuptools import setup -try: - import multiprocessing -except ImportError: - pass - -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - -from email.utils import parseaddr -import flask_oauthlib - -author, author_email = parseaddr(flask_oauthlib.__author__) - - -def fread(filename): - with open(filename) as f: - return f.read() - - -setup( - name='Flask-OAuthlib', - version=flask_oauthlib.__version__, - author=author, - author_email=author_email, - url=flask_oauthlib.__homepage__, - packages=[ - "flask_oauthlib", - "flask_oauthlib.provider", - "flask_oauthlib.contrib", - "flask_oauthlib.contrib.client", - ], - description="OAuthlib for Flask", - zip_safe=False, - include_package_data=True, - platforms='any', - long_description=fread('README.rst'), - license='BSD', - install_requires=[ - 'Flask', - 'oauthlib>=3.0.0,<3.2.2', - 'requests-oauthlib>=1.0,<1.3.1', - 'cachelib', - ], - tests_require=['nose', 'Flask-SQLAlchemy', 'mock'], - test_suite='nose.collector', - classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: Web Environment', - 'Intended Audience :: Developers', - 'License :: OSI Approved', - 'License :: OSI Approved :: BSD License', - 'Operating System :: MacOS', - 'Operating System :: POSIX', - 'Operating System :: POSIX :: Linux', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: Implementation', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', - 'Topic :: Software Development :: Libraries :: Python Modules', - ] -) +setup() diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 8c74b31d..00000000 --- a/tox.ini +++ /dev/null @@ -1,8 +0,0 @@ -[tox] -envlist = py27,py33,py34,py35,py36,pypy - -[testenv] -deps = - nose - -rrequirements.txt -commands = nosetests -s