Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP621: Migrate setup.py config into pyproject.toml #770

Closed
wants to merge 11 commits into from
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
Expand Down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@ repos:
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2']
- id: pretty-format-toml
args: [--autofix]
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.1
hooks:
- id: validate-pyproject
99 changes: 99 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools>=61.2"
]

[project]
authors = [{name = "Matias Aguirre", email = "matiasaguirre@gmail.com"}]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
"Topic :: Internet"
]
dependencies = [
"cryptography>=1.4",
"defusedxml>=0.5.0rc1",
"oauthlib>=1.0.3",
"PyJWT>=2",
"python3-openid>=3.0.10",
"requests>=2.9.1",
"requests-oauthlib>=0.6.1"
]
description = "Python social authentication made simple."
dynamic = ["version", "readme"]
keywords = [
"auth",
"oauth",
"openid",
"saml",
"social"
]
license = {text = "BSD"}
name = "social-auth-core"
requires-python = ">=3.7"

[project.optional-dependencies]
all = [
"cryptography>=2.1.1",
"python-jose>=3",
"python3-saml>=1.5"
]
allpy3 = [
"cryptography>=2.1.1",
"python-jose>=3",
"python3-saml>=1.5"
]
azuread = [
"cryptography>=2.1.1"
]
openidconnect = [
"python-jose>=3"
]
saml = [
"python3-saml>=1.5"
]
testing = [
"coverage>=3.6",
"cryptography>=2.1.1",
"httpretty>=0.9.6",
"pytest>=4.5",
"pytest-cov>=2.7.1",
"python-jose>=3",
"python3-saml>=1.5"
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all duplicates requirements-*.txt content. Can the dependencies be specified just once?

Copy link
Contributor Author

@cclauss cclauss Mar 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but can we push that to a separate PR? This one already touches a lot of files and tox.ini and GitHub Action caching will need to be modified when dropping requirements files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can generate the requirements files from the pyproject.toml one:

python3 -m piptools compile --output-file=requirements.txt pyproject.toml
python3 -m piptools compile --extra=dev --output-file=requirements-dev.txt pyproject.toml
etc


[project.urls]
Homepage = "https://github.com/python-social-auth/social-core"

[tool.setuptools]
include-package-data = true
packages = [
"social_core",
"social_core.backends",
"social_core.pipeline",
"social_core.tests",
"social_core.tests.actions",
"social_core.tests.backends",
"social_core.tests.backends.data"
]
zip-safe = false

[tool.setuptools.dynamic]
readme = {file = "README.md"}
version = {attr = "social_core.__version__"}

[tool.setuptools.package-data]
social_core_tests = [
"social_core/tests/*.txt",
"social_core/tests/testkey.pem"
]
106 changes: 0 additions & 106 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion social_core/backends/loginradius.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def request_access_token(self, *args, **kwargs):
return self.get_json(
params={"token": self.data.get("token"), "secret": self.setting("SECRET")},
*args,
**kwargs
**kwargs,
)

def user_data(self, access_token, *args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion social_core/backends/untappd.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def auth_complete(self, *args, **kwargs):
response["response"]["access_token"],
response=response["response"],
*args,
**kwargs
**kwargs,
)

def get_user_details(self, response):
Expand Down
2 changes: 1 addition & 1 deletion social_core/pipeline/partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def wrapper(strategy, backend, pipeline_index, *args, **kwargs):
pipeline_index=pipeline_index,
current_partial=current_partial,
*args,
**kwargs
**kwargs,
)
or {}
)
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

[tox]
envlist = py36,py37,py38,py39,py310,py311
isolated_build = true

[testenv]
passenv = *
Expand Down