Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No matching distribution found for platformdirs<3,>=2 #340

Closed
l0b0 opened this issue Jul 26, 2021 · 5 comments · Fixed by #371
Closed

No matching distribution found for platformdirs<3,>=2 #340

l0b0 opened this issue Jul 26, 2021 · 5 comments · Fixed by #371

Comments

@l0b0
Copy link
Contributor

l0b0 commented Jul 26, 2021

To reproduce:

  1. Clone/git checkout this commit
  2. Add the following shell.nix:
    { pkgs ? import <nixpkgs> {} }:
    pkgs.poetry2nix.mkPoetryEnv {
      projectDir = ./.;
    
      overrides = self: super: {
        ruamel-yaml = super.ruamel-yaml.overridePythonAttrs (old: {
          propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [
            self.ruamel-yaml-clib
          ];
        });
      };
    }
    
  3. Run nix-shell

What happens:

$ nix-shell
these derivations will be built:
  /nix/store/flbcb4b7218jgcb3ixsa2c0zxck689ss-python3.8-click-7.1.2.drv
  /nix/store/0azyr54gip9hzik6l44j3qsgv65g0p3r-python3.8-toml-sort-0.19.0.drv
  /nix/store/47743gqx5dsr5wmqp87amxwg86cxvzvl-python-dateutil-2.8.2.tar.gz.drv
  /nix/store/4964lywxqwrhf5r4n7nnqivpiwy521yk-python3.8-python-dateutil-2.8.2.drv
  /nix/store/8kl2dfbn5gkhch27jwn5mqapmliz3zzi-python3.8-arrow-1.0.3.drv
  /nix/store/fx46gffvvbv58n0agmpbdxy3zkj82d31-python3.8-requests-2.26.0.drv
  /nix/store/rr1182xk0yivrdkk641nv3i5j9nj0cj5-python3.8-ruamel-yaml-clib-0.2.6.drv
  /nix/store/lc55gqzmaqg3yghqyd5kx74s8rldfyfh-python3.8-ruamel-yaml-0.17.10.drv
  /nix/store/a4w8g4mqkplllhbp4jxzm185q4amjlj4-python3.8-language-formatters-pre-commit-hooks-2.1.0.drv
  /nix/store/qkxn37h6jk6k29q2kw51p930gw2h2hrf-python3.8-sh-1.14.1.drv
  /nix/store/xjch4d045sj316qz8kpra4ilbjdn3kl2-gitlint-0.15.1.tar.gz.drv
  /nix/store/cg0c2r24swhmh6f1i0zcf4z6bn0gcs4v-python3.8-gitlint-0.15.1.drv
  /nix/store/gsqa5yg2kjskn03614aharw8s5bf5623-python3.8-virtualenv-20.6.0.drv
  /nix/store/zd06jji3dw67pjbmzjb5dl6brsb6mpbd-python3.8-pre-commit-2.13.0.drv
these paths will be fetched (0.44 MiB download, 0.44 MiB unpacked):
  /nix/store/37aaqvw9c0knn9n498b7zvpzsil0377x-arrow-1.0.3.tar.gz
  /nix/store/7r4zhz3cckywcmgcc87165kz9b5rjldc-sh-1.14.1.tar.gz
  /nix/store/7rdlwkim1xvb9fs6ppv41ynh5vlxhyjg-click-7.1.2.tar.gz
