diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 680e5c42..c68d6ad2 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -53,12 +53,14 @@ Changelog - `PR #395 `_ * Dropped support for Pydantic 1.x. - `PR #397 `_ +* Refactored methods/properties for constructing URLs in the API. + - `PR #399 `_ 2.3.4 (2024-10-21) ------------------------ * Fixed a crash at import time under Python 3.13. - `PR #396 `_ + - `PR #396 `_ 2.3.3 (2024-03-22) ------------------------ diff --git a/docs/source/migrations.rst b/docs/source/migrations.rst index f85d023c..c6fc6a8c 100644 --- a/docs/source/migrations.rst +++ b/docs/source/migrations.rst @@ -27,6 +27,37 @@ Deprecated metadata module removed The 3.0 release removed the ``pyairtable.metadata`` module. For supported alternatives, see :doc:`metadata`. +Changes to generating URLs +--------------------------------------------- + +The following properties and methods for constructing URLs have been renamed or removed. +These methods now return instances of :class:`~pyairtable.utils.Url`, which is a +subclass of ``str`` that has some overloaded operators. See docs for more details. + +.. list-table:: + :header-rows: 1 + + * - Building a URL in 2.x + - Building a URL in 3.0 + * - ``table.url`` + - ``table.urls.records`` + * - ``table.record_url(record_id)`` + - ``table.urls.record(record_id)`` + * - ``table.meta_url("one", "two")`` + - ``table.urls.meta / "one" / "two"`` + * - ``table.meta_url(*parts)`` + - ``table.urls.meta // parts`` + * - ``base.url`` + - (removed; was invalid) + * - ``base.meta_url("one", "two")`` + - ``base.urls.meta / "one" / "two"`` + * - ``base.webhooks_url()`` + - ``base.urls.webhooks`` + * - ``enterprise.url`` + - ``enterprise.urls.meta`` + * - ``workspace.url`` + - ``workspace.urls.meta`` + Changes to the formulas module --------------------------------------------- diff --git a/tox.ini b/tox.ini index f25eb585..e112cc7e 100644 --- a/tox.ini +++ b/tox.ini @@ -47,7 +47,11 @@ commands = [testenv:coverage] passenv = COVERAGE_FORMAT commands = - python -m pytest -m 'not integration' --cov=pyairtable --cov-report={env:COVERAGE_FORMAT:html} --cov-fail-under=100 + python -m pytest -m 'not integration' \ + --cov=pyairtable \ + --cov-report={env:COVERAGE_FORMAT:html} \ + --cov-report=term-missing \ + --cov-fail-under=100 [testenv:docs] basepython = python3.9