This is an automated email from the ASF dual-hosted git repository. tn pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tooling-atr-experiments.git
commit d9fd667a31baf93e7dca20bdfc6f7506e96873a0 Author: Thomas Neidhart <t...@apache.org> AuthorDate: Thu Feb 20 11:35:50 2025 +0100 resync changes from asfquart --- asfquart/CHANGELOG.md | 6 ++++++ asfquart/README.md | 25 ++++++++++++++++++------- asfquart/docs/auth.md | 2 +- asfquart/pyproject.toml | 35 +++++++++++++++++++++++++++++------ asfquart/tests/README.md | 9 --------- asfquart/tests/auth.py | 9 --------- asfquart/tests/config.py | 7 +++---- asfquart/tests/pytest.ini | 5 ----- asfquart/tests/session.py | 2 -- 9 files changed, 57 insertions(+), 43 deletions(-) diff --git a/asfquart/CHANGELOG.md b/asfquart/CHANGELOG.md index c6d77b7..b4f4d3b 100644 --- a/asfquart/CHANGELOG.md +++ b/asfquart/CHANGELOG.md @@ -1,6 +1,12 @@ +Changes in 0.1.10: + - OAuth redirects have switch to using the Refresh HTTP header instead of a 30x response, allowing + samesite cookies to work with external OAuth providers when the hostname differs. + Changes in 0.1.9: - added the `metadata` dict to session objects where apps can store session-specific instructions - tightened file modes for the app secrets file. it will now fail to create if it already exists, and modes are better enforced + - Switch from `asyncinotify` to `watchfiles` to allow for functionality on other platforms, such as macOS + - Updated quart dependency (0.19.4 -> 0.20.0) Changes in 0.1.8: - Improved compatibility with Hypercorn which uses a backport of ExceptionGroup diff --git a/asfquart/README.md b/asfquart/README.md index 3501a07..7c6855a 100644 --- a/asfquart/README.md +++ b/asfquart/README.md @@ -1,6 +1,9 @@ # asfquart - a Quart framework for the ASF - - +<a href="https://pypi.org/project/asfquart"><img alt="PyPI" src="https://img.shields.io/pypi/v/asfquart.svg?color=blue&maxAge=600" /></a> +<a href="https://pypi.org/project/asfquart"><img alt="PyPI - Python Versions" src="https://img.shields.io/pypi/pyversions/asfquart.svg?maxAge=600" /></a> +<a href="https://github.com/apache/infrastructure-asfquart/actions/workflows/unit-tests.yml?query=branch%3Amain"><img alt="Unit Tests" src="https://github.com/apache/infrastructure-asfquart/actions/workflows/unit-tests.yml/badge.svg?branch=main" /></a> +<a href="https://github.com/apache/infrastructure-asfquart/blob/main/LICENSE"><img alt="Apache License" src="https://img.shields.io/github/license/apache/infrastructure-asfquart" /></a> + This is a [Quart](https://github.com/pallets/quart/) framework for ASF web applications. On top of Quart, this package layers a lot of functionality, much of which is specific to @@ -18,12 +21,12 @@ asfquart adds the following items to basic quart: * LDAP group testing for authz * long-running tasks and their lifecycle management -Current users of asfquart: +Current (known, public) users of asfquart: + +* [Board Agenda Tool](https://github.com/apache/infrastructure-agenda/) +* [Infrastructure's Reporting Dashboard](https://github.com/apache/infrastructure-reporting-dashboard) +* [ASF Self Serve Portal](https://github.com/apache/infrastructure-selfserve-portal) -* Board Agenda tool -* Infrastructure's Reporting Dashboard -* personal/home project of gstein -* ?? Future users of asfquart: @@ -60,3 +63,11 @@ if __name__ == "__main__": my_app() ~~~ + +## Running unit tests for asfquart + +To run manually, use the following commands from the root dir of this repo: + +~~~shell +poetry run pytest +~~~ diff --git a/asfquart/docs/auth.md b/asfquart/docs/auth.md index 9076c96..7174cf1 100644 --- a/asfquart/docs/auth.md +++ b/asfquart/docs/auth.md @@ -15,7 +15,7 @@ At present, asfquart features the following auth requirements: These requirements can be passed to the `asfquart.auth.require` decorator to create a list of requirements that must pass in order to make use of the endpoint. -By default, requirements are implictly in the `all_of` category, meaning they are AND'ed together. +By default, requirements are implicitly in the `all_of` category, meaning they are AND'ed together. You can also OR requirements by using the `any_of` flag instead: ~~~python diff --git a/asfquart/pyproject.toml b/asfquart/pyproject.toml index 934e062..9f5426d 100644 --- a/asfquart/pyproject.toml +++ b/asfquart/pyproject.toml @@ -1,23 +1,29 @@ [tool.poetry] name = "asfquart" -version = "0.1.9" +version = "0.1.10" authors = ["ASF Infrastructure <us...@infra.apache.org>"] license = "Apache-2.0" readme = "README.md" classifiers = [ "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python :: 3" + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "Operating System :: OS Independent", + "Topic :: Internet :: WWW/HTTP :: Dynamic Content", + "Topic :: Software Development :: Libraries :: Python Modules", ] description = "ASF Quart Framework" +repository = "https://github.com/apache/infrastructure-asfquart" [tool.poetry.dependencies] python = ">=3.10,<4" aiohttp = "^3.9.2" PyYAML = "^6.0.1" -pytest = "7.2.0" -pytest-cov = "^4.0.0" -pytest-asyncio = "^0.20.3" -pytest-mock = "^3.10.0" quart = "^0.20.0" ezt = "~1.1" asfpy = "~0.52" @@ -25,6 +31,23 @@ easydict = "~1.13" exceptiongroup = { version = ">=1.1.0", python = "<3.11" } watchfiles = "~0.24.0" +[tool.poetry.group.test.dependencies] +pytest = "7.2.0" +pytest-cov = "^4.0.0" +pytest-asyncio = "^0.20.3" +pytest-mock = "^3.10.0" + [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" + +[tool.pytest.ini_options] +minversion = "7.2" +testpaths = ["tests"] +pythonpath = ["src"] +python_files = "*.py" +markers = [ + "config: Configuration parsing tests", + "session: Client session management tests", + "auth: Authentication/Authorization tests" +] diff --git a/asfquart/tests/README.md b/asfquart/tests/README.md deleted file mode 100644 index b5bb5b4..0000000 --- a/asfquart/tests/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Unit tests for asfquart - -To run manually, use the following commands from the root dir of this repo: - -~~~shell -python3 -m pip install --upgrade pipenv wheel -pipenv install -pipenv run python3 -m pytest tests/*.py -~~~ diff --git a/asfquart/tests/auth.py b/asfquart/tests/auth.py index dae5f0d..9c23d90 100644 --- a/asfquart/tests/auth.py +++ b/asfquart/tests/auth.py @@ -1,13 +1,5 @@ #!/usr/bin/env python3 -import sys -sys.path.extend( - ( - "src", - "../src", - ) -) # Depending on where unit tests are run from, path may differ - import time import pytest @@ -50,7 +42,6 @@ async def test_auth_basics(): pass - @pytest.mark.asyncio @pytest.mark.auth async def test_mfa_auth(): diff --git a/asfquart/tests/config.py b/asfquart/tests/config.py index a3eeb87..6bac3a1 100644 --- a/asfquart/tests/config.py +++ b/asfquart/tests/config.py @@ -1,8 +1,5 @@ #!/usr/bin/env python3 -import sys -sys.path.extend(('src', '../src',)) # Depending on where unit tests are run from, path may differ - import pathlib import pytest @@ -23,4 +20,6 @@ async def test_config_static(): assert isinstance(yml, dict), "Config YAML is not a dict!" # Async test - await config_callback(TEST_CONFIG_FILENAME) + # the decorator @asfquart.config.static wraps the function to an async method + # suppress inspections as they fail to recognize that + await config_callback(TEST_CONFIG_FILENAME) # noqa diff --git a/asfquart/tests/pytest.ini b/asfquart/tests/pytest.ini deleted file mode 100644 index dfbd481..0000000 --- a/asfquart/tests/pytest.ini +++ /dev/null @@ -1,5 +0,0 @@ -[pytest] -markers = - config: Configuration parsing tests - session: Client session management tests - auth: Authentication/Authorization tests diff --git a/asfquart/tests/session.py b/asfquart/tests/session.py index fb1853e..848c615 100644 --- a/asfquart/tests/session.py +++ b/asfquart/tests/session.py @@ -1,7 +1,5 @@ #!/usr/bin/env python3 -import sys -sys.path.extend(('src', '../src',)) # Depending on where unit tests are run from, path may differ import time import pytest --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tooling.apache.org For additional commands, e-mail: dev-h...@tooling.apache.org