copying path '/nix/store/7rdlwkim1xvb9fs6ppv41ynh5vlxhyjg-click-7.1.2.tar.gz' from 'https://cache.nixos.org'...
copying path '/nix/store/7r4zhz3cckywcmgcc87165kz9b5rjldc-sh-1.14.1.tar.gz' from 'https://cache.nixos.org'...
copying path '/nix/store/37aaqvw9c0knn9n498b7zvpzsil0377x-arrow-1.0.3.tar.gz' from 'https://cache.nixos.org'...
building '/nix/store/fx46gffvvbv58n0agmpbdxy3zkj82d31-python3.8-requests-2.26.0.drv'...
building '/nix/store/rr1182xk0yivrdkk641nv3i5j9nj0cj5-python3.8-ruamel-yaml-clib-0.2.6.drv'...
building '/nix/store/gsqa5yg2kjskn03614aharw8s5bf5623-python3.8-virtualenv-20.6.0.drv'...
building '/nix/store/xjch4d045sj316qz8kpra4ilbjdn3kl2-gitlint-0.15.1.tar.gz.drv'...
building '/nix/store/47743gqx5dsr5wmqp87amxwg86cxvzvl-python-dateutil-2.8.2.tar.gz.drv'...
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pip-build-hook
Using pipBuildPhase
Using pipShellHook
Sourcing pip-install-hook
Sourcing python-remove-tests-dir-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pip-build-hook
Using pipBuildPhase
Using pipShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pip-build-hook
Using pipBuildPhase
Using pipShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
unpacking sources
unpacking sources
unpacking source archive /nix/store/z5aq7a1gd57hpdsvv90rsq6vmw9w0lb9-requests-2.26.0.tar.gz
unpacking source archive /nix/store/kad4nk1wfrklflvfnmfpnm64fgrr8qzq-ruamel.yaml.clib-0.2.6.tar.gz
source root is requests-2.26.0
source root is ruamel.yaml.clib-0.2.6
setting SOURCE_DATE_EPOCH to timestamp 1626188072 of file requests-2.26.0/setup.cfg
patching sources
configuring
setting SOURCE_DATE_EPOCH to timestamp 1625405355 of file ruamel.yaml.clib-0.2.6/setup.cfg
no configure script, doing nothing
building
patching sources
unpacking sources
Executing pipBuildPhase
unpacking source archive /nix/store/xm5pf0ixjgqn9qx9jj458m0a0pcjs72n-virtualenv-20.6.0.tar.gz
configuring
Creating a wheel...
no configure script, doing nothing
building
Executing pipBuildPhase
Creating a wheel...
source root is virtualenv-20.6.0
setting SOURCE_DATE_EPOCH to timestamp 1626289366 of file virtualenv-20.6.0/setup.cfg
patching sources
building '/nix/store/qkxn37h6jk6k29q2kw51p930gw2h2hrf-python3.8-sh-1.14.1.drv'...
configuring
no configure script, doing nothing
building
Executing pipBuildPhase
Removing pyproject.toml...
Creating a wheel...
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pip-build-hook
Using pipBuildPhase
Using pipShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
building '/nix/store/flbcb4b7218jgcb3ixsa2c0zxck689ss-python3.8-click-7.1.2.drv'...
unpacking sources
unpacking source archive /nix/store/7r4zhz3cckywcmgcc87165kz9b5rjldc-sh-1.14.1.tar.gz
source root is sh-1.14.1
setting SOURCE_DATE_EPOCH to timestamp 1603560955 of file sh-1.14.1/sh.egg-info/top_level.txt
patching sources
configuring
no configure script, doing nothing
building
Executing pipBuildPhase
Creating a wheel...
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pip-build-hook
Using pipBuildPhase
Using pipShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
unpacking sources
unpacking source archive /nix/store/7rdlwkim1xvb9fs6ppv41ynh5vlxhyjg-click-7.1.2.tar.gz
source root is click-7.1.2
setting SOURCE_DATE_EPOCH to timestamp 1588018845 of file click-7.1.2/setup.cfg
patching sources
configuring
no configure script, doing nothing
building
Executing pipBuildPhase
Creating a wheel...

trying https://files.pythonhosted.org/packages/source/p/python-dateutil/python-dateutil-2.8.2.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
100  348k  100  348k    0     0  1170k      0 --:--:-- --:--:-- --:--:-- 1170k

