Skip to content

Commit

Permalink
chore: apply pre-commit fixes
Browse files Browse the repository at this point in the history
Automated update of shared files from the social-core repository, see
https://github.com/python-social-auth/.github/blob/main/repo-sync.py
  • Loading branch information
nijel committed Jan 10, 2025
1 parent afccb4b commit 616ff92
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 50 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased](https://github.com/python-social-auth/social-app-webpy/commits/master)

### Changed

- Modified model and access code to work with SQLAlchemy version 2 (Issue #1)
- Updated packaging information files per PEP 517, PEP 518 (Issue #2)
- Restricted Python minimum working version to 3.7 or higher to align with SQLAlchemy 2 (Issue #1)
Expand All @@ -16,15 +17,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [1.0.0](https://github.com/python-social-auth/social-app-webpy/releases/tag/1.0.0) - 2017-01-22

### Added

- Added partial pipeline db storage solution

### Changed

- Remove usage of set/get current strategy methods
- Allow apps to have any type of user_id field (port of [#1040](https://github.com/omab/python-social-auth/pull/1040)
by prmtl)

## [0.0.1](https://github.com/python-social-auth/social-app-webpy/releases/tag/0.0.1) - 2016-11-27

### Changed

- Split from the monolitic [python-social-auth](https://github.com/omab/python-social-auth)
codebase
70 changes: 35 additions & 35 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = ["setuptools"]

[options]
zip_safe = false

[project]
name = 'social-auth-app-webpy'
dynamic = ["version"]
dependencies = [
"six",
"social-auth-core>=1.0.0",
"social-auth-storage-sqlalchemy>=1.0.0",
]
authors = [
{name = "Matias Aguirre", email = "[email protected]"},
{name = "Lee Ji-ho", email = "[email protected]"},
{name = "Lee Ji-ho", email = "[email protected]"}
]
classifiers = [
'Development Status :: 4 - Beta',
'Topic :: Internet',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Environment :: Web Environment',
'Programming Language :: Python',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12'
]
dependencies = [
"six",
"social-auth-core>=1.0.0",
"social-auth-storage-sqlalchemy>=1.0.0"
]
description = 'Python Social Authentication, web.py integration.'
license = {text = 'BSD'}
dynamic = ["version"]
keywords = ["web.py", "sqlalchemy", "social auth"]
license = {text = 'BSD'}
name = 'social-auth-app-webpy'
readme = "README.md"
classifiers=[
'Development Status :: 4 - Beta',
'Topic :: Internet',
'License :: OSI Approved :: BSD License',
'Intended Audience :: Developers',
'Environment :: Web Environment',
'Programming Language :: Python',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12'
]
requires-python = ">= 3.7"

[project.urls]
Repository = 'https://github.com/python-social-auth/social-app-webpy'
Changelog = 'https://github.com/python-social-auth/social-app-webpy/blob/master/CHANGELOG.md'
Documentation = 'http://python-social-auth.readthedocs.org'
Issues = 'https://github.com/python-social-auth/social-app-webpy/issues'
Changelog = 'https://github.com/python-social-auth/social-app-webpy/blob/master/CHANGELOG.md'
Repository = 'https://github.com/python-social-auth/social-app-webpy'

[options]
zip_safe = false
[tool.flake8]
# Ignore some well known paths
exclude = ['.venv', '.tox', 'dist', 'doc', 'build', '*.egg', 'db/env.py', 'db/versions/*.py', 'site', 'Pipfile', 'Pipfile.lock']
max-line-length = 79

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages]
find = {}

[tool.setuptools.dynamic]
version = {attr = "social_webpy.__version__"}

[tool.flake8]
max-line-length = 79
# Ignore some well known paths
exclude = ['.venv','.tox','dist','doc','build','*.egg','db/env.py','db/versions/*.py','site','Pipfile','Pipfile.lock']
[tool.setuptools.packages]
find = {}
2 changes: 1 addition & 1 deletion social_webpy/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
class BaseViewClass:
def __init__(self, *args, **kwargs):
self.session = web.web_session
method = web.ctx.method == "POST" and "post" or "get"
method = (web.ctx.method == "POST" and "post") or "get"
self.strategy = load_strategy()
self.data = web.input(_method=method)
self.backend = None
Expand Down
8 changes: 0 additions & 8 deletions social_webpy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,18 @@ def user_model(cls):
class Nonce(WebpySocialBase, SQLAlchemyNonceMixin, SocialBase):
"""One use numbers"""

pass


class Association(WebpySocialBase, SQLAlchemyAssociationMixin, SocialBase):
"""OpenId account association"""

pass


class Code(WebpySocialBase, SQLAlchemyCodeMixin, SocialBase):
"""Mail validation single one time use code"""

pass


class Partial(WebpySocialBase, SQLAlchemyPartialMixin, SocialBase):
"""Partial pipeline storage"""

pass


class WebpyStorage(BaseSQLAlchemyStorage):
user = UserSocialAuth
Expand Down
14 changes: 8 additions & 6 deletions social_webpy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@


def get_helper(name, do_import=False):
config = web.config.get(setting_name(name), DEFAULTS.get(name, None))
return do_import and module_member(config) or config
config = web.config.get(setting_name(name), DEFAULTS.get(name))
return (do_import and module_member(config)) or config


def load_strategy():
Expand Down Expand Up @@ -43,8 +43,10 @@ def wrapper(self, backend, *args, **kwargs):


def backends(user):
"""Load Social Auth current user data to context under the key 'backends'.
Will return the output of social_core.backends.utils.user_backends_data."""
"""
Load Social Auth current user data to context under the key 'backends'.
Will return the output of social_core.backends.utils.user_backends_data.
"""
return user_backends_data(
user,
get_helper("AUTHENTICATION_BACKENDS"),
Expand All @@ -54,13 +56,13 @@ def backends(user):

def login_redirect():
"""Load current redirect to context."""
method = web.ctx.method == "POST" and "post" or "get"
method = (web.ctx.method == "POST" and "post") or "get"
data = web.input(_method=method)
value = data.get("next")
return {
"REDIRECT_FIELD_NAME": "next",
"REDIRECT_FIELD_VALUE": value,
"REDIRECT_QUERYSTRING": value and ("next=" + value) or "",
"REDIRECT_QUERYSTRING": (value and ("next=" + value)) or "",
}


Expand Down

0 comments on commit 616ff92

Please sign in to comment.