From c11e7947ef1b6f5595ab2b706cb75f938e4d7f42 Mon Sep 17 00:00:00 2001 From: Erik Cederstrand Date: Tue, 12 Dec 2023 16:20:23 +0100 Subject: [PATCH] chore: Switch to pyproject.toml --- MANIFEST.in | 1 + pyproject.toml | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 9 ------ setup.py | 78 -------------------------------------------------- 4 files changed, 78 insertions(+), 87 deletions(-) delete mode 100644 setup.cfg delete mode 100755 setup.py diff --git a/MANIFEST.in b/MANIFEST.in index ab277940..fab603fb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,3 +2,4 @@ include MANIFEST.in include LICENSE include CHANGELOG.md include README.md +exclude tests/* diff --git a/pyproject.toml b/pyproject.toml index 5f2f74d6..e391c9b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,80 @@ +# Release notes: +# * Install pdoc3, wheel, twine +# * Bump version in exchangelib/__init__.py +# * Bump version in CHANGELOG.md +# * Generate documentation: +# rm -r docs/exchangelib && pdoc3 --html exchangelib -o docs --force && pre-commit run end-of-file-fixer +# * Commit and push changes +# * Build package: +# rm -rf build dist exchangelib.egg-info && python -m build +# * Push to PyPI: +# twine upload dist/* +# * Create release on GitHub + +[project] +name = "exchangelib" +dynamic = ["version"] +description = "Client for Microsoft Exchange Web Services (EWS)" +readme = {file = "README.md", content-type = "text/markdown"} +requires-python = ">=3.8" +license = {text = "BSD-2-Clause"} +keywords = [ + "ews", + "exchange", + "autodiscover", + "microsoft", + "outlook", + "exchange-web-services", + "o365", + "office365", +] +authors = [ + {name = "Erik Cederstrand", email = "erik@cederstrand.dk"} +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Topic :: Communications", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python :: 3", +] +dependencies = [ + 'backports.zoneinfo; python_version < "3.9"', + "cached_property", + "defusedxml >= 0.6.0", + "dnspython >= 2.2.0", + "isodate", + "lxml>3.0", + "oauthlib", + "pygments", + "requests >= 2.31.0", + "requests_ntlm >= 0.2.0", + "requests_oauthlib", + "tzdata", + "tzlocal", +] + +[project.urls] +Homepage = "https://github.com/ecederstrand/exchangelib" +Issues = "https://github.com/ecederstrand/exchangelib/issues" +Documentation = "https://ecederstrand.github.io/exchangelib/" +Repository = "https://github.com/ecederstrand/exchangelib.git" +Changelog = "https://github.com/ecederstrand/exchangelib/blob/master/CHANGELOG.md" + +[project.optional-dependencies] +kerberos = ["requests_gssapi"] +sspi = ["requests_negotiate_sspi"] +complete = ["requests_gssapi", "requests_negotiate_sspi"] + +[tool.setuptools.dynamic] +version = {attr = "exchangelib.__version__"} + +[bdist_wheel] +universal = 1 + +[tool.flake8] +ignore = ["E203", "W503"] +max-line-length = 120 + [tool.black] line-length = 120 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index ed3536de..00000000 --- a/setup.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[bdist_wheel] -universal = 1 - -[metadata] -license_file = LICENSE - -[flake8] -ignore = E203, W503 -max-line-length = 120 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100755 index a1732cb8..00000000 --- a/setup.py +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env python -""" -Release notes: -* Install pdoc3, wheel, twine -* Bump version in exchangelib/__init__.py -* Bump version in CHANGELOG.md -* Generate documentation: - rm -r docs/exchangelib && pdoc3 --html exchangelib -o docs --force && pre-commit run end-of-file-fixer -* Commit and push changes -* Build package: - rm -rf build dist exchangelib.egg-info && python setup.py sdist bdist_wheel -* Push to PyPI: - twine upload dist/* -* Create release on GitHub -""" -from pathlib import Path - -from setuptools import find_packages, setup - - -def version(): - for line in read("exchangelib/__init__.py").splitlines(): - if not line.startswith("__version__"): - continue - return line.split("=")[1].strip(" \"'\n") - - -def read(file_name): - return (Path(__file__).parent / file_name).read_text() - - -setup( - name="exchangelib", - version=version(), - author="Erik Cederstrand", - author_email="erik@cederstrand.dk", - description="Client for Microsoft Exchange Web Services (EWS)", - long_description=read("README.md"), - long_description_content_type="text/markdown", - license="BSD-2-Clause", - keywords="ews exchange autodiscover microsoft outlook exchange-web-services o365 office365", - install_requires=[ - 'backports.zoneinfo;python_version<"3.9"', - "cached_property", - "defusedxml>=0.6.0", - "dnspython>=2.2.0", - "isodate", - "lxml>3.0", - "oauthlib", - "pygments", - "requests>=2.31.0", - "requests_ntlm>=0.2.0", - "requests_oauthlib", - "tzdata", - "tzlocal", - ], - extras_require={ - "kerberos": ["requests_gssapi"], - "sspi": ["requests_negotiate_sspi"], # Only for Win32 environments - "complete": ["requests_gssapi", "requests_negotiate_sspi"], # Only for Win32 environments - }, - packages=find_packages(exclude=("tests", "tests.*")), - python_requires=">=3.8", - test_suite="tests", - zip_safe=False, - url="https://github.com/ecederstrand/exchangelib", - project_urls={ - "Bug Tracker": "https://github.com/ecederstrand/exchangelib/issues", - "Documentation": "https://ecederstrand.github.io/exchangelib/", - "Source Code": "https://github.com/ecederstrand/exchangelib", - }, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Topic :: Communications", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python :: 3", - ], -)