trying https://files.pythonhosted.org/packages/source/g/gitlint/gitlint-0.15.1.tar.gz
building '/nix/store/4964lywxqwrhf5r4n7nnqivpiwy521yk-python3.8-python-dateutil-2.8.2.drv'...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
Processing /build/ruamel.yaml.clib-0.2.6
Processing /build/requests-2.26.0
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pip-build-hook
Using pipBuildPhase
Using pipShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
unpacking sources
unpacking source archive /nix/store/c609f7yig14sg7h7nb3qqsb136pfrrw4-python-dateutil-2.8.2.tar.gz
source root is python-dateutil-2.8.2
setting SOURCE_DATE_EPOCH to timestamp 1626250753 of file python-dateutil-2.8.2/setup.cfg
patching sources
WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Processing /build/virtualenv-20.6.0
configuring
WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
no configure script, doing nothing
building
Executing pipBuildPhase
Removing pyproject.toml...
Creating a wheel...
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Processing /build/sh-1.14.1
WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Processing /build/click-7.1.2
100 35807  100 35807    0     0  85458      0 --:--:-- --:--:-- --:--:-- 85458
Building wheels for collected packages: ruamel.yaml.clib
Building wheels for collected packages: virtualenv
Building wheels for collected packages: requests
Building wheels for collected packages: sh
Building wheels for collected packages: click
WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Processing /build/python-dateutil-2.8.2
  Building wheel for sh (setup.py) ... done
  Created wheel for sh: filename=sh-1.14.1-py2.py3-none-any.whl size=40338 sha256=4d6679edf2d6830c7684e3ed97f3430b8c7bd500135c5bd68c405a19bb01d998
  Stored in directory: /build/pip-ephem-wheel-cache-21w4l0y2/wheels/1a/da/90/c20bab73aff77dad7cc2cc7cbd7c2d94a4a9d2426d52fdc2b4
Successfully built sh
  Building wheel for click (setup.py) ... done
  Created wheel for click: filename=click-7.1.2-py2.py3-none-any.whl size=82781 sha256=37bb823d134aea3f516b452680a71f4e61bb1116c2c66fec8e98f1bb69ffa305
  Stored in directory: /build/pip-ephem-wheel-cache-c00kc5f_/wheels/3e/be/f8/afa7aa9962415088f7a4391de48c1fd8a86046ee19898128c6
Successfully built click
Finished creating a wheel...
Finished executing pipBuildPhase
installing
Executing pipInstallPhase
/build/sh-1.14.1/dist /build/sh-1.14.1
Finished creating a wheel...
Finished executing pipBuildPhase
installing
Executing pipInstallPhase
/build/click-7.1.2/dist /build/click-7.1.2
  Building wheel for requests (setup.py) ... done
  Created wheel for requests: filename=requests-2.26.0-py2.py3-none-any.whl size=62251 sha256=f224bda9dc65c7667cee3153b964745ea41f938fc560403ed8c61469f5ec2223
  Stored in directory: /build/pip-ephem-wheel-cache-xksg37aq/wheels/3e/0d/93/fffa576b173083c1d8f77dd152f181eae444ec9b1f919b3aec
Successfully built requests
Finished creating a wheel...
Finished executing pipBuildPhase
installing
Executing pipInstallPhase
/build/requests-2.26.0/dist /build/requests-2.26.0
Building wheels for collected packages: python-dateutil
  Building wheel for virtualenv (setup.py) ... done
  Created wheel for virtualenv: filename=virtualenv-20.6.0-py2.py3-none-any.whl size=5297066 sha256=86543805ddd493b2008faf98e8320c488227b0fccd0c415ef94df56d78756c92
  Stored in directory: /build/pip-ephem-wheel-cache-2wjgfc7l/wheels/9e/7b/40/d0445a21690fe307850da277d69c54b29cc1ea3737f210f1b0
Successfully built virtualenv
Finished creating a wheel...
Finished executing pipBuildPhase
installing
Executing pipInstallPhase
/build/virtualenv-20.6.0/dist /build/virtualenv-20.6.0
Processing ./sh-1.14.1-py2.py3-none-any.whl
Processing ./click-7.1.2-py2.py3-none-any.whl
Installing collected packages: sh
Installing collected packages: click
  Building wheel for python-dateutil (setup.py) ... done
  Created wheel for python-dateutil: filename=python_dateutil-2.8.2-py2.py3-none-any.whl size=247694 sha256=cb86265ba8268f7d8ae6292c5b89e959414c6c0f650561b6ba38f5b07e901255
  Stored in directory: /build/pip-ephem-wheel-cache-pwo21llh/wheels/f8/23/7a/b92ded606b490e74771553149d2adf511e3090577a16c53812
