11{ lib
22, buildPythonPackage
3+ , pythonOlder
34, fetchFromGitHub
4- , fetchpatch
55, chardet
6+ , click
7+ , flex
8+ , packaging
9+ , pyicu
610, requests
711, ruamel-yaml
812, setuptools-scm
913, six
10- , semver
14+ , swagger-spec-validator
1115, pytestCheckHook
1216, openapi-spec-validator
1317} :
1418
1519buildPythonPackage rec {
1620 pname = "prance" ;
17- version = "0.21.8 .0" ;
21+ version = "0.22.02.22 .0" ;
1822 format = "pyproject" ;
1923
24+ disabled = pythonOlder "3.8" ;
25+
2026 src = fetchFromGitHub {
2127 owner = "RonnyPfannschmidt" ;
2228 repo = pname ;
2329 rev = "v${ version } " ;
2430 fetchSubmodules = true ;
25- hash = "sha256-kGANMHfWwhW3ZBw2ZVCJZR/bV2EPhcydMKhDeDTVwcQ =" ;
31+ hash = "sha256-NtIbZp34IcMYJzaNQVL9GLdNS3NYOCRoWS1wGg/gLVA =" ;
2632 } ;
2733
28- patches = [
29- # Fix for openapi-spec-validator 0.5.0+:
30- # https://github.com/RonnyPfannschmidt/prance/pull/132
31- ( fetchpatch {
32- name = "1-openapi-spec-validator-upgrade.patch" ;
33- url = "https://github.com/RonnyPfannschmidt/prance/commit/55503c9b12b685863c932ededac996369e7d288a.patch" ;
34- hash = "sha256-7SOgFsk2aaaaAYS8WJ9axqQFyEprurn6Zn12NcdQ9Bg=" ;
35- } )
36- ( fetchpatch {
37- name = "2-openapi-spec-validator-upgrade.patch" ;
38- url = "https://github.com/RonnyPfannschmidt/prance/commit/7e59cc69c6c62fd04875105773d9d220bb58fea6.patch" ;
39- hash = "sha256-j6vmY3NqDswp7v9682H+/MxMGtFObMxUeL9Wbiv9hYw=" ;
40- } )
41- ( fetchpatch {
42- name = "3-openapi-spec-validator-upgrade.patch" ;
43- url = "https://github.com/RonnyPfannschmidt/prance/commit/7e575781d83845d7ea0c2eff57644df9b465c7af.patch" ;
44- hash = "sha256-rexKoQ+TH3QmP20c3bA+7BLMLc+fkVhn7xsq+gle1Aw=" ;
45- } )
46- ] ;
47-
4834 postPatch = ''
4935 substituteInPlace setup.cfg \
50- --replace "--cov=prance --cov-report=term-missing --cov-fail-under=90" "" \
51- --replace "chardet>=3.0,<5.0" "chardet"
36+ --replace "--cov=prance --cov-report=term-missing --cov-fail-under=90" ""
5237 '' ;
5338
5439 SETUPTOOLS_SCM_PRETEND_VERSION = version ;
@@ -59,27 +44,37 @@ buildPythonPackage rec {
5944
6045 propagatedBuildInputs = [
6146 chardet
47+ packaging
6248 requests
6349 ruamel-yaml
6450 six
65- semver
6651 ] ;
6752
53+ passthru . optional-dependencies = {
54+ cli = [ click ] ;
55+ flex = [ flex ] ;
56+ icu = [ pyicu ] ;
57+ osv = [ openapi-spec-validator ] ;
58+ ssv = [ swagger-spec-validator ] ;
59+ } ;
60+
6861 nativeCheckInputs = [
6962 pytestCheckHook
70- openapi-spec-validator
71- ] ;
63+ ] ++ lib . flatten ( lib . attrValues passthru . optional-dependencies ) ;
7264
7365 # Disable tests that require network
7466 disabledTestPaths = [
7567 "tests/test_convert.py"
7668 ] ;
7769 disabledTests = [
70+ "test_convert_defaults"
71+ "test_convert_output"
7872 "test_fetch_url_http"
7973 ] ;
8074 pythonImportsCheck = [ "prance" ] ;
8175
8276 meta = with lib ; {
77+ changelog = "https://github.com/RonnyPfannschmidt/prance/blob/${ src . rev } /CHANGES.rst" ;
8378 description = "Resolving Swagger/OpenAPI 2.0 and 3.0.0 Parser" ;
8479 homepage = "https://github.com/RonnyPfannschmidt/prance" ;
8580 license = licenses . mit ;
0 commit comments