Skip to content

Commit cb4aa61

Browse files
committed
Switch from setup.py to setup.cfg
1 parent a016334 commit cb4aa61

File tree

2 files changed

+69
-100
lines changed

2 files changed

+69
-100
lines changed

setup.cfg

+67
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,76 @@
1+
# Format https://setuptools.pypa.io/en/latest/userguide/declarative_config.html
2+
13
[bdist_wheel]
24
universal=1
35

46
[metadata]
7+
name = msal
8+
version = attr: msal.__version__
9+
description =
10+
The Microsoft Authentication Library (MSAL) for Python library
11+
enables your app to access the Microsoft Cloud
12+
by supporting authentication of users with
13+
Microsoft Azure Active Directory accounts (AAD) and Microsoft Accounts (MSA)
14+
using industry standard OAuth2 and OpenID Connect.
15+
long_description = file: README.md
16+
long_description_content_type = text/markdown
17+
license = MIT
18+
author = Microsoft Corporation
19+
author_email = nugetaad@microsoft.com
20+
url = https://github.com/AzureAD/microsoft-authentication-library-for-python
21+
classifiers =
22+
Development Status :: 5 - Production/Stable
23+
Programming Language :: Python
24+
Programming Language :: Python :: 2
25+
Programming Language :: Python :: 2.7
26+
Programming Language :: Python :: 3
27+
Programming Language :: Python :: 3.5
28+
Programming Language :: Python :: 3.6
29+
Programming Language :: Python :: 3.7
30+
Programming Language :: Python :: 3.8
31+
Programming Language :: Python :: 3.9
32+
Programming Language :: Python :: 3.10
33+
Programming Language :: Python :: 3.11
34+
License :: OSI Approved :: MIT License
35+
Operating System :: OS Independent
36+
537
project_urls =
638
Changelog = https://github.com/AzureAD/microsoft-authentication-library-for-python/releases
739
Documentation = https://msal-python.readthedocs.io/
840
Questions = https://stackoverflow.com/questions/tagged/azure-ad-msal+python
941
Feature/Bug Tracker = https://github.com/AzureAD/microsoft-authentication-library-for-python/issues
42+
43+
44+
[options]
45+
include_package_data = False # We used to ship LICENSE, but our __init__.py already mentions MIT
46+
packages = find:
47+
python_requires = >=2.7
48+
install_requires =
49+
requests>=2.0.0,<3
50+
51+
# MSAL does not use jwt.decode(),
52+
# therefore is insusceptible to CVE-2022-29217 so no need to bump to PyJWT 2.4+
53+
PyJWT[crypto]>=1.0.0,<3
54+
55+
# load_pem_private_key() is available since 0.6
56+
# https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst#06---2014-09-29
57+
#
58+
# And we will use the cryptography (X+3).0.0 as the upper bound,
59+
# based on their latest deprecation policy
60+
# https://cryptography.io/en/latest/api-stability/#deprecation
61+
cryptography>=0.6,<44
62+
63+
mock; python_version<'3.3'
64+
65+
[options.extras_require]
66+
broker =
67+
# The broker is defined as optional dependency,
68+
# so that downstream apps can opt in. The opt-in is needed, partially because
69+
# most existing MSAL Python apps do not have the redirect_uri needed by broker.
70+
# MSAL Python uses a subset of API from PyMsalRuntime 0.11.2+,
71+
# but we still bump the lower bound to 0.13.2+ for its important bugfix (https://github.com/AzureAD/microsoft-authentication-library-for-cpp/pull/3244)
72+
pymsalruntime>=0.13.2,<0.14; python_version>='3.6' and platform_system=='Windows'
73+
74+
[options.packages.find]
75+
exclude =
76+
tests

setup.py

