diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..29ea415a8 --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +exclude = .git,.tox,__pycache__,.eggs,dist,venv,.venv*,venv27,virtualenv,docs,docs-source,build +max-line-length = 88 +extend-ignore = W503,W504,E203 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..af6c3e6c4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,124 @@ +[build-system] +requires = ["setuptools>=61.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "globus-sdk" +authors = [ + { name = "Globus Team", email = "support@globus.org" }, +] +description = "Globus SDK for Python" +keywords = ["globus"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "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" +dependencies = [ + "requests>=2.19.1,<3.0.0", + "pyjwt[crypto]>=2.0.0,<3.0.0", + # cryptography 3.4.0 is known-bugged, see: + # https://github.com/pyca/cryptography/issues/5756 + # pyjwt requires cryptography>=3.3.1, + # so there's no point in setting a lower bound than that + "cryptography>=3.3.1,!=3.4.0", + # depend on the latest version of typing-extensions on python versions which do + # not have all of the typing features we use + 'typing_extensions>=4.0; python_version<"3.10"', +] +dynamic = ["version"] + +[project.readme] +file = "README.rst" +content-type = "text/x-rst" + +[project.license] +text = "Apache-2.0" + +[project.urls] +Homepage = "https://github.com/globus/globus-sdk-python" + +[tool.setuptools.packages.find] +where = ["src"] +namespaces = false + +[tool.setuptools.package-data] +globus_sdk = ["py.typed"] + +[tool.setuptools.dynamic.version] +attr = "globus_sdk.__version__" + +# non-packaging tool configs follow + +[tool.pytest.ini_options] +addopts = "--no-success-flaky-report" +testpaths = ["tests"] +norecursedirs = ["tests/non-pytest"] +filterwarnings = [ + "error", +] + +[tool.scriv] +version = "literal: src/globus_sdk/version.py: __version__" +format = "rst" +output_file = "changelog.rst" +entry_title_template = 'v{{ version }} ({{ date.strftime(\"%Y-%m-%d\") }})' +rst_header_chars = "-~" +categories = [ + "Python Support", + "Added", + "Removed", + "Changed", + "Deprecated", + "Fixed", + "Documentation", + "Security", + "Development", +] + +[tool.isort] +profile = "black" +known_first_party = ["tests", "globus_sdk"] + +[tool.mypy] +strict = true +warn_unreachable = true +warn_no_return = true + +[tool.pylint] +load-plugins = ["pylint.extensions.docparams"] +accept-no-param-doc = "false" + +[tool.pylint."messages control"] +disable = [ + # formatting and cosmetic rules (handled by 'black', etc) + "format", "C", + # refactoring rules (e.g. duplicate or similar code) are very prone to + # false positives + "R", + # emitted when pylint fails to import a module; these warnings + # are usually false-positives for optional dependencies + "import-error", + # "disallowed" usage of our own classes and objects gets underfoot + "protected-access", + # objections to log messages doing eager (vs lazy) string formatting + # the perf benefit of deferred logging doesn't always outweigh the readability cost + "logging-fstring-interpolation", "logging-format-interpolation", + # fixme comments are often useful; re-enable this to quickly find FIXME and + # TODO comments + "fixme", + # most SDK methods currently do not document the exceptions which they raise + # this is an area for potential improvement + "missing-raises-doc", +] + +[tool.pylint.variables] +ignored-argument-names = "args|kwargs" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 797cc8f4a..000000000 --- a/setup.cfg +++ /dev/null @@ -1,141 +0,0 @@ -[metadata] -name = globus-sdk -version = attr: globus_sdk.__version__ - -author = Globus Team -author_email = support@globus.org -description = Globus SDK for Python -long_description = file: README.rst -long_description_content_type = text/x-rst -url = https://github.com/globus/globus-sdk-python -keywords= globus -license = Apache-2.0 -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - License :: OSI Approved :: Apache Software License - 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 - -[options] -python_requires = >=3.7 -package_dir= - =src -packages = find: -include_package_data = true - -# = Dependency Details = -# -# == cryptography == -# -# cryptography 3.4.0 is known-bugged, see: -# https://github.com/pyca/cryptography/issues/5756 -# -# pyjwt requires cryptography>=3.3.1, -# so there's no point in setting a lower bound than that -# -# as of 2021-10-13, we have removed the upper-bound, on the grounds that -# - we actively test on the latest versions -# - cryptography has a strong API stability policy that makes most releases -# non-breaking for our usages -# - other packages /consumers can specify stricter bounds if necessary -# -# == typing-extensions == -# -# depend on the latest version of typing-extensions on python versions which do -# not have all of the typing features we use -install_requires = - requests>=2.19.1,<3.0.0 - pyjwt[crypto]>=2.0.0,<3.0.0 - cryptography>=3.3.1,!=3.4.0 - typing_extensions>=4.0; python_version<"3.10" - -[options.packages.find] -where=src - -[options.package_data] -globus_sdk = - py.typed - - -[isort] -profile = black -known_first_party = tests, globus_sdk - - -[flake8] -exclude = .git,.tox,__pycache__,.eggs,dist,venv,.venv*,venv27,virtualenv,docs,docs-source,build - -# we enforce 80 char width with `black` "loosely", so flake8 should be set to -# not fail on up to 88 chars of width -max-line-length = 88 - -extend-ignore = W503,W504,E203 - - -[mypy] -strict = true -warn_unreachable = true -warn_no_return = true - - -[tool:pytest] -addopts = --no-success-flaky-report -testpaths = tests -norecursedirs = tests/non-pytest -filterwarnings = - # warnings are errors, like -Werror - error - -[scriv] -version = literal: src/globus_sdk/version.py: __version__ -format = rst -output_file = changelog.rst -entry_title_template = v{{ version }} ({{ date.strftime("%%Y-%%m-%%d") }}) -rst_header_chars = -~ -categories = - Python Support - Added - Removed - Changed - Deprecated - Fixed - Documentation - Security - Development - - -[pylint] -load-plugins = pylint.extensions.docparams -accept-no-param-doc = false -[pylint.messages control] -disable = - # formatting and cosmetic rules (handled by 'black', etc) - format, C, - # refactoring rules (e.g. duplicate or similar code) are very prone to - # false positives - R, - # emitted when pylint fails to import a module; these warnings - # are usually false-positives for optional dependencies - import-error, - # "disallowed" usage of our own classes and objects gets underfoot - protected-access, - # logging-*-interpolation - # objections to log messages doing eager (vs lazy) string formatting - # this is potentially an area for improvement, but the benefit of deferred - # logging doesn't always outweigh the readability cost - logging-fstring-interpolation, - logging-format-interpolation, - # fixme comments are often useful; re-enable this to quickly find FIXME and - # TODO comments - fixme, - # most SDK methods currently do not document the exceptions which they raise - # this is an area for potential improvement - missing-raises-doc, -[pylint.variables] -ignored-argument-names = args|kwargs diff --git a/tox.ini b/tox.ini index 3ca7af6e5..0bfcd1df4 100644 --- a/tox.ini +++ b/tox.ini @@ -39,7 +39,7 @@ commands_pre = -coverage combine commands = coverage report --skip-covered [testenv:lint] -deps = pre-commit<3 +deps = pre-commit skip_install = true commands = pre-commit run --all-files