Processing ./requests-2.26.0-py2.py3-none-any.whl
Successfully built python-dateutil
Successfully installed sh-1.14.1
Requirement already satisfied: charset-normalizer~=2.0.0 in /nix/store/wvf7y7p16h634lgb36slh6dav4vhma77-python3.8-charset-normalizer-2.0.3/lib/python3.8/site-packages (from requests==2.26.0) (2.0.3)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /nix/store/l301ajrcx5mrbf7nlsaw8rymw9lkh7y6-python3.8-urllib3-1.26.6/lib/python3.8/site-packages (from requests==2.26.0) (1.26.6)
Requirement already satisfied: certifi>=2017.4.17 in /nix/store/rnsggflg0rsqqpqa0gvxpik6vnp1all2-python3.8-certifi-2021.5.30/lib/python3.8/site-packages (from requests==2.26.0) (2021.5.30)
Requirement already satisfied: idna<4,>=2.5 in /nix/store/l8a1aag4b0f8492q56ysgi8cydbngh75-python3.8-idna-3.2/lib/python3.8/site-packages (from requests==2.26.0) (3.2)
Finished creating a wheel...
Finished executing pipBuildPhase
installing
Successfully installed click-7.1.2
Executing pipInstallPhase
/build/python-dateutil-2.8.2/dist /build/python-dateutil-2.8.2
/build/sh-1.14.1
Finished executing pipInstallPhase
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/msqi2zxvbd4nvc5vgpm4jldp11fwljsq-python3.8-sh-1.14.1
strip is /nix/store/sgrwh6jsrshrnicqi67fck336q6ldh2d-binutils-2.35.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/msqi2zxvbd4nvc5vgpm4jldp11fwljsq-python3.8-sh-1.14.1/lib
/build/click-7.1.2
Finished executing pipInstallPhase
post-installation fixup
patching script interpreter paths in /nix/store/msqi2zxvbd4nvc5vgpm4jldp11fwljsq-python3.8-sh-1.14.1
shrinking RPATHs of ELF executables and libraries in /nix/store/4cakr31n8ywbn1dy0g1ww1asgmz4layv-python3.8-click-7.1.2
checking for references to /build/ in /nix/store/msqi2zxvbd4nvc5vgpm4jldp11fwljsq-python3.8-sh-1.14.1...
Executing pythonRemoveTestsDir
Finished executing pythonRemoveTestsDir
pythonCatchConflictsPhase
strip is /nix/store/sgrwh6jsrshrnicqi67fck336q6ldh2d-binutils-2.35.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/4cakr31n8ywbn1dy0g1ww1asgmz4layv-python3.8-click-7.1.2/lib
Installing collected packages: requests
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
poetry 1.1.5 requires cachecontrol[filecache]<0.13.0,>=0.12.4, which is not installed.
poetry 1.1.5 requires cachy<0.4.0,>=0.3.0, which is not installed.
poetry 1.1.5 requires cleo<0.9.0,>=0.8.1, which is not installed.
poetry 1.1.5 requires clikit<0.7.0,>=0.6.2, which is not installed.
poetry 1.1.5 requires crashtest<0.4.0,>=0.3.0; python_version >= "3.6" and python_version < "4.0", which is not installed.
poetry 1.1.5 requires html5lib<2.0,>=1.0, which is not installed.
poetry 1.1.5 requires keyring<22.0.0,>=21.2.0; python_version >= "3.6" and python_version < "4.0", which is not installed.
poetry 1.1.5 requires packaging<21.0,>=20.4, which is not installed.
poetry 1.1.5 requires pexpect<5.0.0,>=4.7.0, which is not installed.
poetry 1.1.5 requires pkginfo<2.0,>=1.4, which is not installed.
poetry 1.1.5 requires poetry-core<1.1.0,>=1.0.2, which is not installed.
poetry 1.1.5 requires requests-toolbelt<0.10.0,>=0.9.1, which is not installed.
poetry 1.1.5 requires shellingham<2.0,>=1.1, which is not installed.
poetry 1.1.5 requires tomlkit<1.0.0,>=0.7.0, which is not installed.
poetry 1.1.5 requires virtualenv<21.0.0,>=20.0.26, which is not installed.
Successfully installed requests-2.26.0
Processing ./virtualenv-20.6.0-py2.py3-none-any.whl
patching script interpreter paths in /nix/store/4cakr31n8ywbn1dy0g1ww1asgmz4layv-python3.8-click-7.1.2
checking for references to /build/ in /nix/store/4cakr31n8ywbn1dy0g1ww1asgmz4layv-python3.8-click-7.1.2...
/build/requests-2.26.0
Finished executing pipInstallPhase
post-installation fixup
Executing pythonRemoveTestsDir
Finished executing pythonRemoveTestsDir
shrinking RPATHs of ELF executables and libraries in /nix/store/mqamv3kp1hdgnpvbvr8g2vqr2ns9yr3r-python3.8-requests-2.26.0
pythonCatchConflictsPhase
ERROR: Could not find a version that satisfies the requirement platformdirs<3,>=2 (from virtualenv)
ERROR: No matching distribution found for platformdirs<3,>=2
strip is /nix/store/sgrwh6jsrshrnicqi67fck336q6ldh2d-binutils-2.35.1/bin/strip
stripping (with command strip and flags -S) in /nix/store/mqamv3kp1hdgnpvbvr8g2vqr2ns9yr3r-python3.8-requests-2.26.0/lib
builder for '/nix/store/gsqa5yg2kjskn03614aharw8s5bf5623-python3.8-virtualenv-20.6.0.drv' failed with exit code 1
error: build of '/nix/store/0azyr54gip9hzik6l44j3qsgv65g0p3r-python3.8-toml-sort-0.19.0.drv', '/nix/store/4964lywxqwrhf5r4n7nnqivpiwy521yk-python3.8-python-dateutil-2.8.2.drv', '/nix/store/8kl2dfbn5gkhch27jwn5mqapmliz3zzi-python3.8-arrow-1.0.3.drv', '/nix/store/a4w8g4mqkplllhbp4jxzm185q4amjlj4-python3.8-language-formatters-pre-commit-hooks-2.1.0.drv', '/nix/store/cg0c2r24swhmh6f1i0zcf4z6bn0gcs4v-python3.8-gitlint-0.15.1.drv', '/nix/store/flbcb4b7218jgcb3ixsa2c0zxck689ss-python3.8-click-7.1.2.drv', '/nix/store/fx46gffvvbv58n0agmpbdxy3zkj82d31-python3.8-requests-2.26.0.drv', '/nix/store/gsqa5yg2kjskn03614aharw8s5bf5623-python3.8-virtualenv-20.6.0.drv', '/nix/store/lc55gqzmaqg3yghqyd5kx74s8rldfyfh-python3.8-ruamel-yaml-0.17.10.drv', '/nix/store/qkxn37h6jk6k29q2kw51p930gw2h2hrf-python3.8-sh-1.14.1.drv', '/nix/store/rr1182xk0yivrdkk641nv3i5j9nj0cj5-python3.8-ruamel-yaml-clib-0.2.6.drv', '/nix/store/zd06jji3dw67pjbmzjb5dl6brsb6mpbd-python3.8-pre-commit-2.13.0.drv' failed

