From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 428856DE0F62 for ; Sun, 17 Nov 2019 08:42:20 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.203 X-Spam-Level: X-Spam-Status: No, score=-0.203 tagged_above=-999 required=5 tests=[AWL=-0.352, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jUNliLUFB9fr for ; Sun, 17 Nov 2019 08:42:18 -0800 (PST) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by arlo.cworth.org (Postfix) with ESMTPS id B22D26DE0F0C for ; Sun, 17 Nov 2019 08:42:17 -0800 (PST) Received: by mail-wr1-f43.google.com with SMTP id z10so16613222wrs.12 for ; Sun, 17 Nov 2019 08:42:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K+CywPvRg7KrwHSuwOG7YpvazjgeomHdIJ3IQzlcO2E=; b=FJSYR6L3WtQBhswOQ9YW+0rRo2SdhNXKuqKkNrDq8sD/F4a2Lf+g9F9dd+fh1lPYPG y003aofojlVkN3HDI7x96k2xzygrSTOP7yGNIygRZcbKEO8V8M+pYZQycc3Sr/zFYAlO qLvNFEG+Vdo4lC+nXUJMBlyE6/2kVrNHvMF0AnxJvX0qOOcqQKPjCaVOTrC36iaIdEhX iVvevKHz4RylQn4Xe8L6j4GSVxqnoSmLPKbKiR7i8GOppvfy2hrrIUZTWWEUvZY4KwDJ DV/U71gRRB+FjK/LBChRlY2kM5Ib9Vvt/I50OcGdVjsymmOFGuC49F/s87D0DE4HA4fB Nxmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=K+CywPvRg7KrwHSuwOG7YpvazjgeomHdIJ3IQzlcO2E=; b=O42GnyE6TV4B1vICldSwqRyQG+4SswNygxSn6ojjUJPOKfSyydxf6JO3udEqor+2dC hGUePlJvwjOELUgN2sldMF3xHcC7c6GGELw966rXuSflnUeLX7QZ5CAwb/2ub5bxJmpu yB6RZQwsMVhpHY0cDu+a5PUSrrNMPH2YGrXoDYdk578Us9yYyLvR5F/AzAFCY+2d3X5s QL4lRwNhiD+DQS7zOYdeRMTzm6FPRPNNDQvf/ydtDbF7u2G5RJh5IFpMPzZ6fULhdOMt 2pKPFUqrRBy9tj1Ig73rfao36OgZ9CWzN/hybTit/oA3+Jn9226KOKbBPjL4oM1DpldY azCg== X-Gm-Message-State: APjAAAU+YhXfogoQ0c/T4T94vsVQVBbw7E0wrj1y9AClvKFT1KQfPHJh W6/mXFXUULmpR06gKGq4BSyZnvuo X-Google-Smtp-Source: APXvYqyrFLGQvi9Aeazm0bkuUSkgmXd5yDRtXml7H89n8aiRRrKvTQbeN8S41UIBZMlD2gIivv7xpw== X-Received: by 2002:a5d:42d1:: with SMTP id t17mr13114738wrr.56.1574008935844; Sun, 17 Nov 2019 08:42:15 -0800 (PST) Received: from powell.devork.be ([2a02:168:58d0::7a3]) by smtp.gmail.com with ESMTPSA id z2sm7525362wrs.89.2019.11.17.08.42.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2019 08:42:15 -0800 (PST) Sender: Floris Bruynooghe Received: (nullmailer pid 221076 invoked by uid 1000); Sun, 17 Nov 2019 16:42:14 -0000 From: Floris Bruynooghe To: notmuch@notmuchmail.org Subject: [PATCH 2/2] Rename package to notmuch2 Date: Sun, 17 Nov 2019 17:41:35 +0100 Message-Id: <20191117164135.220969-3-flub@devork.be> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191117164135.220969-1-flub@devork.be> References: <20191117164135.220969-1-flub@devork.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Nov 2019 16:42:20 -0000 This is based on a previous discussion on the list where this was more or less seen as the least-bad option. --- .../{notdb => notmuch2}/__init__.py | 14 +++++++------- .../python-cffi/{notdb => notmuch2}/_base.py | 4 ++-- .../python-cffi/{notdb => notmuch2}/_build.py | 4 ++-- .../{notdb => notmuch2}/_database.py | 12 ++++++------ .../python-cffi/{notdb => notmuch2}/_errors.py | 2 +- .../{notdb => notmuch2}/_message.py | 8 ++++---- .../python-cffi/{notdb => notmuch2}/_query.py | 10 +++++----- .../python-cffi/{notdb => notmuch2}/_tags.py | 6 +++--- .../python-cffi/{notdb => notmuch2}/_thread.py | 10 +++++----- bindings/python-cffi/setup.py | 4 ++-- bindings/python-cffi/tests/test_base.py | 4 ++-- bindings/python-cffi/tests/test_database.py | 14 +++++++------- bindings/python-cffi/tests/test_message.py | 14 +++++++------- bindings/python-cffi/tests/test_tags.py | 4 ++-- bindings/python-cffi/tests/test_thread.py | 18 +++++++++--------- bindings/python-cffi/tox.ini | 4 ++-- 16 files changed, 66 insertions(+), 66 deletions(-) rename bindings/python-cffi/{notdb => notmuch2}/__init__.py (90%) rename bindings/python-cffi/{notdb => notmuch2}/_base.py (99%) rename bindings/python-cffi/{notdb => notmuch2}/_build.py (99%) rename bindings/python-cffi/{notdb => notmuch2}/_database.py (99%) rename bindings/python-cffi/{notdb => notmuch2}/_errors.py (99%) rename bindings/python-cffi/{notdb => notmuch2}/_message.py (99%) rename bindings/python-cffi/{notdb => notmuch2}/_query.py (93%) rename bindings/python-cffi/{notdb => notmuch2}/_tags.py (99%) rename bindings/python-cffi/{notdb => notmuch2}/_thread.py (97%) diff --git a/bindings/python-cffi/notdb/__init__.py b/bindings/python-cffi/notmuch2/__init__.py similarity index 90% rename from bindings/python-cffi/notdb/__init__.py rename to bindings/python-cffi/notmuch2/__init__.py index 67051df5..4d76ec15 100644 --- a/bindings/python-cffi/notdb/__init__.py +++ b/bindings/python-cffi/notmuch2/__init__.py @@ -42,13 +42,13 @@ usually more and essentially O(n) rather than O(1) as you might usually expect from Python containers. """ -from notdb import _capi -from notdb._base import * -from notdb._database import * -from notdb._errors import * -from notdb._message import * -from notdb._tags import * -from notdb._thread import * +from notmuch2 import _capi +from notmuch2._base import * +from notmuch2._database import * +from notmuch2._errors import * +from notmuch2._message import * +from notmuch2._tags import * +from notmuch2._thread import * NOTMUCH_TAG_MAX = _capi.lib.NOTMUCH_TAG_MAX diff --git a/bindings/python-cffi/notdb/_base.py b/bindings/python-cffi/notmuch2/_base.py similarity index 99% rename from bindings/python-cffi/notdb/_base.py rename to bindings/python-cffi/notmuch2/_base.py index acb64413..31258149 100644 --- a/bindings/python-cffi/notdb/_base.py +++ b/bindings/python-cffi/notmuch2/_base.py @@ -1,8 +1,8 @@ import abc import collections.abc -from notdb import _capi as capi -from notdb import _errors as errors +from notmuch2 import _capi as capi +from notmuch2 import _errors as errors __all__ = ['NotmuchObject', 'BinString'] diff --git a/bindings/python-cffi/notdb/_build.py b/bindings/python-cffi/notmuch2/_build.py similarity index 99% rename from bindings/python-cffi/notdb/_build.py rename to bindings/python-cffi/notmuch2/_build.py index 6be7e5b1..3ba3e558 100644 --- a/bindings/python-cffi/notdb/_build.py +++ b/bindings/python-cffi/notmuch2/_build.py @@ -3,14 +3,14 @@ import cffi ffibuilder = cffi.FFI() ffibuilder.set_source( - 'notdb._capi', + 'notmuch2._capi', r""" #include #include #include #if LIBNOTMUCH_MAJOR_VERSION < 5 - #error libnotmuch version not supported by notdb + #error libnotmuch version not supported by notmuch2 python bindings #endif """, include_dirs=['../../lib'], diff --git a/bindings/python-cffi/notdb/_database.py b/bindings/python-cffi/notmuch2/_database.py similarity index 99% rename from bindings/python-cffi/notdb/_database.py rename to bindings/python-cffi/notmuch2/_database.py index d414082a..a15c4d03 100644 --- a/bindings/python-cffi/notdb/_database.py +++ b/bindings/python-cffi/notmuch2/_database.py @@ -6,12 +6,12 @@ import os import pathlib import weakref -import notdb._base as base -import notdb._capi as capi -import notdb._errors as errors -import notdb._message as message -import notdb._query as querymod -import notdb._tags as tags +import notmuch2._base as base +import notmuch2._capi as capi +import notmuch2._errors as errors +import notmuch2._message as message +import notmuch2._query as querymod +import notmuch2._tags as tags __all__ = ['Database', 'AtomicContext', 'DbRevision'] diff --git a/bindings/python-cffi/notdb/_errors.py b/bindings/python-cffi/notmuch2/_errors.py similarity index 99% rename from bindings/python-cffi/notdb/_errors.py rename to bindings/python-cffi/notmuch2/_errors.py index 924e722f..1c88763b 100644 --- a/bindings/python-cffi/notdb/_errors.py +++ b/bindings/python-cffi/notmuch2/_errors.py @@ -1,4 +1,4 @@ -from notdb import _capi as capi +from notmuch2 import _capi as capi class NotmuchError(Exception): diff --git a/bindings/python-cffi/notdb/_message.py b/bindings/python-cffi/notmuch2/_message.py similarity index 99% rename from bindings/python-cffi/notdb/_message.py rename to bindings/python-cffi/notmuch2/_message.py index 9b2b037f..bb561426 100644 --- a/bindings/python-cffi/notdb/_message.py +++ b/bindings/python-cffi/notmuch2/_message.py @@ -4,10 +4,10 @@ import os import pathlib import weakref -import notdb._base as base -import notdb._capi as capi -import notdb._errors as errors -import notdb._tags as tags +import notmuch2._base as base +import notmuch2._capi as capi +import notmuch2._errors as errors +import notmuch2._tags as tags __all__ = ['Message'] diff --git a/bindings/python-cffi/notdb/_query.py b/bindings/python-cffi/notmuch2/_query.py similarity index 93% rename from bindings/python-cffi/notdb/_query.py rename to bindings/python-cffi/notmuch2/_query.py index 613aaf12..1db6ec96 100644 --- a/bindings/python-cffi/notdb/_query.py +++ b/bindings/python-cffi/notmuch2/_query.py @@ -1,8 +1,8 @@ -from notdb import _base as base -from notdb import _capi as capi -from notdb import _errors as errors -from notdb import _message as message -from notdb import _thread as thread +from notmuch2 import _base as base +from notmuch2 import _capi as capi +from notmuch2 import _errors as errors +from notmuch2 import _message as message +from notmuch2 import _thread as thread __all__ = [] diff --git a/bindings/python-cffi/notdb/_tags.py b/bindings/python-cffi/notmuch2/_tags.py similarity index 99% rename from bindings/python-cffi/notdb/_tags.py rename to bindings/python-cffi/notmuch2/_tags.py index a25a2264..fe422a79 100644 --- a/bindings/python-cffi/notdb/_tags.py +++ b/bindings/python-cffi/notmuch2/_tags.py @@ -1,8 +1,8 @@ import collections.abc -import notdb._base as base -import notdb._capi as capi -import notdb._errors as errors +import notmuch2._base as base +import notmuch2._capi as capi +import notmuch2._errors as errors __all__ = ['ImmutableTagSet', 'MutableTagSet', 'TagsIter'] diff --git a/bindings/python-cffi/notdb/_thread.py b/bindings/python-cffi/notmuch2/_thread.py similarity index 97% rename from bindings/python-cffi/notdb/_thread.py rename to bindings/python-cffi/notmuch2/_thread.py index e1ef6b07..a754749f 100644 --- a/bindings/python-cffi/notdb/_thread.py +++ b/bindings/python-cffi/notmuch2/_thread.py @@ -1,11 +1,11 @@ import collections.abc import weakref -from notdb import _base as base -from notdb import _capi as capi -from notdb import _errors as errors -from notdb import _message as message -from notdb import _tags as tags +from notmuch2 import _base as base +from notmuch2 import _capi as capi +from notmuch2 import _errors as errors +from notmuch2 import _message as message +from notmuch2 import _tags as tags __all__ = ['Thread'] diff --git a/bindings/python-cffi/setup.py b/bindings/python-cffi/setup.py index 7baf63cf..37918e3d 100644 --- a/bindings/python-cffi/setup.py +++ b/bindings/python-cffi/setup.py @@ -2,7 +2,7 @@ import setuptools setuptools.setup( - name='notdb', + name='notmuch2', version='0.1', description='Pythonic bindings for the notmuch mail database using CFFI', author='Floris Bruynooghe', @@ -10,7 +10,7 @@ setuptools.setup( setup_requires=['cffi>=1.0.0'], install_requires=['cffi>=1.0.0'], packages=setuptools.find_packages(exclude=['tests']), - cffi_modules=['notdb/_build.py:ffibuilder'], + cffi_modules=['notmuch2/_build.py:ffibuilder'], classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', diff --git a/bindings/python-cffi/tests/test_base.py b/bindings/python-cffi/tests/test_base.py index b6d3d62c..d3280a67 100644 --- a/bindings/python-cffi/tests/test_base.py +++ b/bindings/python-cffi/tests/test_base.py @@ -1,7 +1,7 @@ import pytest -from notdb import _base as base -from notdb import _errors as errors +from notmuch2 import _base as base +from notmuch2 import _errors as errors class TestNotmuchObject: diff --git a/bindings/python-cffi/tests/test_database.py b/bindings/python-cffi/tests/test_database.py index 02de0f41..e3a8344d 100644 --- a/bindings/python-cffi/tests/test_database.py +++ b/bindings/python-cffi/tests/test_database.py @@ -5,10 +5,10 @@ import pathlib import pytest -import notdb -import notdb._errors as errors -import notdb._database as dbmod -import notdb._message as message +import notmuch2 +import notmuch2._errors as errors +import notmuch2._database as dbmod +import notmuch2._message as message @pytest.fixture @@ -279,7 +279,7 @@ class TestQuery: @pytest.fixture def db(self, maildir, notmuch): - """Return a read-only notdb.Database. + """Return a read-only notmuch2.Database. The database will have 3 messages, 2 threads. """ @@ -306,7 +306,7 @@ class TestQuery: def test_message_match(self, db): msgs = db.messages('*') msg = next(msgs) - assert isinstance(msg, notdb.Message) + assert isinstance(msg, notmuch2.Message) def test_count_threads(self, db): assert db.count_threads('*') == 2 @@ -323,4 +323,4 @@ class TestQuery: def test_threads_match(self, db): threads = db.threads('*') thread = next(threads) - assert isinstance(thread, notdb.Thread) + assert isinstance(thread, notmuch2.Thread) diff --git a/bindings/python-cffi/tests/test_message.py b/bindings/python-cffi/tests/test_message.py index 56d06f34..532bf921 100644 --- a/bindings/python-cffi/tests/test_message.py +++ b/bindings/python-cffi/tests/test_message.py @@ -4,7 +4,7 @@ import pathlib import pytest -import notdb +import notmuch2 class TestMessage: @@ -17,7 +17,7 @@ class TestMessage: @pytest.fixture def db(self, maildir): - with notdb.Database.create(maildir.path) as db: + with notmuch2.Database.create(maildir.path) as db: yield db @pytest.fixture @@ -26,8 +26,8 @@ class TestMessage: yield msg def test_type(self, msg): - assert isinstance(msg, notdb.NotmuchObject) - assert isinstance(msg, notdb.Message) + assert isinstance(msg, notmuch2.NotmuchObject) + assert isinstance(msg, notmuch2.Message) def test_alive(self, msg): assert msg.alive @@ -41,7 +41,7 @@ class TestMessage: def test_messageid_type(self, msg): assert isinstance(msg.messageid, str) - assert isinstance(msg.messageid, notdb.BinString) + assert isinstance(msg.messageid, notmuch2.BinString) assert isinstance(bytes(msg.messageid), bytes) def test_messageid(self, msg, maildir_msg): @@ -53,7 +53,7 @@ class TestMessage: def test_threadid_type(self, msg): assert isinstance(msg.threadid, str) - assert isinstance(msg.threadid, notdb.BinString) + assert isinstance(msg.threadid, notmuch2.BinString) assert isinstance(bytes(msg.threadid), bytes) def test_path_type(self, msg): @@ -142,7 +142,7 @@ class TestProperties: @pytest.fixture def props(self, maildir): msgid, path = maildir.deliver() - with notdb.Database.create(maildir.path) as db: + with notmuch2.Database.create(maildir.path) as db: msg, dup = db.add(path, sync_flags=False) yield msg.properties diff --git a/bindings/python-cffi/tests/test_tags.py b/bindings/python-cffi/tests/test_tags.py index 0cb42d89..f12fa1e6 100644 --- a/bindings/python-cffi/tests/test_tags.py +++ b/bindings/python-cffi/tests/test_tags.py @@ -9,8 +9,8 @@ import textwrap import pytest -from notdb import _database as database -from notdb import _tags as tags +from notmuch2 import _database as database +from notmuch2 import _tags as tags class TestImmutable: diff --git a/bindings/python-cffi/tests/test_thread.py b/bindings/python-cffi/tests/test_thread.py index 366bd8a5..1f44b35d 100644 --- a/bindings/python-cffi/tests/test_thread.py +++ b/bindings/python-cffi/tests/test_thread.py @@ -3,7 +3,7 @@ import time import pytest -import notdb +import notmuch2 @pytest.fixture @@ -13,17 +13,17 @@ def thread(maildir, notmuch): maildir.deliver(body='bar', headers=[('In-Reply-To', '<{}>'.format(msgid))]) notmuch('new') - with notdb.Database(maildir.path) as db: + with notmuch2.Database(maildir.path) as db: yield next(db.threads('foo')) def test_type(thread): - assert isinstance(thread, notdb.Thread) + assert isinstance(thread, notmuch2.Thread) assert isinstance(thread, collections.abc.Iterable) def test_threadid(thread): - assert isinstance(thread.threadid, notdb.BinString) + assert isinstance(thread.threadid, notmuch2.BinString) assert thread.threadid @@ -37,21 +37,21 @@ def test_toplevel_type(thread): def test_toplevel(thread): msgs = thread.toplevel() - assert isinstance(next(msgs), notdb.Message) + assert isinstance(next(msgs), notmuch2.Message) with pytest.raises(StopIteration): next(msgs) def test_toplevel_reply(thread): msg = next(thread.toplevel()) - assert isinstance(next(msg.replies()), notdb.Message) + assert isinstance(next(msg.replies()), notmuch2.Message) def test_iter(thread): msgs = list(iter(thread)) assert len(msgs) == len(thread) for msg in msgs: - assert isinstance(msg, notdb.Message) + assert isinstance(msg, notmuch2.Message) def test_matched(thread): @@ -59,7 +59,7 @@ def test_matched(thread): def test_authors_type(thread): - assert isinstance(thread.authors, notdb.BinString) + assert isinstance(thread.authors, notmuch2.BinString) def test_authors(thread): @@ -91,7 +91,7 @@ def test_first_last(thread): def test_tags_type(thread): - assert isinstance(thread.tags, notdb.ImmutableTagSet) + assert isinstance(thread.tags, notmuch2.ImmutableTagSet) def test_tags_cache(thread): diff --git a/bindings/python-cffi/tox.ini b/bindings/python-cffi/tox.ini index d6b87987..34148a11 100644 --- a/bindings/python-cffi/tox.ini +++ b/bindings/python-cffi/tox.ini @@ -1,6 +1,6 @@ [pytest] minversion = 3.0 -addopts = -ra --cov=notdb --cov=tests +addopts = -ra --cov=notmuch2 --cov=tests [tox] envlist = py35,py36,py37,pypy35,pypy36 @@ -10,7 +10,7 @@ deps = cffi pytest pytest-cov -commands = pytest --cov={envsitepackagesdir}/notdb {posargs} +commands = pytest --cov={envsitepackagesdir}/notmuch2 {posargs} [testenv:pypy35] basepython = pypy3.5 -- 2.24.0