Merge pull request 'wayland_nix_py313: keeping up with modern DEs and nix(os)' (#53) from wayland_nix_py313 into main
Submitted-in: https://www.pikers.dev/pikers/piker/pulls/53main
commit
ff49ff0376
45
README.rst
45
README.rst
|
|
@ -88,22 +88,57 @@ a sane install with `uv`
|
||||||
************************
|
************************
|
||||||
bc why install with `python` when you can faster with `rust` ::
|
bc why install with `python` when you can faster with `rust` ::
|
||||||
|
|
||||||
uv lock
|
uv sync
|
||||||
|
|
||||||
|
# ^ astral's docs,
|
||||||
|
# https://docs.astral.sh/uv/concepts/projects/sync/
|
||||||
|
|
||||||
|
include all GUIs (ex. for charting)::
|
||||||
|
|
||||||
|
uv sync --extra uis
|
||||||
|
|
||||||
|
AND with all our hacking tools and WIP integrations::
|
||||||
|
|
||||||
|
uv sync --dev --all-extras
|
||||||
|
|
||||||
|
|
||||||
hacky install on nixos
|
Ensure you can run the root-daemon::
|
||||||
**********************
|
|
||||||
|
uv run pikerd [-l info --pdb]
|
||||||
|
|
||||||
|
|
||||||
|
install on nix(os)
|
||||||
|
******************
|
||||||
``NixOS`` is our core devs' distro of choice for which we offer
|
``NixOS`` is our core devs' distro of choice for which we offer
|
||||||
a stringently defined development shell envoirment that can be loaded with::
|
a stringently defined development shell envoirment that can currently
|
||||||
|
be applied in one of 2 ways::
|
||||||
|
|
||||||
|
# ONLY if running on X11
|
||||||
nix-shell default.nix
|
nix-shell default.nix
|
||||||
|
|
||||||
|
Or if you prefer flakes style and a modern DE::
|
||||||
|
|
||||||
|
# ONLY if also running on Wayland
|
||||||
|
nix develop # for default bash
|
||||||
|
nix develop -c uv run xonsh # for @goodboy's preferred sh B)
|
||||||
|
|
||||||
|
|
||||||
start a chart
|
start a chart
|
||||||
*************
|
*************
|
||||||
run a realtime OHLCV chart stand-alone::
|
run a realtime OHLCV chart stand-alone::
|
||||||
|
|
||||||
piker -l info chart btcusdt.spot.binance xmrusdt.spot.kraken
|
[uv run] piker -l info chart btcusdt.spot.binance xmrusdt.spot.kraken
|
||||||
|
|
||||||
|
# ^^^ iff you haven't activated the py-env,
|
||||||
|
# - https://docs.astral.sh/uv/concepts/projects/run/
|
||||||
|
#
|
||||||
|
# in order to create an explicit virt-env see,
|
||||||
|
# - https://docs.astral.sh/uv/concepts/projects/layout/#the-project-environment
|
||||||
|
# - https://docs.astral.sh/uv/pip/environments/
|
||||||
|
#
|
||||||
|
# use $UV_PROJECT_ENVIRONMENT to select any non-`.venv/`
|
||||||
|
# as the venv sudir in the repo's root.
|
||||||
|
# - https://docs.astral.sh/uv/reference/environment/#uv_project_environment
|
||||||
|
|
||||||
this runs a chart UI (with 1m sampled OHLCV) and shows 2 spot markets from 2 diff cexes
|
this runs a chart UI (with 1m sampled OHLCV) and shows 2 spot markets from 2 diff cexes
|
||||||
overlayed on the same graph. Use of `piker` without first starting
|
overlayed on the same graph. Use of `piker` without first starting
|
||||||
|
|
|
||||||
37
default.nix
37
default.nix
|
|
@ -11,11 +11,12 @@ let
|
||||||
libxkbcommonStorePath = lib.getLib libxkbcommon;
|
libxkbcommonStorePath = lib.getLib libxkbcommon;
|
||||||
xcbutilcursorStorePath = lib.getLib xcb-util-cursor;
|
xcbutilcursorStorePath = lib.getLib xcb-util-cursor;
|
||||||
|
|
||||||
qtpyStorePath = lib.getLib python312Packages.qtpy;
|
pypkgs = python313Packages;
|
||||||
pyqt6StorePath = lib.getLib python312Packages.pyqt6;
|
qtpyStorePath = lib.getLib pypkgs.qtpy;
|
||||||
pyqt6SipStorePath = lib.getLib python312Packages.pyqt6-sip;
|
pyqt6StorePath = lib.getLib pypkgs.pyqt6;
|
||||||
rapidfuzzStorePath = lib.getLib python312Packages.rapidfuzz;
|
pyqt6SipStorePath = lib.getLib pypkgs.pyqt6-sip;
|
||||||
qdarkstyleStorePath = lib.getLib python312Packages.qdarkstyle;
|
rapidfuzzStorePath = lib.getLib pypkgs.rapidfuzz;
|
||||||
|
qdarkstyleStorePath = lib.getLib pypkgs.qdarkstyle;
|
||||||
|
|
||||||
xorgLibX11StorePath = lib.getLib xorg.libX11;
|
xorgLibX11StorePath = lib.getLib xorg.libX11;
|
||||||
xorgLibxcbStorePath = lib.getLib xorg.libxcb;
|
xorgLibxcbStorePath = lib.getLib xorg.libxcb;
|
||||||
|
|
@ -51,12 +52,12 @@ stdenv.mkDerivation {
|
||||||
xorg.xcbutilrenderutil
|
xorg.xcbutilrenderutil
|
||||||
|
|
||||||
# Python requirements.
|
# Python requirements.
|
||||||
python312Full
|
python313
|
||||||
python312Packages.uv
|
uv
|
||||||
python312Packages.qdarkstyle
|
pypkgs.qdarkstyle
|
||||||
python312Packages.rapidfuzz
|
pypkgs.rapidfuzz
|
||||||
python312Packages.pyqt6
|
pypkgs.pyqt6
|
||||||
python312Packages.qtpy
|
pypkgs.qtpy
|
||||||
];
|
];
|
||||||
src = null;
|
src = null;
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
|
@ -113,11 +114,11 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
export LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH
|
||||||
|
|
||||||
RPDFUZZ_PATH="${rapidfuzzStorePath}/lib/python3.12/site-packages"
|
RPDFUZZ_PATH="${rapidfuzzStorePath}/lib/python3.13/site-packages"
|
||||||
QDRKSTYLE_PATH="${qdarkstyleStorePath}/lib/python3.12/site-packages"
|
QDRKSTYLE_PATH="${qdarkstyleStorePath}/lib/python3.13/site-packages"
|
||||||
QTPY_PATH="${qtpyStorePath}/lib/python3.12/site-packages"
|
QTPY_PATH="${qtpyStorePath}/lib/python3.13/site-packages"
|
||||||
PYQT6_PATH="${pyqt6StorePath}/lib/python3.12/site-packages"
|
PYQT6_PATH="${pyqt6StorePath}/lib/python3.13/site-packages"
|
||||||
PYQT6_SIP_PATH="${pyqt6SipStorePath}/lib/python3.12/site-packages"
|
PYQT6_SIP_PATH="${pyqt6SipStorePath}/lib/python3.13/site-packages"
|
||||||
|
|
||||||
PATCH="$PATCH:$RPDFUZZ_PATH"
|
PATCH="$PATCH:$RPDFUZZ_PATH"
|
||||||
PATCH="$PATCH:$QDRKSTYLE_PATH"
|
PATCH="$PATCH:$QDRKSTYLE_PATH"
|
||||||
|
|
@ -127,8 +128,8 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
export PATCH
|
export PATCH
|
||||||
|
|
||||||
# Install deps
|
# install all dev and extras
|
||||||
uv lock
|
uv sync --dev --all-extras
|
||||||
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
123
flake.lock
123
flake.lock
|
|
@ -1,135 +1,24 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-utils": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1689068808,
|
|
||||||
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils_2": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems_2"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1689068808,
|
|
||||||
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nix-github-actions": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"poetry2nix",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1688870561,
|
|
||||||
"narHash": "sha256-4UYkifnPEw1nAzqqPOTL2MvWtm3sNGw1UTYTalkTcGY=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nix-github-actions",
|
|
||||||
"rev": "165b1650b753316aa7f1787f3005a8d2da0f5301",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nix-github-actions",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1692174805,
|
"lastModified": 1765779637,
|
||||||
"narHash": "sha256-xmNPFDi/AUMIxwgOH/IVom55Dks34u1g7sFKKebxUm0=",
|
"narHash": "sha256-KJ2wa/BLSrTqDjbfyNx70ov/HdgNBCBBSQP3BIzKnv4=",
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "caac0eb6bdcad0b32cb2522e03e4002c8975c62e",
|
"rev": "1306659b587dc277866c7b69eb97e5f07864d8c4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "nixos",
|
||||||
"ref": "nixos-unstable",
|
"ref": "nixos-unstable",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"poetry2nix": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils_2",
|
|
||||||
"nix-github-actions": "nix-github-actions",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1692048894,
|
|
||||||
"narHash": "sha256-cDw03rso2V4CDc3Mll0cHN+ztzysAvdI8pJ7ybbz714=",
|
|
||||||
"ref": "refs/heads/pyqt6",
|
|
||||||
"rev": "b059ad4c3051f45d6c912e17747aae37a9ec1544",
|
|
||||||
"revCount": 2276,
|
|
||||||
"type": "git",
|
|
||||||
"url": "file:///home/lord_fomo/repos/poetry2nix"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "file:///home/lord_fomo/repos/poetry2nix"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"nixpkgs": "nixpkgs"
|
||||||
"nixpkgs": "nixpkgs",
|
|
||||||
"poetry2nix": "poetry2nix"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems_2": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
255
flake.nix
255
flake.nix
|
|
@ -1,180 +1,103 @@
|
||||||
# NOTE: to convert to a poetry2nix env like this here are the
|
# An "impure" template thx to `pyproject.nix`,
|
||||||
# steps:
|
# https://pyproject-nix.github.io/pyproject.nix/templates.html#impure
|
||||||
# - install poetry in your system nix config
|
# https://github.com/pyproject-nix/pyproject.nix/blob/master/templates/impure/flake.nix
|
||||||
# - convert the repo to use poetry using `poetry init`:
|
|
||||||
# https://python-poetry.org/docs/basic-usage/#initialising-a-pre-existing-project
|
|
||||||
# - then manually ensuring all deps are converted over:
|
|
||||||
# - add this file to the repo and commit it
|
|
||||||
# -
|
|
||||||
|
|
||||||
# GROKin tips:
|
|
||||||
# - CLI eps are (ostensibly) added via an `entry_points.txt`:
|
|
||||||
# - https://packaging.python.org/en/latest/specifications/entry-points/#file-format
|
|
||||||
# - https://github.com/nix-community/poetry2nix/blob/master/editable.nix#L49
|
|
||||||
{
|
{
|
||||||
description = "piker: trading gear for hackers (pkged with poetry2nix)";
|
description = "An impure `piker` overlay using `uv` with Nix(OS)";
|
||||||
|
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
inputs = {
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
# see https://github.com/nix-community/poetry2nix/tree/master#api
|
|
||||||
inputs.poetry2nix = {
|
|
||||||
# url = "github:nix-community/poetry2nix";
|
|
||||||
# url = "github:K900/poetry2nix/qt5-explicit-deps";
|
|
||||||
url = "/home/lord_fomo/repos/poetry2nix";
|
|
||||||
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs =
|
||||||
self,
|
{ nixpkgs, ... }:
|
||||||
nixpkgs,
|
|
||||||
flake-utils,
|
|
||||||
poetry2nix,
|
|
||||||
}:
|
|
||||||
# TODO: build cross-OS and use the `${system}` var thingy..
|
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
|
||||||
let
|
let
|
||||||
# use PWD as sources
|
inherit (nixpkgs) lib;
|
||||||
projectDir = ./.;
|
forAllSystems = lib.genAttrs lib.systems.flakeExposed;
|
||||||
pyproject = ./pyproject.toml;
|
|
||||||
poetrylock = ./poetry.lock;
|
|
||||||
|
|
||||||
# TODO: port to 3.11 and support both versions?
|
|
||||||
python = "python3.10";
|
|
||||||
|
|
||||||
# for more functions and examples.
|
|
||||||
# inherit
|
|
||||||
# (poetry2nix.legacyPackages.${system})
|
|
||||||
# mkPoetryApplication;
|
|
||||||
# pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
|
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
|
||||||
lib = pkgs.lib;
|
|
||||||
p2npkgs = poetry2nix.legacyPackages.x86_64-linux;
|
|
||||||
|
|
||||||
# define all pkg overrides per dep, see edgecases.md:
|
|
||||||
# https://github.com/nix-community/poetry2nix/blob/master/docs/edgecases.md
|
|
||||||
# TODO: add these into the json file:
|
|
||||||
# https://github.com/nix-community/poetry2nix/blob/master/overrides/build-systems.json
|
|
||||||
pypkgs-build-requirements = {
|
|
||||||
asyncvnc = [ "setuptools" ];
|
|
||||||
eventkit = [ "setuptools" ];
|
|
||||||
ib-insync = [ "setuptools" "flake8" ];
|
|
||||||
msgspec = [ "setuptools"];
|
|
||||||
pdbp = [ "setuptools" ];
|
|
||||||
pyqt6-sip = [ "setuptools" ];
|
|
||||||
tabcompleter = [ "setuptools" ];
|
|
||||||
tractor = [ "setuptools" ];
|
|
||||||
tricycle = [ "setuptools" ];
|
|
||||||
trio-typing = [ "setuptools" ];
|
|
||||||
trio-util = [ "setuptools" ];
|
|
||||||
xonsh = [ "setuptools" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# auto-generate override entries
|
|
||||||
p2n-overrides = p2npkgs.defaultPoetryOverrides.extend (self: super:
|
|
||||||
builtins.mapAttrs (package: build-requirements:
|
|
||||||
(builtins.getAttr package super).overridePythonAttrs (old: {
|
|
||||||
buildInputs = (
|
|
||||||
old.buildInputs or [ ]
|
|
||||||
) ++ (
|
|
||||||
builtins.map (
|
|
||||||
pkg: if builtins.isString pkg then builtins.getAttr pkg super else pkg
|
|
||||||
) build-requirements
|
|
||||||
);
|
|
||||||
})
|
|
||||||
) pypkgs-build-requirements
|
|
||||||
);
|
|
||||||
|
|
||||||
# override some ahead-of-time compiled extensions
|
|
||||||
# to be built with their wheels.
|
|
||||||
ahot_overrides = p2n-overrides.extend(
|
|
||||||
final: prev: {
|
|
||||||
|
|
||||||
# llvmlite = prev.llvmlite.override {
|
|
||||||
# preferWheel = false;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# TODO: get this workin with p2n and nixpkgs..
|
|
||||||
# pyqt6 = prev.pyqt6.override {
|
|
||||||
# preferWheel = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# NOTE: this DOESN'T work atm but after a fix
|
|
||||||
# to poetry2nix, it will and actually this line
|
|
||||||
# won't be needed - thanks @k900:
|
|
||||||
# https://github.com/nix-community/poetry2nix/pull/1257
|
|
||||||
pyqt5 = prev.pyqt5.override {
|
|
||||||
# withWebkit = false;
|
|
||||||
preferWheel = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# see PR from @k900:
|
|
||||||
# https://github.com/nix-community/poetry2nix/pull/1257
|
|
||||||
# pyqt5-qt5 = prev.pyqt5-qt5.override {
|
|
||||||
# withWebkit = false;
|
|
||||||
# preferWheel = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# TODO: patch in an override for polars to build
|
|
||||||
# from src! See the details likely needed from
|
|
||||||
# the cryptography entry:
|
|
||||||
# https://github.com/nix-community/poetry2nix/blob/master/overrides/default.nix#L426-L435
|
|
||||||
polars = prev.polars.override {
|
|
||||||
preferWheel = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
# WHY!? -> output-attrs that `nix develop` scans for:
|
|
||||||
# https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-develop.html#flake-output-attributes
|
|
||||||
in
|
in
|
||||||
rec {
|
{
|
||||||
packages = {
|
devShells = forAllSystems (
|
||||||
# piker = poetry2nix.legacyPackages.x86_64-linux.mkPoetryEditablePackage {
|
system:
|
||||||
# editablePackageSources = { piker = ./piker; };
|
let
|
||||||
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
piker = p2npkgs.mkPoetryApplication {
|
# do store-path extractions
|
||||||
projectDir = projectDir;
|
qt6baseStorePath = lib.getLib pkgs.qt6.qtbase;
|
||||||
|
# ?TODO? can remove below since manual linking not needed?
|
||||||
|
# qt6QtWaylandStorePath = lib.getLib pkgs.qt6.qtwayland;
|
||||||
|
|
||||||
# SEE ABOVE for auto-genned input set, override
|
# XXX NOTE XXX, for now we overlay specific pkgs via
|
||||||
# buncha deps with extras.. like `setuptools` mostly.
|
# a major-version-pinned-`cpython`
|
||||||
# TODO: maybe propose a patch to p2n to show that you
|
cpython = "python313";
|
||||||
# can even do this in the edgecases docs?
|
pypkgs = pkgs."${cpython}Packages";
|
||||||
overrides = ahot_overrides;
|
in
|
||||||
|
{
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
|
||||||
# XXX: won't work on llvmlite..
|
packages = with pkgs; [
|
||||||
# preferWheels = true;
|
# XXX, ensure sh completions active!
|
||||||
};
|
bashInteractive
|
||||||
};
|
bash-completion
|
||||||
|
|
||||||
# devShells.default = pkgs.mkShell {
|
# dev utils
|
||||||
# projectDir = projectDir;
|
ruff
|
||||||
# python = "python3.10";
|
pypkgs.ruff
|
||||||
# overrides = ahot_overrides;
|
|
||||||
# inputsFrom = [ self.packages.x86_64-linux.piker ];
|
|
||||||
# packages = packages;
|
|
||||||
# # packages = [ poetry2nix.packages.${system}.poetry ];
|
|
||||||
# };
|
|
||||||
|
|
||||||
# TODO: grok the difference here..
|
qt6.qtwayland
|
||||||
# - avoid re-cloning git repos on every develop entry..
|
qt6.qtbase
|
||||||
# - ideally allow hacking on the src code of some deps
|
|
||||||
# (tractor, pyqtgraph, tomlkit, etc.) WITHOUT having to
|
uv
|
||||||
# re-install them every time a change is made.
|
python313 # ?TODO^ how to set from `cpython` above?
|
||||||
# - boot a usable xonsh inside the poetry virtualenv when
|
pypkgs.pyqt6
|
||||||
# defined via a custom entry point?
|
pypkgs.pyqt6-sip
|
||||||
devShells.default = p2npkgs.mkPoetryEnv {
|
pypkgs.qtpy
|
||||||
# env = p2npkgs.mkPoetryEnv {
|
pypkgs.qdarkstyle
|
||||||
projectDir = projectDir;
|
pypkgs.rapidfuzz
|
||||||
python = pkgs.python310;
|
];
|
||||||
overrides = ahot_overrides;
|
|
||||||
editablePackageSources = packages;
|
shellHook = ''
|
||||||
# piker = "./";
|
# unmask to debug **this** dev-shell-hook
|
||||||
# tractor = "../tractor/";
|
# set -e
|
||||||
# }; # wut?
|
|
||||||
|
# set qt-base/plugin path(s)
|
||||||
|
QTBASE_PATH="${qt6baseStorePath}/lib"
|
||||||
|
QT_PLUGIN_PATH="${qt6baseStorePath}/lib/qt-6/plugins"
|
||||||
|
QT_QPA_PLATFORM_PLUGIN_PATH="$QT_PLUGIN_PATH/platforms"
|
||||||
|
|
||||||
|
# link in Qt cc lib paths from <nixpkgs>
|
||||||
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$QTBASE_PATH"
|
||||||
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$QT_PLUGIN_PATH"
|
||||||
|
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$QT_QPA_PLATFORM_PLUGIN_PATH"
|
||||||
|
|
||||||
|
# link-in c++ stdlib for various AOT-ext-pkgs (numpy, etc.)
|
||||||
|
LD_LIBRARY_PATH="${pkgs.stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH"
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH
|
||||||
|
|
||||||
|
# RUNTIME-SETTINGS
|
||||||
|
#
|
||||||
|
# ------ Qt ------
|
||||||
|
# XXX, unmask to debug qt .so linking/loading deats
|
||||||
|
# export QT_DEBUG_PLUGINS=1
|
||||||
|
#
|
||||||
|
# ALSO, for *modern linux* DEs,
|
||||||
|
# - maybe set wayland-mode (TODO, parametrtize this!)
|
||||||
|
# * a chosen wayland-mode shell-integration
|
||||||
|
export QT_QPA_PLATFORM="wayland"
|
||||||
|
export QT_WAYLAND_SHELL_INTEGRATION="xdg-shell"
|
||||||
|
|
||||||
|
# ------ uv ------
|
||||||
|
# - always use the ./py313/ venv-subdir
|
||||||
|
export UV_PROJECT_ENVIRONMENT="py313"
|
||||||
|
# sync project-env with all extras
|
||||||
|
uv sync --dev --all-extras --no-group lint
|
||||||
|
|
||||||
|
# ------ TIPS ------
|
||||||
|
# NOTE, to launch the py-venv installed `xonsh` (like @goodboy)
|
||||||
|
# run the `nix develop` cmd with,
|
||||||
|
# >> nix develop -c uv run xonsh
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
); # end of .outputs scope
|
);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
124
pyproject.toml
124
pyproject.toml
|
|
@ -23,7 +23,7 @@ name = "piker"
|
||||||
version = "0.1.0a0dev0"
|
version = "0.1.0a0dev0"
|
||||||
description = "trading gear for hackers"
|
description = "trading gear for hackers"
|
||||||
authors = [{ name = "Tyler Goodlet", email = "goodboy_foss@protonmail.com" }]
|
authors = [{ name = "Tyler Goodlet", email = "goodboy_foss@protonmail.com" }]
|
||||||
requires-python = ">=3.12, <3.13"
|
requires-python = ">=3.12"
|
||||||
license = "AGPL-3.0-or-later"
|
license = "AGPL-3.0-or-later"
|
||||||
readme = "README.rst"
|
readme = "README.rst"
|
||||||
keywords = [
|
keywords = [
|
||||||
|
|
@ -39,8 +39,8 @@ classifiers = [
|
||||||
"Operating System :: POSIX :: Linux",
|
"Operating System :: POSIX :: Linux",
|
||||||
"Programming Language :: Python :: Implementation :: CPython",
|
"Programming Language :: Python :: Implementation :: CPython",
|
||||||
"Programming Language :: Python :: 3 :: Only",
|
"Programming Language :: Python :: 3 :: Only",
|
||||||
"Programming Language :: Python :: 3.11",
|
|
||||||
"Programming Language :: Python :: 3.12",
|
"Programming Language :: Python :: 3.12",
|
||||||
|
"Programming Language :: Python :: 3.13",
|
||||||
"Intended Audience :: Financial and Insurance Industry",
|
"Intended Audience :: Financial and Insurance Industry",
|
||||||
"Intended Audience :: Science/Research",
|
"Intended Audience :: Science/Research",
|
||||||
"Intended Audience :: Developers",
|
"Intended Audience :: Developers",
|
||||||
|
|
@ -49,13 +49,13 @@ classifiers = [
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-generator >=1.10, <2.0.0",
|
"async-generator >=1.10, <2.0.0",
|
||||||
"attrs >=23.1.0, <24.0.0",
|
"attrs >=23.1.0, <24.0.0",
|
||||||
"bidict >=0.22.1, <0.23.0",
|
"bidict >=0.23.1",
|
||||||
"colorama >=0.4.6, <0.5.0",
|
"colorama >=0.4.6, <0.5.0",
|
||||||
"colorlog >=6.7.0, <7.0.0",
|
"colorlog >=6.7.0, <7.0.0",
|
||||||
"ib-insync >=0.9.86, <0.10.0",
|
"ib-insync >=0.9.86, <0.10.0",
|
||||||
"numba >=0.59.0, <0.60.0",
|
"numpy>=2.0",
|
||||||
"numpy >=1.25, <2.0",
|
"polars >=0.20.6",
|
||||||
"polars >=0.18.13, <0.19.0",
|
"polars-fuzzy-match>=0.1.5",
|
||||||
"pygments >=2.16.1, <3.0.0",
|
"pygments >=2.16.1, <3.0.0",
|
||||||
"rich >=13.5.2, <14.0.0",
|
"rich >=13.5.2, <14.0.0",
|
||||||
"tomli >=2.0.1, <3.0.0",
|
"tomli >=2.0.1, <3.0.0",
|
||||||
|
|
@ -63,21 +63,27 @@ dependencies = [
|
||||||
"trio-util >=0.7.0, <0.8.0",
|
"trio-util >=0.7.0, <0.8.0",
|
||||||
"trio-websocket >=0.10.3, <0.11.0",
|
"trio-websocket >=0.10.3, <0.11.0",
|
||||||
"typer >=0.9.0, <1.0.0",
|
"typer >=0.9.0, <1.0.0",
|
||||||
"rapidfuzz >=3.5.2, <4.0.0",
|
"trio >=0.27",
|
||||||
"pdbp >=1.5.0, <2.0.0",
|
"pendulum",
|
||||||
"trio >=0.24, <0.25",
|
|
||||||
"pendulum >=3.0.0, <4.0.0",
|
|
||||||
"httpx >=0.27.0, <0.28.0",
|
"httpx >=0.27.0, <0.28.0",
|
||||||
"cryptofeed >=2.4.0, <3.0.0",
|
"cryptofeed >=2.4.0, <3.0.0",
|
||||||
"pyarrow >=17.0.0, <18.0.0",
|
"pyarrow>=18.0.0",
|
||||||
"websockets ==12.0",
|
"websockets ==12.0",
|
||||||
"msgspec",
|
"msgspec>=0.19.0,<0.20",
|
||||||
"tractor",
|
"tractor",
|
||||||
"asyncvnc",
|
|
||||||
"tomlkit",
|
"tomlkit",
|
||||||
|
"trio-typing>=0.10.0",
|
||||||
|
"numba>=0.61.0",
|
||||||
|
"pyvnc",
|
||||||
]
|
]
|
||||||
|
# ------ dependencies ------
|
||||||
|
|
||||||
[project.optional-dependencies]
|
|
||||||
|
# TODO: add an `--only daemon` group for running non-ui / pikerd
|
||||||
|
# service tree in distributed mode B)
|
||||||
|
# https://docs.astral.sh/uv/concepts/projects/dependencies/#optional-dependencies
|
||||||
|
|
||||||
|
[dependency-groups]
|
||||||
uis = [
|
uis = [
|
||||||
# https://docs.astral.sh/uv/concepts/projects/dependencies/#optional-dependencies
|
# https://docs.astral.sh/uv/concepts/projects/dependencies/#optional-dependencies
|
||||||
# TODO: make sure the levenshtein shit compiles on nix..
|
# TODO: make sure the levenshtein shit compiles on nix..
|
||||||
|
|
@ -90,12 +96,11 @@ uis = [
|
||||||
# for consideration,
|
# for consideration,
|
||||||
# - 'visidata'
|
# - 'visidata'
|
||||||
|
|
||||||
# TODO: add an `--only daemon` group for running non-ui / pikerd
|
"qdarkstyle >=3.0.2, <4.0.0",
|
||||||
# service tree in distributed mode B)
|
"pyqt6 >=6.7.0, <7.0.0",
|
||||||
# https://docs.astral.sh/uv/concepts/projects/dependencies/#optional-dependencies
|
"pyqtgraph",
|
||||||
]
|
]
|
||||||
|
|
||||||
[dependency-groups]
|
|
||||||
# TODO: a toolset that makes debugging a `pikerd` service (tree) easy
|
# TODO: a toolset that makes debugging a `pikerd` service (tree) easy
|
||||||
# to hack on directly using more or less the local env:
|
# to hack on directly using more or less the local env:
|
||||||
# - xonsh + xxh
|
# - xonsh + xxh
|
||||||
|
|
@ -104,31 +109,92 @@ uis = [
|
||||||
#
|
#
|
||||||
# console ehancements and eventually remote debugging extras/helpers.
|
# console ehancements and eventually remote debugging extras/helpers.
|
||||||
# use `uv --dev` to enable
|
# use `uv --dev` to enable
|
||||||
dev = [
|
repl = [
|
||||||
"pytest >=6.0.0, <7.0.0",
|
# debug
|
||||||
"elasticsearch >=8.9.0, <9.0.0",
|
"pdbp >=1.5.0, <2.0.0",
|
||||||
"xonsh >=0.14.2, <0.15.0",
|
|
||||||
"prompt-toolkit ==3.0.40",
|
|
||||||
"cython >=3.0.0, <4.0.0",
|
|
||||||
"greenback >=1.1.1, <2.0.0",
|
"greenback >=1.1.1, <2.0.0",
|
||||||
"ruff>=0.9.6",
|
"xonsh",
|
||||||
|
"prompt-toolkit ==3.0.40",
|
||||||
|
"pyperclip>=1.9.0",
|
||||||
|
|
||||||
]
|
]
|
||||||
|
testing = [
|
||||||
|
"pytest",
|
||||||
|
]
|
||||||
|
de = [
|
||||||
|
# DE-specific
|
||||||
|
"i3ipc>=2.2.1",
|
||||||
|
]
|
||||||
|
dev = [
|
||||||
|
# https://docs.astral.sh/uv/concepts/projects/dependencies/#development-dependencies
|
||||||
|
"cython >=3.0.0, <4.0.0",
|
||||||
|
|
||||||
|
# nested deps-groups
|
||||||
|
# https://docs.astral.sh/uv/concepts/projects/dependencies/#nesting-groups
|
||||||
|
{include-group = 'uis'},
|
||||||
|
{include-group = 'repl'},
|
||||||
|
{include-group = 'testing'},
|
||||||
|
{include-group = 'de'},
|
||||||
|
]
|
||||||
|
lint = [
|
||||||
|
# XXX, with flake.nix needs to be from nixpkgs
|
||||||
|
"ruff>=0.9.6"
|
||||||
|
#
|
||||||
|
# ^TODO? these markers don't work; use deps-flags for now?
|
||||||
|
# ; os_name != 'nixos' and platform_system != 'NixOS'",
|
||||||
|
# ; defined('IN_NIX_SHELL')",
|
||||||
|
]
|
||||||
|
dbs = [
|
||||||
|
"elasticsearch >=8.9.0, <9.0.0",
|
||||||
|
]
|
||||||
|
# ------ dependency-groups ------
|
||||||
|
|
||||||
|
|
||||||
|
[tool.pytest.ini_options]
|
||||||
|
# https://docs.pytest.org/en/stable/reference/reference.html#configuration-options
|
||||||
|
testpaths = [
|
||||||
|
"tests",
|
||||||
|
]
|
||||||
|
# https://docs.pytest.org/en/stable/reference/reference.html#confval-console_output_style
|
||||||
|
console_output_style = 'progress'
|
||||||
|
|
||||||
|
# https://docs.pytest.org/en/stable/how-to/plugins.html#disabling-plugins-from-autoloading
|
||||||
|
# https://docs.pytest.org/en/stable/how-to/plugins.html#deactivating-unregistering-a-plugin-by-name
|
||||||
|
addopts = '-p no:xonsh'
|
||||||
|
# ------ tool.pytest ------
|
||||||
|
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
piker = "piker.cli:cli"
|
piker = "piker.cli:cli"
|
||||||
pikerd = "piker.cli:pikerd"
|
pikerd = "piker.cli:pikerd"
|
||||||
ledger = "piker.accounting.cli:ledger"
|
ledger = "piker.accounting.cli:ledger"
|
||||||
|
# ------ project.scripts ------
|
||||||
|
|
||||||
[tool.hatch.build.targets.sdist]
|
[tool.hatch.build.targets.sdist]
|
||||||
include = ["piker"]
|
include = ["piker"]
|
||||||
|
|
||||||
[tool.hatch.build.targets.wheel]
|
[tool.hatch.build.targets.wheel]
|
||||||
include = ["piker"]
|
include = ["piker"]
|
||||||
|
# ------ tool.hatch ------
|
||||||
|
|
||||||
|
|
||||||
|
# TODO? move to a `uv.toml`?
|
||||||
|
[tool.uv]
|
||||||
|
python-preference = 'system'
|
||||||
|
python-downloads = 'manual'
|
||||||
|
# https://docs.astral.sh/uv/concepts/projects/dependencies/#default-groups
|
||||||
|
default-groups = ['uis', 'dev']
|
||||||
|
# ------ tool.uv ------
|
||||||
|
|
||||||
|
|
||||||
[tool.uv.sources]
|
[tool.uv.sources]
|
||||||
pyqtgraph = { git = "https://github.com/pikers/pyqtgraph.git" }
|
pyqtgraph = { git = "https://github.com/pikers/pyqtgraph.git" }
|
||||||
asyncvnc = { git = "https://github.com/pikers/asyncvnc.git", branch = "main" }
|
|
||||||
tomlkit = { git = "https://github.com/pikers/tomlkit.git", branch ="piker_pin" }
|
tomlkit = { git = "https://github.com/pikers/tomlkit.git", branch ="piker_pin" }
|
||||||
msgspec = { git = "https://github.com/jcrist/msgspec.git" }
|
pyvnc = { git = "https://github.com/regulad/pyvnc.git" }
|
||||||
tractor = { git = "https://pikers.dev/goodboy/tractor", branch = "piker_pin" }
|
|
||||||
|
# XXX since, we're like, always hacking new shite all-the-time. Bp
|
||||||
|
tractor = { git = "https://github.com/goodboy/tractor.git", branch ="piker_pin" }
|
||||||
|
# tractor = { git = "https://pikers.dev/goodboy/tractor", branch = "piker_pin" }
|
||||||
|
# tractor = { git = "https://pikers.dev/goodboy/tractor", branch = "main" }
|
||||||
|
# ------ goodboy ------
|
||||||
|
# hackin dev-envs, usually there's something new he's hackin in..
|
||||||
# tractor = { path = "../tractor", editable = true }
|
# tractor = { path = "../tractor", editable = true }
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,9 @@ ignore-init-module-imports = false
|
||||||
fixable = ["ALL"]
|
fixable = ["ALL"]
|
||||||
unfixable = []
|
unfixable = []
|
||||||
|
|
||||||
|
# TODO? uhh why no work!?
|
||||||
# Allow unused variables when underscore-prefixed.
|
# Allow unused variables when underscore-prefixed.
|
||||||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
# dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
|
||||||
|
|
||||||
[format]
|
[format]
|
||||||
# Use single quotes in `ruff format`.
|
# Use single quotes in `ruff format`.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue