diff --git a/.readthedocs.yml b/.readthedocs.yml index a2a5e6585..bcb1b78cb 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -11,9 +11,10 @@ build: python: install: - - requirements: doc/requirements.txt - - method: setuptools + - method: pip path: . + extra_requirements: + - docs # This is the default, you can omit this formats: [] diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b58161f5d..e54148826 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,7 @@ may want to subscribe to `GitHub's tag feed ====== not released yet +* UPDATED REQUIREMENT urwid is now required >= 2.1.0 * optimization in ikhal when editing events in the far future or past * FIX an issue in ikhal with updating the view of the event list after editing an event diff --git a/doc/requirements.txt b/doc/requirements.txt deleted file mode 100644 index 2b49a6fa4..000000000 --- a/doc/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -sphinx!=1.6.1 -sphinxcontrib-newsfeed -sphinx-rtd-theme diff --git a/khal/utils.py b/khal/utils.py index d7df22b4c..78f525bbd 100644 --- a/khal/utils.py +++ b/khal/utils.py @@ -191,7 +191,7 @@ def get_wrapped_text(widget: urwid.AttrMap) -> str: def human_formatter(format_string, width=None, colors=True): """Create a formatter that formats events to be human readable.""" def fmt(rows): - single = type(rows) == dict + single = isinstance(rows, dict) if single: rows = [rows] results = [] @@ -233,7 +233,7 @@ def json_formatter(fields): fields = CONTENT_ATTRIBUTES def fmt(rows): - single = type(rows) == dict + single = isinstance(rows, dict) if single: rows = [rows] diff --git a/pyproject.toml b/pyproject.toml index 6b38a33d7..d6a215b1c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,74 @@ +[project] +name = "khal" +dynamic = ["version"] +description = "Standards based terminal calendar" +readme = "README.rst" +authors = [ + {name = "khal contributors", email = "khal@lostpackets.de"}, +] +license = {file = "LICENSE"} +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console :: Curses", + "Intended Audience :: End Users/Desktop", + "License :: OSI Approved :: MIT License", + "Operating System :: POSIX", + "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", + "Topic :: Communications", + "Topic :: Utilities", +] +dependencies = [ + "click>=3.2", + "click_log>=0.2.0", + "icalendar>=4.0.3", + "urwid>=2.1.0", + "pyxdg", + "pytz", + "python-dateutil", + "configobj", + "atomicwrites>=0.1.7", + "tzlocal>=1.0", +] +[project.optional-dependencies] +proctitle = [ + "setproctitle" +] +test = [ + "freezegun", + "hypothesis", + "packaging", + "vdirsyncer", +] +docs = [ + "sphinx!=1.6.1", + "sphinxcontrib-newsfeed", + "sphinx-rtd-theme", +] + +[project.urls] +homepage = "http://lostpackets.de/khal/" +repository = "https://github.com/pimutils/khal" + +[project.scripts] +khal = "khal.cli:main_khal" +ikhal = "khal.cli:main_ikhal" + +[build-system] +requires = ["setuptools>=64", "setuptools_scm>=8"] +build-backend = "setuptools.build_meta" +requires-python = ">=3.8,<3.12" + +[tool.setuptools.packages] +find = {} + +[tool.setuptools_scm] +version_file = "khal/version.py" + [tool.ruff] select = ["E", "F", "W", "I", "B0", "UP", "C4"] ignore = ["B008"] diff --git a/setup.py b/setup.py deleted file mode 100755 index b6be6c93c..000000000 --- a/setup.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env python3 -import sys - -from setuptools import setup - -if sys.version_info < (3, 8): - errstr = "khal only supports python version 3.8+. Please Upgrade.\n" - sys.stderr.write("#" * len(errstr) + '\n') - sys.stderr.write(errstr) - sys.stderr.write("#" * len(errstr) + '\n') - sys.exit(1) - -requirements = [ - 'click>=3.2', - 'click_log>=0.2.0', - 'icalendar>=4.0.3', - 'urwid>=1.3.0', - 'pyxdg', - 'pytz', - 'python-dateutil', - 'configobj', - # https://github.com/untitaker/python-atomicwrites/commit/4d12f23227b6a944ab1d99c507a69fdbc7c9ed6d # noqa - 'atomicwrites>=0.1.7', - 'tzlocal>=1.0', -] - -test_requirements = [ - 'freezegun', - 'hypothesis', - 'packaging', - 'vdirsyncer', -] - -extra_requirements = { - 'proctitle': ['setproctitle'], -} - -setup( - name='khal', - description='A standards based terminal calendar', - long_description=open('README.rst').read(), - author='khal contributors', - author_email='khal@lostpackets.de', - url='http://lostpackets.de/khal/', - license='Expat/MIT', - packages=['khal', 'khal/ui', 'khal/khalendar', 'khal/settings'], - package_data={'khal': [ - 'settings/default.khal', - 'settings/khal.spec', - ]}, - entry_points={ - 'console_scripts': [ - 'khal = khal.cli:main_khal', - 'ikhal = khal.cli:main_ikhal', - ] - }, - install_requires=requirements, - extras_require=extra_requirements, - tests_require=test_requirements, - setup_requires=['setuptools_scm != 1.12.0'], # not needed when using packages from PyPI - use_scm_version={'write_to': 'khal/version.py'}, - zip_safe=False, # because of configobj loading the .spec file - classifiers=[ - "Development Status :: 4 - Beta", - "License :: OSI Approved :: MIT License", - "Environment :: Console :: Curses", - "Intended Audience :: End Users/Desktop", - "Operating System :: POSIX", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Utilities", - "Topic :: Communications", - ], -)