+2-100
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,3 @@
1-
#!/usr/bin/env python
2-
#------------------------------------------------------------------------------
3-
#
4-
# Copyright (c) Microsoft Corporation.
5-
# All rights reserved.
6-
#
7-
# This code is licensed under the MIT License.
8-
#
9-
# Permission is hereby granted, free of charge, to any person obtaining a copy
10-
# of this software and associated documentation files(the "Software"), to deal
11-
# in the Software without restriction, including without limitation the rights
12-
# to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
13-
# copies of the Software, and to permit persons to whom the Software is
14-
# furnished to do so, subject to the following conditions :
15-
#
16-
# The above copyright notice and this permission notice shall be included in
17-
# all copies or substantial portions of the Software.
18-
#
19-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
22-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25-
# THE SOFTWARE.
26-
#
27-
#------------------------------------------------------------------------------
28-
29-
from setuptools import setup, find_packages
30-
import re, io
31-
32-
# setup.py shall not import main package
33-
__version__ = re.search(
34-
r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', # It excludes inline comment too
35-
io.open('msal/application.py', encoding='utf_8_sig').read()
36-
).group(1)
37-
38-
long_description = open('README.md').read()
39-
40-
setup(
41-
name='msal',
42-
version=__version__,
43-
description=' '.join(
44-
"""The Microsoft Authentication Library (MSAL) for Python library
45-
enables your app to access the Microsoft Cloud
46-
by supporting authentication of users with
47-
Microsoft Azure Active Directory accounts (AAD) and Microsoft Accounts (MSA)
48-
using industry standard OAuth2 and OpenID Connect.""".split()),
49-
long_description=long_description,
50-
long_description_content_type="text/markdown",
51-
license='MIT',
52-
author='Microsoft Corporation',
53-
author_email='nugetaad@microsoft.com',
54-
url='https://github.com/AzureAD/microsoft-authentication-library-for-python',
55-
classifiers=[
56-
'Development Status :: 5 - Production/Stable',
57-
'Programming Language :: Python',
58-
'Programming Language :: Python :: 2',
59-
'Programming Language :: Python :: 2.7',
60-
'Programming Language :: Python :: 3',
61-
'Programming Language :: Python :: 3.5',
62-
'Programming Language :: Python :: 3.6',
63-
'Programming Language :: Python :: 3.7',
64-
'Programming Language :: Python :: 3.8',
65-
'Programming Language :: Python :: 3.9',
66-
'Programming Language :: Python :: 3.10',
67-
'Programming Language :: Python :: 3.11',
68-
'License :: OSI Approved :: MIT License',
69-
'Operating System :: OS Independent',
70-
],
71-
packages=find_packages(exclude=["tests"]),
72-
package_data={'': ['LICENSE']}, # Do not use data_files=[...],
73-
# which would cause the LICENSE being copied to /usr/local,
74-
# and tend to fail because of insufficient permission.
75-
# See https://stackoverflow.com/a/14211600/728675 for more detail
76-
install_requires=[
77-
'requests>=2.0.0,<3',
78-
'PyJWT[crypto]>=1.0.0,<3', # MSAL does not use jwt.decode(), therefore is insusceptible to CVE-2022-29217 so no need to bump to PyJWT 2.4+
79-
80-
'cryptography>=0.6,<44',
81-
# load_pem_private_key() is available since 0.6
82-
# https://github.com/pyca/cryptography/blob/master/CHANGELOG.rst#06---2014-09-29
83-
#
84-
# And we will use the cryptography (X+3).0.0 as the upper bound,
85-
# based on their latest deprecation policy
86-
# https://cryptography.io/en/latest/api-stability/#deprecation
87-
88-
"mock;python_version<'3.3'",
89-
],
90-
extras_require={ # It does not seem to work if being defined inside setup.cfg
91-
"broker": [
92-
# The broker is defined as optional dependency,
93-
# so that downstream apps can opt in. The opt-in is needed, partially because
94-
# most existing MSAL Python apps do not have the redirect_uri needed by broker.
95-
# MSAL Python uses a subset of API from PyMsalRuntime 0.11.2+,
96-
# but we still bump the lower bound to 0.13.2+ for its important bugfix (https://github.com/AzureAD/microsoft-authentication-library-for-cpp/pull/3244)
97-
"pymsalruntime>=0.13.2,<0.14;python_version>='3.6' and platform_system=='Windows'",
98-
],
99-
},
100-
)
1+
from setuptools import setup
2+
setup()
1013

0 commit comments

Comments
 (0)