From 833e5c251a1d8ee0b379141a1e95292ef55b46d7 Mon Sep 17 00:00:00 2001 From: Daniel Salazar Date: Tue, 9 Jan 2024 15:37:39 -0500 Subject: [PATCH] feat(back): #1171 use new builtin - Migrate lintPythonImports Signed-off-by: Daniel Salazar --- src/args/lint-python-imports/default.nix | 19 +++-- src/args/lint-python-imports/poetry.lock | 79 +++++++++++++++++++++ src/args/lint-python-imports/pyproject.toml | 15 ++++ 3 files changed, 106 insertions(+), 7 deletions(-) create mode 100644 src/args/lint-python-imports/poetry.lock create mode 100644 src/args/lint-python-imports/pyproject.toml diff --git a/src/args/lint-python-imports/default.nix b/src/args/lint-python-imports/default.nix index b86cf5a1..d6988217 100644 --- a/src/args/lint-python-imports/default.nix +++ b/src/args/lint-python-imports/default.nix @@ -1,6 +1,6 @@ { makeDerivation, - makePythonPypiEnvironment, + makePythonEnvironment, makeSearchPaths, ... }: { @@ -18,12 +18,17 @@ makeDerivation { name = "lint-python-imports-for-${name}"; searchPaths.source = [ (makeSearchPaths searchPaths) - (makePythonPypiEnvironment { - name = "lint-python-imports"; - sourcesYaml = ./pypi-sources.yaml; - withSetuptools_67_7_2 = true; - withSetuptoolsScm_7_1_0 = true; - withWheel_0_40_0 = true; + (makePythonEnvironment { + pythonProjectDir = ./.; + pythonVersion = "3.11"; + overrides = self: super: { + grimp = super.grimp.overridePythonAttrs ( + old: {buildInputs = [super.setuptools];} + ); + import-linter = super.import-linter.overridePythonAttrs ( + old: {buildInputs = [super.setuptools];} + ); + }; }) ]; } diff --git a/src/args/lint-python-imports/poetry.lock b/src/args/lint-python-imports/poetry.lock new file mode 100644 index 00000000..bac930cb --- /dev/null +++ b/src/args/lint-python-imports/poetry.lock @@ -0,0 +1,79 @@ +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. + +[[package]] +name = "click" +version = "8.1.7" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.7" +files = [ + {file = "click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28"}, + {file = "click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "grimp" +version = "1.3" +description = "Builds a queryable graph of the imports within one or more Python packages." +optional = false +python-versions = "*" +files = [ + {file = "grimp-1.3.tar.gz", hash = "sha256:ed42a6f41cebef8ceec440d6ba3c0f0e1c8b09a601223881d02cbd5e7260baf5"}, +] + +[package.dependencies] +networkx = ">=2.1,<3" + +[[package]] +name = "import-linter" +version = "1.2.4" +description = "Enforces rules for the imports within and between Python packages." +optional = false +python-versions = ">=3.6" +files = [ + {file = "import-linter-1.2.4.tar.gz", hash = "sha256:3fbc9a6e401c259e030cc1ffe39413758561ee356752257068ea64df0be4de19"}, +] + +[package.dependencies] +click = ">=6,<9" +grimp = ">=1.2.3,<2" + +[package.extras] +toml = ["toml"] + +[[package]] +name = "networkx" +version = "2.8.8" +description = "Python package for creating and manipulating graphs and networks" +optional = false +python-versions = ">=3.8" +files = [ + {file = "networkx-2.8.8-py3-none-any.whl", hash = "sha256:e435dfa75b1d7195c7b8378c3859f0445cd88c6b0375c181ed66823a9ceb7524"}, + {file = "networkx-2.8.8.tar.gz", hash = "sha256:230d388117af870fce5647a3c52401fcf753e94720e6ea6b4197a5355648885e"}, +] + +[package.extras] +default = ["matplotlib (>=3.4)", "numpy (>=1.19)", "pandas (>=1.3)", "scipy (>=1.8)"] +developer = ["mypy (>=0.982)", "pre-commit (>=2.20)"] +doc = ["nb2plots (>=0.6)", "numpydoc (>=1.5)", "pillow (>=9.2)", "pydata-sphinx-theme (>=0.11)", "sphinx (>=5.2)", "sphinx-gallery (>=0.11)", "texext (>=0.6.6)"] +extra = ["lxml (>=4.6)", "pydot (>=1.4.2)", "pygraphviz (>=1.9)", "sympy (>=1.10)"] +test = ["codecov (>=2.1)", "pytest (>=7.2)", "pytest-cov (>=4.0)"] + +[metadata] +lock-version = "2.0" +python-versions = "^3.11" +content-hash = "4fa99c149a19b535664d1482066e7c97915bfac9aa5f59302426386eca2dd9e0" diff --git a/src/args/lint-python-imports/pyproject.toml b/src/args/lint-python-imports/pyproject.toml new file mode 100644 index 00000000..0a0ecc05 --- /dev/null +++ b/src/args/lint-python-imports/pyproject.toml @@ -0,0 +1,15 @@ +[tool.poetry] +name = "lint-python-imports" +version = "0.1.0" +description = "" +authors = ["Your Name "] +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.11" +import-linter = "1.2.4" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api"