-
-
Notifications
You must be signed in to change notification settings - Fork 396
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
Trying to fix the setuptools fallout #736
Conversation
@K900 Thanks for looking into this. I pushed a commit to the PR to format the code to get more CI to run. |
It looks like the pluggy dependency for hatchling isn't found because the hatchling version requires pluggy 1.0.0 but 0.13.1 is found. |
I'm trying this against a project I work on with complex dependencies (https://github.com/ibis-project/ibis) and this PR appears to still infinitely recurse, but in a way that isn't detectable until after evaluation has started (and eventually fails with a stack overflow), as opposed to |
There's definitely new circular dependencies in there somewhere, we'll have to minimize it to find out. |
Using Removing those dependencies' dependency on setuptools in the lockfile and removing |
I have upstream'd a few PRs to help address the incorrect setuptools dependency in the ecosystem: one to Toblerity/Fiona likely to be merged: Toblerity/Fiona#1139 |
I'm still not sure why we're looping on setuptools at all tbh, especially now that there's no implicit dependency on it. |
I've pushed a commit to bring back the |
I haven't yet been able isolate a smaller reproducible example than what's in ibis-project/ibis, but it appears there may be a loop in When I run
on my I see this output repeated ad infinitum:
Add this bit to the
|
@K900 Hope you don't mind, but I pushed what I think is a minimal test case project: it only depends on |
Please continue, I probably won't have much more time to look into this in the next few days. |
default.nix
Outdated
pkgMeta: | ||
if pkgMeta.name == "setuptools" then { | ||
name = pkgMeta.name; | ||
value = super.setuptools; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be extended to cover all the build systems we support...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that makes sense. I'd like to see if I can get to the bottom of the reason why the infinite recursion is happening before doing that though.
One downside to this approach is that the version of whatever the build system is always pinned to whatever version/commit nixpkgs is pinned to. For setuptools that probably doesn't matter much, but for the newer build systems I'm not so sure.
I was able to get the test case I added to pass by always using I'll admit I'm not entirely sure why this works. My hunch is that there are two different versions of setuptools in the closure: one coming from @adisbladis Thoughts on this? |
I don't think that's avoidable, and it might be better than getting whatever random thing we end up with in the lockfile. |
Hm, that's a good point. Separately, I tried this branch against ibis-project/ibis and it works. |
I've blocked a How do you think this situation should/will affect the poetry2nix-based packages in the upcoming NixOS release? |
Nixpkgs' Python hooks used to propagate setuptools, but they don't anymore, so all the things that implicitly expected it to be there exploded. |
There's a second issue here too: poetry < 1.2 automatically removed setuptools from dependencies, whereas 1.2 doesn't resulting in infinite recursion. |
@roberth NixOS/nixpkgs#185815 is the breaking change. |
Maybe I have found an reproducer1. From poetry2nix master:nix run --no-write-lock-file github:nix-community/poetry2nix#poetry -- --version The locked URL: # To get the locked URL run:
# nix flake metadata --no-write-lock-file github:nix-community/poetry2nix
nix run --no-write-lock-file github:nix-community/poetry2nix/c2ee667d2fd19f70a9ac256b81f2cfc248c4f04d#poetry -- --version Results in: warning: not writing modified lock file of flake 'github:nix-community/poetry2nix':
• Added input 'flake-utils':
'github:numtide/flake-utils/c0e246b9b83f637f4681389ecabcb2681b4f3af0' (2022-08-07)
• Added input 'nixpkgs':
'github:NixOS/nixpkgs/2380304ae4975ef0d6ba13b64f990e94e8c5fdbb' (2022-10-04)
error: builder for '/nix/store/avk4c6r2y4mixriryam1rgrrbkzfivmi-python3.10-packaging-21.3.drv' failed with exit code 2;
last 10 log lines:
> File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
> File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
> File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
> File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
> File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
> ModuleNotFoundError: No module named 'setuptools'
>
>
For full logs, run 'nix log /nix/store/avk4c6r2y4mixriryam1rgrrbkzfivmi-python3.10-packaging-21.3.drv'.
error: 1 dependencies of derivation '/nix/store/wb17wpkm1p8w00cajp960w8yinwh75xy-python3.10-poetry-1.2.0.drv' failed to build 2. From K900/poetry2nix/hacknix run --no-write-lock-file github:K900/poetry2nix/hack#poetry -- --version Results in: warning: not writing modified lock file of flake 'github:K900/poetry2nix/hack':
• Added input 'flake-utils':
'github:numtide/flake-utils/c0e246b9b83f637f4681389ecabcb2681b4f3af0' (2022-08-07)
• Added input 'nixpkgs':
'github:NixOS/nixpkgs/2380304ae4975ef0d6ba13b64f990e94e8c5fdbb' (2022-10-04)
Poetry (version 1.2.0) So, it works! The locked URL: # To get the locked URL run:
# nix flake metadata --no-write-lock-file github:K900/poetry2nix/hack
nix run --no-write-lock-file github:K900/poetry2nix/fc3b734766d49695b34259d68e823f3baa732c07#poetry -- --version Extra metadatanix run nixpkgs#nix-info -- --markdown
About the machine that it was tested (an Ubuntu Vagrant virtual machine): nix run nixpkgs#neofetch -- --json Outputs: {
"OS": "Ubuntu 22.04.1 LTS x86_64",
"Host": "KVM/QEMU (Standard PC (i440FX + PIIX, 1996) pc-i440fx-7.0)",
"Kernel": "5.15.0-48-generic",
"Uptime": "7 mins",
"Packages": "626 (dpkg), 44 (nix-user), 3 (snap)",
"Shell": "bash 5.1.16",
"Resolution": "1024x768",
"Terminal": "/dev/pts/0",
"CPU": "Intel (Haswell, no TSX, IBRS) (4) @ 3.392GHz",
"GPU": "Cirrus Logic QEMU Virtual Machine",
"Memory": "331MiB / 968MiB",
"Version": "7.1.0"
} |
Yes, that reproduces the missing setuptools issue, but not the infinite recursion issue. |
I guess the question is whether the solution to fix the infinite recursion is the correct one. I'm happy to add the other build systems to the check if people think the approach is the way forward. |
* build(deps): bump certifi from 2020.12.5 to 2022.9.24 Bumps [certifi](https://github.com/certifi/python-certifi) from 2020.12.5 to 2022.9.24. - [Release notes](https://github.com/certifi/python-certifi/releases) - [Commits](certifi/python-certifi@2020.12.05...2022.09.24) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* build(deps): bump platformdirs from 2.3.0 to 2.5.2 Bumps [platformdirs](https://github.com/platformdirs/platformdirs) from 2.3.0 to 2.5.2. - [Release notes](https://github.com/platformdirs/platformdirs/releases) - [Changelog](https://github.com/platformdirs/platformdirs/blob/main/CHANGES.rst) - [Commits](platformdirs/platformdirs@2.3.0...2.5.2) --- updated-dependencies: - dependency-name: platformdirs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* build(deps): bump six from 1.15.0 to 1.16.0 Bumps [six](https://github.com/benjaminp/six) from 1.15.0 to 1.16.0. - [Release notes](https://github.com/benjaminp/six/releases) - [Changelog](https://github.com/benjaminp/six/blob/master/CHANGES) - [Commits](benjaminp/six@1.15.0...1.16.0) --- updated-dependencies: - dependency-name: six dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* build(deps): bump distlib from 0.3.1 to 0.3.6 Bumps [distlib](https://github.com/pypa/distlib) from 0.3.1 to 0.3.6. - [Release notes](https://github.com/pypa/distlib/releases) - [Changelog](https://github.com/pypa/distlib/blob/master/CHANGES.rst) - [Commits](pypa/distlib@0.3.1...0.3.6) --- updated-dependencies: - dependency-name: distlib dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* build(deps): bump virtualenv from 20.4.2 to 20.16.5 Bumps [virtualenv](https://github.com/pypa/virtualenv) from 20.4.2 to 20.16.5. - [Release notes](https://github.com/pypa/virtualenv/releases) - [Changelog](https://github.com/pypa/virtualenv/blob/main/docs/changelog.rst) - [Commits](pypa/virtualenv@20.4.2...20.16.5) --- updated-dependencies: - dependency-name: virtualenv dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
…2172) * build(deps-dev): bump types-python-dateutil from 2.8.19 to 2.8.19.1 Bumps [types-python-dateutil](https://github.com/python/typeshed) from 2.8.19 to 2.8.19.1. - [Release notes](https://github.com/python/typeshed/releases) - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-python-dateutil dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* build(deps): bump filelock from 3.0.12 to 3.8.0 Bumps [filelock](https://github.com/tox-dev/py-filelock) from 3.0.12 to 3.8.0. - [Release notes](https://github.com/tox-dev/py-filelock/releases) - [Changelog](https://github.com/tox-dev/py-filelock/blob/main/docs/changelog.rst) - [Commits](tox-dev/filelock@v3.0.12...3.8.0) --- updated-dependencies: - dependency-name: filelock dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* build(deps): bump idna from 2.10 to 3.4 Bumps [idna](https://github.com/kjd/idna) from 2.10 to 3.4. - [Release notes](https://github.com/kjd/idna/releases) - [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.rst) - [Commits](kjd/idna@v2.10...v3.4) --- updated-dependencies: - dependency-name: idna dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. * fix: Add idna build dependency Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: Victor Engmark <vengmark@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Upstream fix <nix-community/poetry2nix#736>.
Upstream fix <nix-community/poetry2nix#736>.
Upstream fix <nix-community/poetry2nix#736>.
Upstream fix <nix-community/poetry2nix#736>.
…#2179) * build(deps-dev): bump types-python-dateutil from 2.8.19.1 to 2.8.19.2 Bumps [types-python-dateutil](https://github.com/python/typeshed) from 2.8.19.1 to 2.8.19.2. - [Release notes](https://github.com/python/typeshed/releases) - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-python-dateutil dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz>
…46.0a0 (#2176) * build(deps): bump aws-cdk-aws-lambda-python-alpha Bumps [aws-cdk-aws-lambda-python-alpha](https://github.com/aws/aws-cdk) from 2.45.0a0 to 2.46.0a0. - [Release notes](https://github.com/aws/aws-cdk/releases) - [Changelog](https://github.com/aws/aws-cdk/blob/main/CHANGELOG.v2.md) - [Commits](https://github.com/aws/aws-cdk/commits) --- updated-dependencies: - dependency-name: aws-cdk-aws-lambda-python-alpha dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
…2177) * build(deps): bump aws-cdk-aws-batch-alpha from 2.45.0a0 to 2.46.0a0 Bumps [aws-cdk-aws-batch-alpha](https://github.com/aws/aws-cdk) from 2.45.0a0 to 2.46.0a0. - [Release notes](https://github.com/aws/aws-cdk/releases) - [Changelog](https://github.com/aws/aws-cdk/blob/main/CHANGELOG.v2.md) - [Commits](https://github.com/aws/aws-cdk/commits) --- updated-dependencies: - dependency-name: aws-cdk-aws-batch-alpha dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* build(deps): bump pyrsistent from 0.17.3 to 0.18.1 Bumps [pyrsistent](https://github.com/tobgu/pyrsistent) from 0.17.3 to 0.18.1. - [Release notes](https://github.com/tobgu/pyrsistent/releases) - [Changelog](https://github.com/tobgu/pyrsistent/blob/master/CHANGES.txt) - [Commits](tobgu/pyrsistent@v0.17.3...v0.18.1) --- updated-dependencies: - dependency-name: pyrsistent dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Upstream fix <nix-community/poetry2nix#736>.
* build(deps-dev): bump boto3-stubs from 1.24.92 to 1.24.93 Bumps [boto3-stubs](https://github.com/youtype/mypy_boto3_builder) from 1.24.92 to 1.24.93. - [Release notes](https://github.com/youtype/mypy_boto3_builder/releases) - [Commits](https://github.com/youtype/mypy_boto3_builder/commits) --- updated-dependencies: - dependency-name: boto3-stubs dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* build(deps): bump pyparsing from 2.4.7 to 3.0.9 Bumps [pyparsing](https://github.com/pyparsing/pyparsing) from 2.4.7 to 3.0.9. - [Release notes](https://github.com/pyparsing/pyparsing/releases) - [Changelog](https://github.com/pyparsing/pyparsing/blob/master/CHANGES) - [Commits](pyparsing/pyparsing@pyparsing_2.4.7...pyparsing_3.0.9) --- updated-dependencies: - dependency-name: pyparsing dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jim Gan <jgan@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Workaround until upstream fix <nix-community/poetry2nix#736> is available.
The updated version fixes compatibility with `poetry.lock` files generated by `poetry` >= 1.2, which now include dependencies on `setuptools`, and that causes infinite recursion if those dependencies are just handled as written: nix-community/poetry2nix#736
While waiting for upstream fix <nix-community/poetry2nix#736>.
* build(deps-dev): bump mypy from 0.990 to 0.991 Bumps [mypy](https://github.com/python/mypy) from 0.990 to 0.991. - [Release notes](https://github.com/python/mypy/releases) - [Commits](python/mypy@v0.990...v0.991) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools While waiting for upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Victor Engmark <vengmark@linz.govt.nz> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Is there a workaround for injecting this dependency other than editing |
Yes, via the overrides mechanism. |
so i feared :P |
Upstream fix <nix-community/poetry2nix#736>.
* build(deps): bump linz-logger from 0.9.0 to 0.11.0 Bumps [linz-logger](https://github.com/linz/python-linz-logger) from 0.9.0 to 0.11.0. - [Release notes](https://github.com/linz/python-linz-logger/releases) - [Changelog](https://github.com/linz/python-linz-logger/blob/master/CHANGELOG.md) - [Commits](https://github.com/linz/python-linz-logger/commits/v0.11.0) --- updated-dependencies: - dependency-name: linz-logger dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: Remove mention of setuptools Upstream fix <nix-community/poetry2nix#736>. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Victor Engmark <vengmark@linz.govt.nz>
TODO list (ongoing):