What should happen: The package should install successfully.

Additional info: poetry install succeeds in installing all the packages.

@l0b0
Copy link
Contributor Author

l0b0 commented Aug 23, 2021

Having the same problem in another project with platformdirs==2.2.0:

$ nix-shell 
these derivations will be built:
  /nix/store/dmzg7ym3mg0g7smjdnyh88017as54qcy-python3.9-pylint-2.10.2.drv
  /nix/store/92f8cdq2zhmkdyldigbk1vjqd1wnwg26-python3-3.9.6-env.drv
building '/nix/store/dmzg7ym3mg0g7smjdnyh88017as54qcy-python3.9-pylint-2.10.2.drv'...
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing pip-build-hook
Using pipBuildPhase
Using pipShellHook
Sourcing pip-install-hook
Using pipInstallPhase
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
unpacking sources
unpacking source archive /nix/store/w240cnb0m3g4ykwzlb8f0giq86sm3q87-pylint-2.10.2.tar.gz
source root is pylint-2.10.2
setting SOURCE_DATE_EPOCH to timestamp 1629567022 of file pylint-2.10.2/setup.cfg
patching sources
configuring
no configure script, doing nothing
building
Executing pipBuildPhase
Creating a wheel...
WARNING: The directory '/homeless-shelter/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Processing /tmp/nix-build-python3.9-pylint-2.10.2.drv-0/pylint-2.10.2
Building wheels for collected packages: pylint
  Building wheel for pylint (setup.py) ... done
  Created wheel for pylint: filename=pylint-2.10.2-py3-none-any.whl size=390479 sha256=0c5f458ef04d3bbc1e24d33767ac3f1c422491f77cde71f4d5e2a9c5888226ec
  Stored in directory: /tmp/nix-build-python3.9-pylint-2.10.2.drv-0/pip-ephem-wheel-cache-f_j2c5zp/wheels/99/67/c3/d1b1273ea33f22fef836a54dcfb7d518ac0424c3252f640b6f
