1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 poetry-core,
7 pytestCheckHook,
8}:
9
10buildPythonPackage rec {
11 pname = "pycountry";
12 version = "24.6.1";
13 pyproject = true;
14
15 disabled = pythonOlder "3.8";
16
17 src = fetchFromGitHub {
18 owner = "pycountry";
19 repo = "pycountry";
20 tag = version;
21 hash = "sha256-4YVPh6OGWguqO9Ortv+vAejxx7WLs4u0SVLv8JlKSWM=";
22 };
23
24 postPatch = ''
25 sed -i "/addopts/d" pyproject.toml
26 sed -i "/pytest-cov/d" pyproject.toml
27 '';
28
29 build-system = [ poetry-core ];
30
31 nativeCheckInputs = [ pytestCheckHook ];
32
33 pythonImportsCheck = [ "pycountry" ];
34
35 meta = {
36 homepage = "https://github.com/pycountry/pycountry";
37 changelog = "https://github.com/pycountry/pycountry/blob/${src.rev}/HISTORY.txt";
38 description = "ISO country, subdivision, language, currency and script definitions and their translations";
39 license = lib.licenses.lgpl21Plus;
40 maintainers = with lib.maintainers; [ dotlambda ];
41 };
42}