From 51dabd987e993dc6265ed3ed1559fa8a5a8cbd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Mon, 9 Oct 2023 22:30:49 +0300 Subject: [PATCH] Migrated packaging metadata to pyproject.toml and added the py.typed marker --- MANIFEST.in | 1 + pyproject.toml | 49 +++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 51 ------------------------------------------------ setup.py | 3 --- tzlocal/py.typed | 0 5 files changed, 49 insertions(+), 55 deletions(-) delete mode 100644 setup.py create mode 100644 tzlocal/py.typed diff --git a/MANIFEST.in b/MANIFEST.in index 0312102..2aabda0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,7 @@ include *.py include *.rst include *.txt +include tzlocal/py.typed recursive-include tests/test_data * include tests/*.py exclude Makefile diff --git a/pyproject.toml b/pyproject.toml index 7344ece..2ea40ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,53 @@ [build-system] -requires = ["setuptools >= 42", "wheel"] +requires = ["setuptools >= 64"] build-backend = "setuptools.build_meta" +[project] +name = "tzlocal" +description = "tzinfo object for the local timezone" +readme = "README.rst" +version = "5.2.dev0" +authors = [{name = "Lennart Regebro", email = "regebro@gmail.com"}] +license = {text = "MIT"} +keywords = ["timezone"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: MIT License", + "Operating System :: Microsoft :: Windows", + "Operating System :: Unix", + "Operating System :: MacOS :: MacOS X", + "Typing :: Typed", + "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.8" +dependencies = [ + "backports.zoneinfo; python_version < '3.9'", + "tzdata; platform_system == 'Windows'", +] + +[project.urls] +"Source code" = "https://github.com/regebro/tzlocal" +Changelog = "https://github.com/regebro/tzlocal/blob/master/CHANGES.txt" +"Issue tracker" = "https://github.com/regebro/tzlocal/issues" + +[project.optional-dependencies] +devenv = [ + "pytest >= 4.3", + "pytest-mock >= 3.3", + "pytest-cov", + "black", + "flake8", + "check_manifest", + "pyroma", + "zest.releaser", +] + +[tool.zest.releaser] +create-wheel = true + [tool.pytest.ini_options] testpaths = "tests" diff --git a/setup.cfg b/setup.cfg index c76b1e6..22ea4dd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,54 +1,3 @@ -[metadata] -name = tzlocal -description = tzinfo object for the local timezone -long_description = file: README.rst, CHANGES.txt -version = 5.2.dev0 -author = Lennart Regebro -author_email = regebro@gmail.com -project_urls = - Source code = https://github.com/regebro/tzlocal - Issue tracker = https://github.com/regebro/tzlocal/issues -license = MIT -keywords = timezone -classifiers = - Development Status :: 5 - Production/Stable - License :: OSI Approved :: MIT License - Operating System :: Microsoft :: Windows - Operating System :: Unix - Operating System :: MacOS :: MacOS X - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - 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] -packages = find: -python_requires = >= 3.8 -zip_safe = True -install_requires = - backports.zoneinfo; python_version < "3.9" - tzdata; platform_system == "Windows" - -[options.packages.find] -include = tzlocal - -[options.extras_require] -devenv = - pytest >= 4.3 - pytest-mock >= 3.3 - pytest-cov - black - flake8 - check_manifest - pyroma - zest.releaser - -[zest.releaser] -create-wheel = yes - [flake8] max-line-length=120 # black and flake8 differs in opinion here, and I can't change black: diff --git a/setup.py b/setup.py deleted file mode 100644 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() diff --git a/tzlocal/py.typed b/tzlocal/py.typed new file mode 100644 index 0000000..e69de29