From a1866a962c21a6e15f40cbde2bd09c0ff42f1454 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Mon, 30 Aug 2021 00:24:43 +0300 Subject: [PATCH] Update the nix-shell environment (#13316) * Nix: Allow calls to `bin/qmk` even when the build was started by `qmk` The `$PATH` modifications performed by the Nix wrapper for the `qmk` executable prevent `bin/qmk` from working properly (the changed `$PATH` contains a wrong `python3` executable which does not have the needed Python modules in its module path). As a workaround, disable the generation of that wrapper for the `qmk` Python package (there is yet another wrapper generated while building the Python environment, which would still set the Python module path properly when running `qmk`). Although `bin/qmk` is officially deprecated, QMK CLI still invokes it in some cases (at least `qmk doctor` and `qmk pytest`), therefore keeping these invocations working is useful. * Nix: Update `util/nix/pyproject.toml` to match `requirements*.txt` Update the Python dependency information used by Poetry to match the current state of the qmk_firmware code. * Nix: Bump QMK CLI dependency to 1.0.0; bump other Python deps Update Python dependencies for nix-shell to the most recent releases: - dotty-dict: 1.3.0 -> no longer used - milc: 1.4.2 -> 1.6.2 - pep8-naming: 0.11.1 -> 0.12.1 - pygments: 2.9.0 -> 2.10.0 - pyrsistent: 0.17.3 -> 0.18.0 - pyusb: 1.1.1 -> 1.2.1 - setuptools-scm: 6.0.1 -> no longer used - qmk: 0.1.0 -> 1.0.0 - qmk-dotty-dict: not used -> 1.3.0.post1 - yapf: 0.30.0 -> 0.31.0 Note to self: The command to update Python dependencies changed to: ( cd util/nix && nix run 'nixpkgs#poetry' -- update --lock ) --- shell.nix | 7 ++ util/nix/poetry.lock | 163 ++++++++++++++++++++-------------------- util/nix/pyproject.toml | 32 ++++---- 3 files changed, 107 insertions(+), 95 deletions(-) diff --git a/shell.nix b/shell.nix index 74656032a5d..c36df032de4 100644 --- a/shell.nix +++ b/shell.nix @@ -12,6 +12,13 @@ let # files if the requirements*.txt files change pythonEnv = poetry2nix.mkPoetryEnv { projectDir = ./util/nix; + overrides = poetry2nix.overrides.withDefaults (self: super: { + qmk = super.qmk.overridePythonAttrs(old: { + # Allow QMK CLI to run "bin/qmk" as a subprocess (the wrapper changes + # $PATH and breaks these invocations). + dontWrapPythonPrograms = true; + }); + }); }; in diff --git a/util/nix/poetry.lock b/util/nix/poetry.lock index 1a1aefe21a4..9bb0f64deb0 100644 --- a/util/nix/poetry.lock +++ b/util/nix/poetry.lock @@ -43,29 +43,18 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" name = "coverage" version = "5.5" description = "Code coverage measurement for Python" -category = "main" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" [package.extras] toml = ["toml"] -[[package]] -name = "dotty-dict" -version = "1.3.0" -description = "Dictionary wrapper for quick access to deeply nested keys." -category = "main" -optional = false -python-versions = "*" - -[package.dependencies] -setuptools_scm = "*" - [[package]] name = "flake8" version = "3.9.2" description = "the modular source code checker: pep8 pyflakes and co" -category = "main" +category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" @@ -151,13 +140,13 @@ colorama = ">=0.3.9" name = "mccabe" version = "0.6.1" description = "McCabe checker, plugin for flake8" -category = "main" +category = "dev" optional = false python-versions = "*" [[package]] name = "milc" -version = "1.4.2" +version = "1.6.2" description = "Opinionated Batteries-Included Python 3 CLI Framework." category = "main" optional = false @@ -174,7 +163,7 @@ spinners = "*" name = "nose2" version = "0.10.0" description = "unittest2 with plugins, the succesor to nose" -category = "main" +category = "dev" optional = false python-versions = "*" @@ -188,20 +177,21 @@ dev = ["Sphinx (>=1.6.5)", "sphinx-rtd-theme", "mock", "coverage"] [[package]] name = "pep8-naming" -version = "0.11.1" +version = "0.12.1" description = "Check PEP-8 naming conventions, plugin for flake8" category = "dev" optional = false python-versions = "*" [package.dependencies] +flake8 = ">=3.9.1" flake8-polyfill = ">=1.0.2,<2" [[package]] name = "pycodestyle" version = "2.7.0" description = "Python style guide checker" -category = "main" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" @@ -209,13 +199,13 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" name = "pyflakes" version = "2.3.1" description = "passive checker of Python programs" -category = "main" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "pygments" -version = "2.9.0" +version = "2.10.0" description = "Pygments is a syntax highlighting package written in Python." category = "main" optional = false @@ -223,50 +213,44 @@ python-versions = ">=3.5" [[package]] name = "pyrsistent" -version = "0.17.3" +version = "0.18.0" description = "Persistent/Functional/Immutable data structures" category = "main" optional = false -python-versions = ">=3.5" - -[[package]] -name = "pyusb" -version = "1.1.1" -description = "Python USB access module" -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "qmk" -version = "0.0.51" -description = "A program to help users work with QMK Firmware." -category = "main" -optional = false -python-versions = ">=3.7" - -[package.dependencies] -dotty-dict = "*" -flake8 = "*" -hid = "*" -hjson = "*" -jsonschema = ">=3" -milc = ">=1.4.0" -nose2 = "*" -pygments = "*" -pyusb = "*" -yapf = "*" - -[[package]] -name = "setuptools-scm" -version = "6.0.1" -description = "the blessed package to manage your versions by scm tags" -category = "main" -optional = false python-versions = ">=3.6" -[package.extras] -toml = ["toml"] +[[package]] +name = "pyusb" +version = "1.2.1" +description = "Python USB access module" +category = "main" +optional = false +python-versions = ">=3.6.0" + +[[package]] +name = "qmk" +version = "1.0.0" +description = "A program to help users work with QMK Firmware." +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +hid = "*" +hjson = "*" +jsonschema = ">=3" +milc = ">=1.4.2" +pygments = "*" +pyusb = "*" +qmk-dotty-dict = "*" + +[[package]] +name = "qmk-dotty-dict" +version = "1.3.0.post1" +description = "Dictionary wrapper for quick access to deeply nested keys." +category = "main" +optional = false +python-versions = "*" [[package]] name = "six" @@ -294,16 +278,16 @@ python-versions = "*" [[package]] name = "yapf" -version = "0.30.0" +version = "0.31.0" description = "A formatter for Python code." -category = "main" +category = "dev" optional = false python-versions = "*" [metadata] lock-version = "1.1" python-versions = "^3.8" -content-hash = "5e181d51536240d08c74ba6a46bd0988ee4ca72ac3d5b388965ca8023e9b9a99" +content-hash = "468ae51aaddfe2ce62938f131c688bbc447e41608d4dd7d30db36391c38bda20" [metadata.files] appdirs = [ @@ -376,9 +360,6 @@ coverage = [ {file = "coverage-5.5-pp37-none-any.whl", hash = "sha256:2a3859cb82dcbda1cfd3e6f71c27081d18aa251d20a17d87d26d4cd216fb0af4"}, {file = "coverage-5.5.tar.gz", hash = "sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c"}, ] -dotty-dict = [ - {file = "dotty_dict-1.3.0.tar.gz", hash = "sha256:eb0035a3629ecd84397a68f1f42f1e94abd1c34577a19cd3eacad331ee7cbaf0"}, -] flake8 = [ {file = "flake8-3.9.2-py2.py3-none-any.whl", hash = "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5101e25e3110907"}, {file = "flake8-3.9.2.tar.gz", hash = "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b6b1d78057c576b"}, @@ -412,16 +393,16 @@ mccabe = [ {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, ] milc = [ - {file = "milc-1.4.2-py2.py3-none-any.whl", hash = "sha256:65ee004caa769b1ee144b15be7908d1f623920ab6f356e5c5c95be9457aa15d8"}, - {file = "milc-1.4.2.tar.gz", hash = "sha256:c6b2f19e3196b00a0060f8c883533e356f2054a9f81692b7b97ccee0d01626fd"}, + {file = "milc-1.6.2-py2.py3-none-any.whl", hash = "sha256:cb26404c7f3d6797c9c42005de732161e45e21294cde85845e914b279321bdad"}, + {file = "milc-1.6.2.tar.gz", hash = "sha256:779710a0b9300bef3c5748158887e6c734659e147d55548d9e4701d7a7d5dddf"}, ] nose2 = [ {file = "nose2-0.10.0-py2.py3-none-any.whl", hash = "sha256:aa620e759f2c5018d9ba041340391913e282ecebd3c392027f1575847b093ec6"}, {file = "nose2-0.10.0.tar.gz", hash = "sha256:886ba617a96de0130c54b24479bd5c2d74d5c940d40f3809c3a275511a0c4a60"}, ] pep8-naming = [ - {file = "pep8-naming-0.11.1.tar.gz", hash = "sha256:a1dd47dd243adfe8a83616e27cf03164960b507530f155db94e10b36a6cd6724"}, - {file = "pep8_naming-0.11.1-py2.py3-none-any.whl", hash = "sha256:f43bfe3eea7e0d73e8b5d07d6407ab47f2476ccaeff6937c84275cd30b016738"}, + {file = "pep8-naming-0.12.1.tar.gz", hash = "sha256:bb2455947757d162aa4cad55dba4ce029005cd1692f2899a21d51d8630ca7841"}, + {file = "pep8_naming-0.12.1-py2.py3-none-any.whl", hash = "sha256:4a8daeaeb33cfcde779309fc0c9c0a68a3bbe2ad8a8308b763c5068f86eb9f37"}, ] pycodestyle = [ {file = "pycodestyle-2.7.0-py2.py3-none-any.whl", hash = "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808c17089be302068"}, @@ -432,23 +413,43 @@ pyflakes = [ {file = "pyflakes-2.3.1.tar.gz", hash = "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326104746cc00c1db"}, ] pygments = [ - {file = "Pygments-2.9.0-py3-none-any.whl", hash = "sha256:d66e804411278594d764fc69ec36ec13d9ae9147193a1740cd34d272ca383b8e"}, - {file = "Pygments-2.9.0.tar.gz", hash = "sha256:a18f47b506a429f6f4b9df81bb02beab9ca21d0a5fee38ed15aef65f0545519f"}, + {file = "Pygments-2.10.0-py3-none-any.whl", hash = "sha256:b8e67fe6af78f492b3c4b3e2970c0624cbf08beb1e493b2c99b9fa1b67a20380"}, + {file = "Pygments-2.10.0.tar.gz", hash = "sha256:f398865f7eb6874156579fdf36bc840a03cab64d1cde9e93d68f46a425ec52c6"}, ] pyrsistent = [ - {file = "pyrsistent-0.17.3.tar.gz", hash = "sha256:2e636185d9eb976a18a8a8e96efce62f2905fea90041958d8cc2a189756ebf3e"}, + {file = "pyrsistent-0.18.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f4c8cabb46ff8e5d61f56a037974228e978f26bfefce4f61a4b1ac0ba7a2ab72"}, + {file = "pyrsistent-0.18.0-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:da6e5e818d18459fa46fac0a4a4e543507fe1110e808101277c5a2b5bab0cd2d"}, + {file = "pyrsistent-0.18.0-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:5e4395bbf841693eaebaa5bb5c8f5cdbb1d139e07c975c682ec4e4f8126e03d2"}, + {file = "pyrsistent-0.18.0-cp36-cp36m-win32.whl", hash = "sha256:527be2bfa8dc80f6f8ddd65242ba476a6c4fb4e3aedbf281dfbac1b1ed4165b1"}, + {file = "pyrsistent-0.18.0-cp36-cp36m-win_amd64.whl", hash = "sha256:2aaf19dc8ce517a8653746d98e962ef480ff34b6bc563fc067be6401ffb457c7"}, + {file = "pyrsistent-0.18.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:58a70d93fb79dc585b21f9d72487b929a6fe58da0754fa4cb9f279bb92369396"}, + {file = "pyrsistent-0.18.0-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:4916c10896721e472ee12c95cdc2891ce5890898d2f9907b1b4ae0f53588b710"}, + {file = "pyrsistent-0.18.0-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:73ff61b1411e3fb0ba144b8f08d6749749775fe89688093e1efef9839d2dcc35"}, + {file = "pyrsistent-0.18.0-cp37-cp37m-win32.whl", hash = "sha256:b29b869cf58412ca5738d23691e96d8aff535e17390128a1a52717c9a109da4f"}, + {file = "pyrsistent-0.18.0-cp37-cp37m-win_amd64.whl", hash = "sha256:097b96f129dd36a8c9e33594e7ebb151b1515eb52cceb08474c10a5479e799f2"}, + {file = "pyrsistent-0.18.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:772e94c2c6864f2cd2ffbe58bb3bdefbe2a32afa0acb1a77e472aac831f83427"}, + {file = "pyrsistent-0.18.0-cp38-cp38-manylinux1_i686.whl", hash = "sha256:c1a9ff320fa699337e05edcaae79ef8c2880b52720bc031b219e5b5008ebbdef"}, + {file = "pyrsistent-0.18.0-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:cd3caef37a415fd0dae6148a1b6957a8c5f275a62cca02e18474608cb263640c"}, + {file = "pyrsistent-0.18.0-cp38-cp38-win32.whl", hash = "sha256:e79d94ca58fcafef6395f6352383fa1a76922268fa02caa2272fff501c2fdc78"}, + {file = "pyrsistent-0.18.0-cp38-cp38-win_amd64.whl", hash = "sha256:a0c772d791c38bbc77be659af29bb14c38ced151433592e326361610250c605b"}, + {file = "pyrsistent-0.18.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d5ec194c9c573aafaceebf05fc400656722793dac57f254cd4741f3c27ae57b4"}, + {file = "pyrsistent-0.18.0-cp39-cp39-manylinux1_i686.whl", hash = "sha256:6b5eed00e597b5b5773b4ca30bd48a5774ef1e96f2a45d105db5b4ebb4bca680"}, + {file = "pyrsistent-0.18.0-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:48578680353f41dca1ca3dc48629fb77dfc745128b56fc01096b2530c13fd426"}, + {file = "pyrsistent-0.18.0-cp39-cp39-win32.whl", hash = "sha256:f3ef98d7b76da5eb19c37fda834d50262ff9167c65658d1d8f974d2e4d90676b"}, + {file = "pyrsistent-0.18.0-cp39-cp39-win_amd64.whl", hash = "sha256:404e1f1d254d314d55adb8d87f4f465c8693d6f902f67eb6ef5b4526dc58e6ea"}, + {file = "pyrsistent-0.18.0.tar.gz", hash = "sha256:773c781216f8c2900b42a7b638d5b517bb134ae1acbebe4d1e8f1f41ea60eb4b"}, ] pyusb = [ - {file = "pyusb-1.1.1-py3-none-any.whl", hash = "sha256:f18eb813d3a1439918071234589162c2f209a19adbeffeb1377ce078a4aebc70"}, - {file = "pyusb-1.1.1.tar.gz", hash = "sha256:7d449ad916ce58aff60b89aae0b65ac130f289c24d6a5b7b317742eccffafc38"}, + {file = "pyusb-1.2.1-py3-none-any.whl", hash = "sha256:2b4c7cb86dbadf044dfb9d3a4ff69fd217013dbe78a792177a3feb172449ea36"}, + {file = "pyusb-1.2.1.tar.gz", hash = "sha256:a4cc7404a203144754164b8b40994e2849fde1cfff06b08492f12fff9d9de7b9"}, ] qmk = [ - {file = "qmk-0.0.51-py2.py3-none-any.whl", hash = "sha256:5f676f389b2450b0956d7eb8e7e378d2e6690d5859a887c91876da0a5faf75ed"}, - {file = "qmk-0.0.51.tar.gz", hash = "sha256:efeef209cde1df92b9823db686d9684962cd00aae9f45ba5e3d494aa5b3c6b9a"}, + {file = "qmk-1.0.0-py2.py3-none-any.whl", hash = "sha256:63d69b97a533d91b0cfa7887e68cac7df52c6f7bddf4bf44d17ef1241d85ffff"}, + {file = "qmk-1.0.0.tar.gz", hash = "sha256:da62eec73c4548cc37b0b9be3937202dc3a301dc2f2663610ecca751a610f9ca"}, ] -setuptools-scm = [ - {file = "setuptools_scm-6.0.1-py3-none-any.whl", hash = "sha256:c3bd5f701c8def44a5c0bfe8d407bef3f80342217ef3492b951f3777bd2d915c"}, - {file = "setuptools_scm-6.0.1.tar.gz", hash = "sha256:d1925a69cb07e9b29416a275b9fadb009a23c148ace905b2fb220649a6c18e92"}, +qmk-dotty-dict = [ + {file = "qmk_dotty_dict-1.3.0.post1-py3-none-any.whl", hash = "sha256:a9cb7fc3ff9631190fee0ecac14986a0ac7b4b6892347dc9d7486a4c4ea24492"}, + {file = "qmk_dotty_dict-1.3.0.post1.tar.gz", hash = "sha256:3b611e393660bfaa6835c68e94784bae80fe07b8490978b5ecab03a0d2fc7ea2"}, ] six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, @@ -462,6 +463,6 @@ termcolor = [ {file = "termcolor-1.1.0.tar.gz", hash = "sha256:1d6d69ce66211143803fbc56652b41d73b4a400a2891d7bf7a1cdf4c02de613b"}, ] yapf = [ - {file = "yapf-0.30.0-py2.py3-none-any.whl", hash = "sha256:3abf61ba67cf603069710d30acbc88cfe565d907e16ad81429ae90ce9651e0c9"}, - {file = "yapf-0.30.0.tar.gz", hash = "sha256:3000abee4c28daebad55da6c85f3cd07b8062ce48e2e9943c8da1b9667d48427"}, + {file = "yapf-0.31.0-py2.py3-none-any.whl", hash = "sha256:e3a234ba8455fe201eaa649cdac872d590089a18b661e39bbac7020978dd9c2e"}, + {file = "yapf-0.31.0.tar.gz", hash = "sha256:408fb9a2b254c302f49db83c59f9aa0b4b0fd0ec25be3a5c51181327922ff63d"}, ] diff --git a/util/nix/pyproject.toml b/util/nix/pyproject.toml index a8133618934..1ec8aacd4ad 100644 --- a/util/nix/pyproject.toml +++ b/util/nix/pyproject.toml @@ -9,23 +9,27 @@ authors = [] [tool.poetry.dependencies] python = "^3.8" -appdirs = "^1.4.4" -argcomplete = "^1.12.2" -colorama = "^0.4.4" -dotty-dict = "^1.3.0" -hjson = "^3.0.2" -jsonschema = "^3.2.0" -milc = "^1.3.0" -Pygments = "^2.8.0" +appdirs = "*" +argcomplete = "*" +colorama = "*" +hid = "*" +hjson = "*" +jsonschema = ">=3" +milc = ">=1.4.2" +Pygments = "*" +pyusb = "*" +qmk-dotty-dict = "*" + +# This dependency is not mentioned in requirements.txt (QMK CLI is not a +# library package that is required by the Python code in qmk_firmware), but is +# required to build a proper nix-shell environment. qmk = "*" [tool.poetry.dev-dependencies] -nose2 = "^0.10.0" -flake8 = "^3.8.4" -hid = "^1.0.4" -pep8-naming = "^0.11.1" -pyusb = "^1.1.1" -yapf = "^0.30.0" +nose2 = "*" +flake8 = "*" +pep8-naming = "*" +yapf = "*" [build-system] requires = ["poetry-core>=1.0.0"]