Conversation
69f2713 to
b3c7ce6
Compare
RossSmyth
left a comment
There was a problem hiding this comment.
Mostly good, a few little changes:
- Some sanity checks
- Remove
with lib; - Use
python3Packagesrather thanpython3.pkgsbecause the latter doesn't splice correctly - Is there an upstream PR for the pyproject.toml? I would recommend putting your patch there if not, then fetching it.
There was a problem hiding this comment.
| python, |
There was a problem hiding this comment.
| python.pkgs.buildPythonPackage rec { | |
| buildPythonPackage rec { |
There was a problem hiding this comment.
| build-system = [ python.pkgs.setuptools ]; | |
| build-system = [ setuptools ]; |
There was a problem hiding this comment.
| dependencies = with python.pkgs; [ | |
| dependencies = [ |
There was a problem hiding this comment.
| meta = with lib; { | |
| description = "Create charts from FIO storage benchmark tool output"; | |
| homepage = "https://github.com/louwrentius/fio-plot"; | |
| license = licenses.bsd3; | |
| maintainers = with maintainers; [ johnrichardrinehart ]; | |
| }; | |
| meta = { | |
| description = "Create charts from FIO storage benchmark tool output"; | |
| homepage = "https://github.com/louwrentius/fio-plot"; | |
| license = lib.licenses.bsd3; | |
| maintainers = with lib.maintainers; [ johnrichardrinehart ]; | |
| }; |
pkgs/by-name/fi/fio-plot/package.nix
Outdated
There was a problem hiding this comment.
| fio_plot = python3.pkgs.fio_plot; | |
| fio_plot = python3Packages.fio_plot; |
pkgs/by-name/fi/fio-plot/package.nix
Outdated
There was a problem hiding this comment.
| python3.pkgs.buildPythonApplication rec { | |
| python3Packages.buildPythonApplication rec { |
pkgs/by-name/fi/fio-plot/package.nix
Outdated
There was a problem hiding this comment.
| build-system = [ python3.pkgs.setuptools ]; | |
| build-system = [ python3Packages.setuptools ]; |
pkgs/by-name/fi/fio-plot/package.nix
Outdated
There was a problem hiding this comment.
Or whever it is called
| maintainers = with maintainers; [ johnrichardrinehart ]; | |
| }; | |
| maintainers = with maintainers; [ johnrichardrinehart ]; | |
| mainProgram = "fio-plot"; | |
| }; |
There was a problem hiding this comment.
Oh, man, haha. That shouldn't be in the history. It's the exact same patch as in the library package (python-modules/fio_plot/*.patch). I renamed it and pointed the application to the library's patch. Sorry about that.
|
@RossSmyth Thanks for the deep review. I've:
I think that's everything. Please let me know if there's more work to do! |
|
Hm taking a bit of a closer look, is the python module |
RossSmyth
left a comment
There was a problem hiding this comment.
I didn't notice this when I was reviewing earlier. Since it is just a different view of the same source you can just have this.
pkgs/by-name/fi/fio-plot/package.nix
Outdated
There was a problem hiding this comment.
Yeah you can just replace the whole thing with this.
| { | |
| lib, | |
| fetchFromGitHub, | |
| fio, | |
| python3Packages, | |
| }: | |
| let | |
| fio_plot = python3Packages.fio_plot; | |
| in | |
| python3Packages.buildPythonApplication rec { | |
| pname = "fio-plot"; | |
| version = "1.1.16"; | |
| pyproject = true; | |
| pythonPath = [ | |
| fio_plot | |
| ]; | |
| patches = fio_plot.patches; | |
| build-system = [ python3Packages.setuptools ]; | |
| src = fetchFromGitHub { | |
| owner = "louwrentius"; | |
| repo = "fio-plot"; | |
| tag = "v${version}"; | |
| hash = "sha256-yN0gVm6ZYEIoh91d+0ohJ9yU+VWwYEq3MoG+WgBrs2Q="; | |
| }; | |
| dependencies = [ | |
| fio | |
| ]; | |
| meta = { | |
| description = "Create charts from FIO storage benchmark tool output"; | |
| homepage = "https://github.com/louwrentius/fio-plot"; | |
| license = lib.licenses.bsd3; | |
| mainProgram = "fio-plot"; | |
| maintainers = with lib.maintainers; [ johnrichardrinehart ]; | |
| }; | |
| } | |
| { | |
| python3Packages, | |
| }: | |
| python3Packages.toPythonApplication python3Packages.fio_plot |
There was a problem hiding this comment.
Nice! I had to overrideAttrs for meta.mainProgram but otherwise I did exactly that.
There was a problem hiding this comment.
Don't forget the import check
|
You also need to squash your commits to follow the commit convention. |
Alright. I'll do that if the current state of all the files look good (as of 4558e93e7d269e3750083f03c659637847395294). Let me know and then I'll squash. I kept the history around in case I needed to revert and to support the review. |
pkgs/by-name/fi/fio-plot/package.nix
Outdated
There was a problem hiding this comment.
You can check the output with nix eval -f ./. fio-plot.meta
| meta.mainProgram = "fio-plot"; | |
| meta = old.meta // { mainProgram = "fio-plot"; }; |
There was a problem hiding this comment.
Ah, nice. Changed!
Squashing. |
9594773 to
51e96b7
Compare
51e96b7 to
0bd7b8d
Compare
|
Oops, for the commit structure it should be three commits:
One for each new package added. |
0bd7b8d to
5c5facb
Compare
Okay, I think we're stable! |
There was a problem hiding this comment.
| description = "Static call graph generator. The official Python 3 version."; | |
| description = "Static call graph generator"; |
Be short, just one sentence
Not end with a period
https://github.com/NixOS/nixpkgs/tree/master/pkgs#meta-attributes
There was a problem hiding this comment.
This is a package. It does not have a mainProgram. At least not how it is used here.
fix: fio_plot tests chore: abbreviate pyan3 description
5c5facb to
a477a2c
Compare
Sorry ahead-of-time if this PR is absolute crap. I have little to no experience with
pythonpackaging and I have attention issues, so there may be a lot of small things to clean up, here. Thanks for your review.The goal of this PR is to add
fio-plot(a package which provides two binaries,fio-plotandbench_fio), tolegacyPackages. I've only tested that the binaries build and seem to run onx86_64-linux:$ ./result/bin/bench_fio usage: bench_fio [-h] -d TARGET [TARGET ...] -t {device,file,directory,rbd} [-P CEPH_POOL] [-s SIZE] -o OUTPUT [-b BLOCK_SIZE [BLOCK_SIZE ...]] [--iodepth IODEPTH [IODEPTH ...]] [--numjobs NUMJOBS [NUMJOBS ...]] [--runtime RUNTIME] [-p] [--precondition-repeat] [--precondition-template PRECONDITION_TEMPLATE] [-m MODE [MODE ...]] [--rwmixread RWMIXREAD [RWMIXREAD ...]] [-e ENGINE] [--direct DIRECT] [--loops LOOPS] [--time-based] [--entire-device] [--ss SS] [--ss-dur SS_DUR] [--ss-ramp SS_RAMP] [--extra-opts EXTRA_OPTS [EXTRA_OPTS ...]] [--invalidate INVALIDATE] [--quiet] [--loginterval LOGINTERVAL] [--dry-run] [--destructive] [--remote REMOTE] [--remote-checks] [--remote-timeout REMOTE_TIMEOUT] [--create] [--parallel] bench_fio: error: the following arguments are required: -d/--target, -t/--type, -o/--output $ ./result/bin/fio-plot usage: fio-plot [-h] -i INPUT_DIRECTORY [INPUT_DIRECTORY ...] [-o OUTPUT_FILENAME] -T TITLE [-s SOURCE] (-L | -l | -N | -H | -g | -C) [--disable-grid] [--enable-markers] [--subtitle SUBTITLE] [-d IODEPTH [IODEPTH ...]] [-n NUMJOBS [NUMJOBS ...]] [-M [MAXDEPTH]] [-J [MAXJOBS]] [-D [DPI]] [-p [PERCENTILE]] -r {read,write,randread,randwrite,randrw,trim,rw,readwrite,randtrim,trimwrite} [-m MAX_Z] [-e MOVING_AVERAGE] [--min-iops MIN_IOPS] [--min-lat MIN_LAT] [-t {bw,iops,lat,slat,clat} [{bw,iops,lat,slat,clat} ...]] [-f {read,write} [{read,write} ...]] [--truncate-xaxis TRUNCATE_XAXIS] [--xlabel-depth XLABEL_DEPTH] [--xlabel-parent XLABEL_PARENT] [--xlabel-segment-size XLABEL_SEGMENT_SIZE] [--xlabel-single-column] [-w LINE_WIDTH] [--group-bars] [--show-cpu] [--show-data] [--show-ss] [--table-lines] [--max-lat MAX_LAT] [--max-clat MAX_CLAT] [--max-slat MAX_SLAT] [--max-iops MAX_IOPS] [--max-bw MAX_BW] [--draw-total] [--colors COLORS [COLORS ...]] [--disable-fio-version] [--title-fontsize TITLE_FONTSIZE] [--subtitle-fontsize SUBTITLE_FONTSIZE] [--source-fontsize SOURCE_FONTSIZE] [--credit-fontsize CREDIT_FONTSIZE] [--table-fontsize TABLE_FONTSIZE] [--include-hosts INCLUDE_HOSTS [INCLUDE_HOSTS ...] | --exclude-hosts EXCLUDE_HOSTS [EXCLUDE_HOSTS ...]] fio-plot: error: the following arguments are required: -i/--input-directory, -T/--title, -r/--rwNow, in order to provide the application package, I also needed to add the corresponding
pythonmodule package,fio_plot. But,fio_plotdepends on https://github.com/Technologicat/pyan/, which is not in tree, yet.Also, I was running into weird issues around
binfiles already existing when thefio_plotrepository only provided itssetup.py. The world seems to be moving towardpyproject.tomlso you might notice that I've also bundled in a patch to the source repository which provides apyproject.toml. This file unblocks the build. I'm going to make a corresponding PR to https://github.com/louwrentius/fio-plot/, but I'm not sure if this project is still maintained. I also want to be able to point to this PR in that PR and say "hey, I needed to hack something up innixpkgsbecause your project packaging is stale". I'm happy to remove this patch later if the source repository includes these changes.So, rather then break this into 3 separate/stacked PRs, I decided to provide a single PR. I hope that's okay.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.