pkgsrc/misc/todoman/Makefile
wiz 7e0f6b0727 todoman: update to 4.0.0.
v4.0.0
------

Breaking changes in the configuration format
********************************************

The configuration format is changing with release 4.0.0. We currently depend on
an unmaintained library for configuration. It's not currently in a working
state, and while some distributions are patching it, setting up a clean
environment is a bit non-trivial, and the situation will only degrade in future.

The changes in format are be subtle, and also come with an intention to add
further extensibility in future. Configuration files will be plain python. If
you don't know Python don't worry, you don't _need_ to know Python.

I'll take my own config as a reference. The pre-4.0.0 format is:

```dosini
[main]
path = ~/.local/share/calendars/*
time_format = '%H:%M'
default_list = todo
humanize = true
startable = true
```

The 4.0.0 version would look like this:

```python
path = "~/.local/share/calendars/*"
time_format = "%H:%M"
default_list = "todo"
humanize = True
startable = True
```

Key differences:

- The `[main]` header is no longer needed.
- All strings must be quoted (this was previously optional).
- True and False start with uppercase.
- Using `yes` or `on` is no longer valid; only `True` and `False` are valid.

That's basically it. This lets up drop the problematic dependency, and we don't
actually need anything to read the config: it's just python code like the rest
of `todoman`!

For those users who _are_ python developers, you'll note this gives some
interesting flexibility: you CAN add any custom python code into the config
file. For example, you can defined the `path` programatically:

```python
def get_path() -> str:
    ...


path = get_path
```

Dropped support
***************

* Dropped support older Python versions. Only 3.8 and 3.9 are now supported.

Minor changes
*************

* Added support for python 3.9.
* The dependency `configobj` is no longer required.
* Click 8.0 is now supported.
* Fix crash when ``default_command`` has arguments.
2021-05-23 11:08:39 +00:00

50 lines
2.2 KiB
Makefile

# $NetBSD: Makefile,v 1.25 2021/05/23 11:08:39 wiz Exp $
DISTNAME= todoman-4.0.0
CATEGORIES= misc
MASTER_SITES= ${MASTER_SITE_PYPI:=t/todoman/}
#MASTER_SITES= ${MASTER_SITE_GITHUB:=pimutils/}
#GITHUB_RELEASE= v${PKGVERSION_NOREV}
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= https://github.com/pimutils/todoman
COMMENT= Simple CalDav-based todo manager
LICENSE= mit
DEPENDS+= ${PYPKGPREFIX}-atomicwrites-[0-9]*:../../devel/py-atomicwrites
DEPENDS+= ${PYPKGPREFIX}-click>=7.0:../../devel/py-click
DEPENDS+= ${PYPKGPREFIX}-click-log-[0-9]*:../../devel/py-click-log
DEPENDS+= ${PYPKGPREFIX}-configobj-[0-9]*:../../devel/py-configobj
DEPENDS+= ${PYPKGPREFIX}-dateutil-[0-9]*:../../time/py-dateutil
DEPENDS+= ${PYPKGPREFIX}-humanize-[0-9]*:../../textproc/py-humanize
DEPENDS+= ${PYPKGPREFIX}-icalendar>=4.0.3:../../time/py-icalendar
DEPENDS+= ${PYPKGPREFIX}-parsedatetime-[0-9]*:../../time/py-parsedatetime
DEPENDS+= ${PYPKGPREFIX}-tabulate-[0-9]*:../../textproc/py-tabulate
DEPENDS+= ${PYPKGPREFIX}-urwid-[0-9]*:../../devel/py-urwid
DEPENDS+= ${PYPKGPREFIX}-xdg-[0-9]*:../../devel/py-xdg
BUILD_DEPENDS+= ${PYPKGPREFIX}-setuptools_scm-[0-9]*:../../devel/py-setuptools_scm
BUILD_DEPENDS+= ${PYPKGPREFIX}-test-runner-[0-9]*:../../devel/py-test-runner
# TEST_DEPENDS
BUILD_DEPENDS+= ${PYPKGPREFIX}-flake8-[0-9]*:../../devel/py-flake8
BUILD_DEPENDS+= ${PYPKGPREFIX}-flakes-[0-9]*:../../devel/py-flakes
BUILD_DEPENDS+= ${PYPKGPREFIX}-flake8-import-order-[0-9]*:../../devel/py-flake8-import-order
BUILD_DEPENDS+= ${PYPKGPREFIX}-freezegun-[0-9]*:../../devel/py-freezegun
BUILD_DEPENDS+= ${PYPKGPREFIX}-hypothesis-[0-9]*:../../devel/py-hypothesis
BUILD_DEPENDS+= ${PYPKGPREFIX}-test-[0-9]*:../../devel/py-test
BUILD_DEPENDS+= ${PYPKGPREFIX}-test-cov-[0-9]*:../../devel/py-test-cov
PYTHON_VERSIONS_INCOMPATIBLE= 27 36 37
REPLACE_PYTHON+= bin/todo
USE_LANGUAGES= # none
# overwrite automatically generated file with recommended one, per
# "Notes for Packagers" in documentation
post-install:
${INSTALL_SCRIPT} ${WRKSRC}/bin/todo ${DESTDIR}${PREFIX}/bin
.include "../../lang/python/application.mk"
.include "../../lang/python/egg.mk"
.include "../../mk/bsd.pkg.mk"
# needed due to py-click
TEST_ENV+= LC_ALL=en_US.UTF-8