Successfully built pylint
Finished creating a wheel...
Finished executing pipBuildPhase
installing
Executing pipInstallPhase
/tmp/nix-build-python3.9-pylint-2.10.2.drv-0/pylint-2.10.2/dist /tmp/nix-build-python3.9-pylint-2.10.2.drv-0/pylint-2.10.2
Processing ./pylint-2.10.2-py3-none-any.whl
ERROR: Could not find a version that satisfies the requirement platformdirs>=2.2.0 (from pylint==2.10.2) (from versions: none)
ERROR: No matching distribution found for platformdirs>=2.2.0 (from pylint==2.10.2)
builder for '/nix/store/dmzg7ym3mg0g7smjdnyh88017as54qcy-python3.9-pylint-2.10.2.drv' failed with exit code 1
cannot build derivation '/nix/store/92f8cdq2zhmkdyldigbk1vjqd1wnwg26-python3-3.9.6-env.drv': 1 dependencies couldn't be built
error: build of '/nix/store/92f8cdq2zhmkdyldigbk1vjqd1wnwg26-python3-3.9.6-env.drv' failed

@l0b0
Copy link
Contributor Author

l0b0 commented Aug 24, 2021

Another project pull request where this shows up - you can see the reproducible result in the pipeline:

Executing pipInstallPhase
/build/pylint-2.10.2/dist /build/pylint-2.10.2
Processing ./pylint-2.10.2-py3-none-any.whl
Requirement already satisfied: toml>=0.7.1 in /nix/store/r84jz3hs3n5rgvfn4q6fshaq6cajrp8x-python3.9-toml-0.10.2/lib/python3.9/site-packages (from pylint==2.10.2) (0.10.2)
Requirement already satisfied: isort<6,>=4.2.5 in /nix/store/nz8cc64bavh5n3ffsq3fcbmdsa7gaqlf-python3.9-isort-5.9.3/lib/python3.9/site-packages (from pylint==2.10.2) (5.9.3)
Requirement already satisfied: astroid<2.8,>=2.7.2 in /nix/store/d6zlqxppl83nng3nn31hpl2yw37da680-python3.9-astroid-2.7.2/lib/python3.9/site-packages (from pylint==2.10.2) (2.7.2)
ERROR: Could not find a version that satisfies the requirement platformdirs>=2.2.0 (from pylint==2.10.2) (from versions: none)
ERROR: No matching distribution found for platformdirs>=2.2.0 (from pylint==2.10.2)
builder for '/nix/store/lw13nhavw3gbwz8grnxg80rzqdzrqb5i-python3.9-pylint-2.10.2.drv' failed with exit code 1
cannot build derivation '/nix/store/mfcks8f7bllsj1q92cd0mbjr87p0i8v6-python3-3.9.4-env.drv': 1 dependencies couldn't be built
error: build of '/nix/store/mfcks8f7bllsj1q92cd0mbjr87p0i8v6-python3-3.9.4-env.drv' failed

