robotframework-browser: init at 19.6.2#425503
robotframework-browser: init at 19.6.2#425503tobiasBora wants to merge 1 commit intoNixOS:masterfrom
Conversation
57d9628 to
1b8895d
Compare
1b8895d to
fff9229
Compare
266130c to
8760277
Compare
pkgs/development/python-modules/robotframework-browser/default.nix
Outdated
Show resolved
Hide resolved
8760277 to
531859f
Compare
|
Fix #292321, it should work now. |
531859f to
2bab342
Compare
|
In overall and even if it is totally optional, try to sort derivation attributes sorted in the natural way, similar to the majority of derivations in this repo. |
2bab342 to
562a9d0
Compare
|
@drupol I was indeed mostly trying to make this derivation work and spent little time reorganizing the sections. I did my best to have a coherent ordering, hope it is good enough. |
pkgs/development/python-modules/robotframework-browser/default.nix
Outdated
Show resolved
Hide resolved
pkgs/development/python-modules/robotframework-browser/default.nix
Outdated
Show resolved
Hide resolved
562a9d0 to
cf69cba
Compare
pkgs/development/python-modules/robotframework-browser/default.nix
Outdated
Show resolved
Hide resolved
cf69cba to
98fef45
Compare
pkgs/development/python-modules/robotframework-browser/default.nix
Outdated
Show resolved
Hide resolved
|
Please squash the commits |
89c3e9d to
3dbd227
Compare
|
@drupol I did that since I had no access to my computer and I was expecting the final merger to be able to apply the squash at the last step. Anyway, I just did it. |
We usually don't do that, the PR author need to clean his own PR and not rely on someone else to do it... |
| cat >> $out/lib/python3.13/site-packages/Browser/__init__.py <<EOF | ||
| import os | ||
| if not "PLAYWRIGHT_BROWSERS_PATH" in os.environ: | ||
| os.environ["PLAYWRIGHT_BROWSERS_PATH"] = "${playwright-driver.browsers}" | ||
| if not "PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS" in os.environ: | ||
| os.environ["PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS"] = "true" | ||
| EOF | ||
| ''; |
There was a problem hiding this comment.
Pretty sure this is wrong. This should be done as a patch, perhaps using replaceVars to substitute the path.
There was a problem hiding this comment.
Thanks. I guess it should be done in patch phase indeed. But why can't I use cat instead of patch? Seems like cat is more robust than a patch since the patch will fail when the init file changes.
There was a problem hiding this comment.
You're adding a file in the Browser package. With a patch you won't need the path at all. Just patch the src and that's it.
|
Not sure what's the best way to handle this, but FYI upstream pins some packages like protobuf and grpcio, which means this package will break whenever these get updates in nixpkgs (or when you want to update this package but grpcio is not updated yet). They also understandably don't want to support relaxing the version checks. AFAIK the pinning is not really necessary, if we build the protobufs and run the tests it should be fine to relax it on our side, but of course it's better if we can honor it. I also noticed they just released a new version which moves to pyproject.toml. It also updates grpcio, so that's a good example of the problem you'll get, now you have to wait for grpcio to be updated first, which will then break this merge request/package, then update to the new version to unbreak it. |
| # + grpc_tools_node_protoc already includes the plugin and is not runnable via npm | ||
| # since nix directly builds it from C++ sources to avoid to use pre-build binaries | ||
| # downloaded by npm | ||
| patchPhase = '' |
There was a problem hiding this comment.
| patchPhase = '' | |
| postPatch = '' |
we do not want to break patches
There was a problem hiding this comment.
I'm implementing this now in my next update, but still curious: what's wrong with adding a patchPhase? Aren't all hooks involving patch adding stuff to postPatch already?
| runHook prePatch | ||
| substituteInPlace ./Browser/playwright.py \ | ||
| --replace-fail '(installation_dir / "node_modules").is_dir()' 'True' | ||
| substituteInPlace ./tasks.py \ | ||
| --replace-fail 'c.run("pip install -U pip")' 'return' \ | ||
| --replace-fail 'npm run grpc_tools_node_protoc' 'grpc_tools_node_protoc' \ | ||
| --replace-fail ' -- ' ' ' | ||
| substituteInPlace ./package.json \ | ||
| --replace-fail '"grpc-tools": "^1.13.0",' ' ' | ||
| sed -i '/--plugin=protoc-gen-grpc/d' ./tasks.py | ||
| runHook postPatch |
There was a problem hiding this comment.
| runHook prePatch | |
| substituteInPlace ./Browser/playwright.py \ | |
| --replace-fail '(installation_dir / "node_modules").is_dir()' 'True' | |
| substituteInPlace ./tasks.py \ | |
| --replace-fail 'c.run("pip install -U pip")' 'return' \ | |
| --replace-fail 'npm run grpc_tools_node_protoc' 'grpc_tools_node_protoc' \ | |
| --replace-fail ' -- ' ' ' | |
| substituteInPlace ./package.json \ | |
| --replace-fail '"grpc-tools": "^1.13.0",' ' ' | |
| sed -i '/--plugin=protoc-gen-grpc/d' ./tasks.py | |
| runHook postPatch | |
| substituteInPlace ./Browser/playwright.py \ | |
| --replace-fail '(installation_dir / "node_modules").is_dir()' 'True' | |
| substituteInPlace ./tasks.py \ | |
| --replace-fail 'c.run("pip install -U pip")' 'return' \ | |
| --replace-fail 'npm run grpc_tools_node_protoc' 'grpc_tools_node_protoc' \ | |
| --replace-fail ' -- ' ' ' | |
| substituteInPlace ./package.json \ | |
| --replace-fail '"grpc-tools": "^1.13.0",' ' ' | |
| sed -i '/--plugin=protoc-gen-grpc/d' ./tasks.py |
Things done
Fix #292321, it should work now.
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)To test, start a shell with
create a file
test.robot:and run:
all tests should pass.
Add a 👍 reaction to pull requests you find important.