Bug 262224 - devel/py-country: Update to 22.1.10
Summary: devel/py-country: Update to 22.1.10
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dmitry Sivachenko
URL: https://github.com/flyingcircusio/pyc...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-27 10:07 UTC by Niclas
Modified: 2022-03-08 20:05 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (demon)


Attachments
Update py-country to 22.1.10 (1.44 KB, application/mbox)
2022-02-27 10:07 UTC, Niclas
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Niclas 2022-02-27 10:07:35 UTC
Created attachment 232134 [details]
Update py-country to 22.1.10

Update py-country to 22.1.10 and change PORTVERSION to DISTVERSION.
Comment 1 Niclas 2022-02-27 10:14:30 UTC
There are API changes in this update that might break some software but is needed for "newer".

18.12.8 (2018-12-08)
--------------------

WARNING: This release contains a subtle but important API change that may break
integrations!

Looking at #13416 I realized that I made a terrible API design choice with
respect to how the `get` function should behave in Python. Probably under the
influence of either too little or too much whiskey I went and implemented `get`
so that it raises a KeyError instead of doing the Pythonic thing and returning
None and allowing to customize the `default`. There was a bit of back-and-forth
around this code in previous releases (specifically touching edge cases to
have the Subdivision API behave "reasonably", although there doesn't seem
to be *one* right way there.)

Anyway, when preparing this release and reviewing #13416 and the other related
issues and changes from the past I noticed my mistake an decide to fix it
going forward.

So, from now on `get` will behave as expected in Python and yes, this means
you will have to update your integration code carefully now checking for
`None` returns instead of expecting KeyErrors. This is work, but I think it's
worthwhile to uphold this convention within the Python community.

- Switch API from "get + KeyError" to " get + default=None". This is
  a subtle API-breaking change. Please update carefully. (#13416)

- Update to iso-codes 4.1.
Comment 2 Dmitry Sivachenko freebsd_committer freebsd_triage 2022-03-08 19:46:25 UTC
(In reply to Niclas from comment #0)

> change PORTVERSION to DISTVERSION

Why?
Comment 3 Niclas 2022-03-08 19:59:03 UTC
(In reply to Dmitry Sivachenko from comment #2)
As I understand it it's preferred and should be used if PORTVERSION isn't required.
https://docs.freebsd.org/en/books/porters-handbook/book/#makefile-naming
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-03-08 20:04:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9ce82b24670c0697f14d4b994d5515857da20ab5

commit 9ce82b24670c0697f14d4b994d5515857da20ab5
Author:     Dmitry Sivachenko <demon@FreeBSD.org>
AuthorDate: 2022-03-08 20:03:35 +0000
Commit:     Dmitry Sivachenko <demon@FreeBSD.org>
CommitDate: 2022-03-08 20:03:35 +0000

    devel/py-country: update to version 22.3.5

    PR: 262224
    Submitted by:   Niclas <n_carlsson@outlook.com>

 devel/py-country/Makefile | 4 ++--
 devel/py-country/distinfo | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
Comment 5 Dmitry Sivachenko freebsd_committer freebsd_triage 2022-03-08 20:05:40 UTC
The latest version now is 22.3.5, so I updated port to this version.
Thanks for your patch!