@l0b0
Copy link
Contributor Author

l0b0 commented Aug 25, 2021

Since platformdirs is platform dependent it's possible that pip doesn't detect the platform as anything known and therefore can't install any of the available packages. Is it possible to force the platform to Linux in an override?

@l0b0
Copy link
Contributor Author

l0b0 commented Aug 25, 2021

It looks like the following override (from here) might be part of a fix, but I have to link the pylint package to this custom build.

platformdirs = pkgs.callPackage (
  {buildPythonPackage, fetchPypi}:
    buildPythonPackage rec {
      pname = "platformdirs";
      version = "2.2.0";
      src = fetchPypi {
        sha256 = "07hq5qrp7pqj63iczg01wbf5ii6f0ncd0dq5mzkdhsslmg9slbb3";
        inherit pname version;
      };
      doCheck = false;
}) { inherit (super) buildPythonPackage fetchPypi; };

I've tried various syntaxes, but I don't really know how to replace a dependency with one I just built. Or how to figure out which type of dependency it is (buildInput, propagatedBuildInput, etc.). I tried something similar to the Black entry from the page linked above — pylint = pkgs.callPackage (super.pylint) { inherit (self) platformdirs; }; — but that didn't change anything.

@l0b0
Copy link
Contributor Author

l0b0 commented Aug 26, 2021

Minimal repro:

cd "$(mktemp --directory)"
poetry init --name=test --author="Me <${USER}@${HOSTNAME}>" --python=^3.9 --dependency='virtualenv=*' --license=AGPLv3+ --no-interaction
poetry lock
cat > shell.nix <<'EOF'
let
  pkgs = import <nixpkgs> { };
  poetryEnv = pkgs.poetry2nix.mkPoetryEnv {
    python = pkgs.python39;
    projectDir = ./.;

    overrides = pkgs.poetry2nix.overrides.withDefaults (self: super: {
        backports-entry-points-selectable = super.backports-entry-points-selectable.overridePythonAttrs (old: {
          postPatch = ''
            substituteInPlace setup.py --replace \
              'setuptools.setup()' \
              'setuptools.setup(version="${old.version}")'
          '';
        });
      }); 
  };
in
pkgs.mkShell {
  buildInputs = [
    poetryEnv
  ];
}
EOF
nix-shell

The output includes:

ERROR: Could not find a version that satisfies the requirement platformdirs<3,>=2 (from virtualenv==20.7.2) (from versions: none)
ERROR: No matching distribution found for platformdirs<3,>=2 (from virtualenv==20.7.2)

It is, however, very interesting that my first attempt, where I initialized Poetry with --dependency='platformdirs=*' rather than the virtualenv package it worked perfectly. So maybe the problem is at the virtualenv side.

This is almost definitely a poetry2nix issue, because poetry install in the temporary directory mentioned above works fine:

$ poetry install 
Installing dependencies from lock file

Package operations: 6 installs, 0 updates, 0 removals

  • Installing backports.entry-points-selectable (1.1.0)
  • Installing distlib (0.3.2)
  • Installing filelock (3.0.12)
  • Installing platformdirs (2.2.0)
  • Installing six (1.16.0)
  • Installing virtualenv (20.7.2)

l0b0 added a commit to l0b0/poetry2nix that referenced this issue Aug 26, 2021
I do not fully understand why the version specification breaks the
installation, because `poetry install` works just fine.

Closes nix-community#340.
l0b0 added a commit to l0b0/poetry2nix that referenced this issue Aug 26, 2021
I do not fully understand why the version specification breaks the
installation, because `poetry install` and `pip install
--requirement=<(poetry export)` both work just fine.

Closes nix-community#340.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant