11{
22 lib ,
3- python3 ,
3+ python3Packages ,
44 fetchFromGitHub ,
5- fetchpatch ,
65} :
76
8- python3 . pkgs . buildPythonApplication rec {
7+ python3Packages . buildPythonApplication rec {
98 pname = "cloudsmith-cli" ;
10- version = "1.2.5 " ;
11- format = "setuptools" ;
9+ version = "1.8.3 " ;
10+ pyproject = true ;
1211
1312 src = fetchFromGitHub {
1413 owner = "cloudsmith-io" ;
1514 repo = "cloudsmith-cli" ;
1615 tag = "v${ version } " ;
17- hash = "sha256-UzyfOmjJzYEJYA6c4kn5XCvRVIMuiIpiq0kH9UhBwmo =" ;
16+ hash = "sha256-PYqOj6nHjJrG7Ndc5vm//E8mjk4xZFVQopFqiWtH5ZQ =" ;
1817 } ;
1918
20- patches = [
21- # Fix compatibility with urllib3 2.0
22- ( fetchpatch {
23- url = "https://github.com/cloudsmith-io/cloudsmith-cli/commit/1a8d2d91c01320537b26778003735d6b694141c2.patch" ;
24- revert = true ;
25- includes = [
26- "cloudsmith_cli/core/rest.py"
27- ] ;
28- hash = "sha256-Rf3MMJuLr8fzkRqSftIJ1eUbgNdfrng2V609jYvpogc=" ;
29- } )
30- ] ;
19+ postPatch = ''
20+ # Fix compatibility with urllib3 >= 2.0 - method_whitelist renamed to allowed_methods
21+ # https://github.com/cloudsmith-io/cloudsmith-cli/pull/148
22+ substituteInPlace cloudsmith_cli/core/rest.py \
23+ --replace-fail 'method_whitelist=False' 'allowed_methods=False'
24+ substituteInPlace setup.py \
25+ --replace-fail 'urllib3<2.0' 'urllib3'
26+ '' ;
3127
32- nativeBuildInputs = with python3 . pkgs ; [
33- pip
34- ] ;
28+ build-system = with python3Packages ; [ setuptools ] ;
3529
36- propagatedBuildInputs = with python3 . pkgs ; [
30+ dependencies = with python3Packages ; [
3731 click
3832 click-configfile
3933 click-didyoumean
4034 click-spinner
4135 cloudsmith-api
42- colorama
43- future
36+ keyring
4437 requests
4538 requests-toolbelt
4639 semver
47- simplejson
48- six
49- setuptools # needs pkg_resources
40+ urllib3
5041 ] ;
5142
52- nativeCheckInputs = with python3 . pkgs ; [
43+ nativeCheckInputs = with python3Packages ; [
5344 pytestCheckHook
5445 pytest-cov-stub
55- ] ;
56-
57- checkInputs = with python3 . pkgs ; [
46+ freezegun
5847 httpretty
5948 ] ;
6049
6150 pythonImportsCheck = [
6251 "cloudsmith_cli"
6352 ] ;
6453
65- postPatch = ''
66- # Permit urllib3 2.0
67- substituteInPlace setup.py \
68- --replace-fail 'urllib3<2.0' 'urllib3'
69- '' ;
70-
7154 preCheck = ''
72- # E _pytest.pathlib.ImportPathMismatchError: ('cloudsmith_cli.cli.tests.conftest', '/build/source/build/lib/cloudsmith_cli/cli/tests/conftest.py', PosixPath('/build/source/cloudsmith_cli/cli/tests/conftest.py'))
73- # ___________ ERROR collecting cloudsmith_cli/core/tests/test_init.py ____________
74- # import file mismatch:
75- # imported module 'cloudsmith_cli.core.tests.test_init' has this __file__ attribute:
76- # /build/source/build/lib/cloudsmith_cli/core/tests/test_init.py
77- # which is not the same as the test file we want to collect:
78- # /build/source/cloudsmith_cli/core/tests/test_init.py
79- # HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
55+ # When test_implicit_retry_for_status_codes calls initialise_api(),
56+ # and no user strings like LOGNAME or USER is set, getpass will call
57+ # getpwuid() which will then fail when we enable auto-allocate-uids.
58+ export USER=nixbld
8059 # https://github.com/NixOS/nixpkgs/issues/255262
8160 cd "$out"
8261 '' ;
@@ -88,6 +67,6 @@ python3.pkgs.buildPythonApplication rec {
8867 changelog = "https://github.com/cloudsmith-io/cloudsmith-cli/blob/v${ version } /CHANGELOG.md" ;
8968 maintainers = with lib . maintainers ; [ ] ;
9069 license = lib . licenses . asl20 ;
91- platforms = with lib . platforms ; unix ;
70+ platforms = lib . platforms . unix ;
9271 } ;
9372}
0 commit comments