diff --git a/.gitignore b/.gitignore index 7c776d8..d66e9db 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ sqlelf.egg-info/ *.pyc .vscode/ dist/ +result diff --git a/flake.nix b/flake.nix index 8b7c127..13aec83 100644 --- a/flake.nix +++ b/flake.nix @@ -19,13 +19,14 @@ inherit system; overlays = [ poetry2nix.overlay (import ./overlay.nix) ]; }; - in { + in + { packages = { sqlelf = pkgs.sqlelf; default = pkgs.sqlelf; }; devShell = pkgs.sqlelf-env.env.overrideAttrs - (oldAttrs: { buildInputs = [ pkgs.poetry pkgs.sqlite ]; }); + (oldAttrs: { buildInputs = with pkgs; [ poetry pyright nixpkgs-fmt ]; }); }); } diff --git a/poetry.lock b/poetry.lock index f4c168b..5a35566 100644 --- a/poetry.lock +++ b/poetry.lock @@ -323,6 +323,23 @@ files = [ {file = "pyflakes-3.1.0.tar.gz", hash = "sha256:a0aae034c444db0071aa077972ba4768d40c830d9539fd45bf4cd3f8f6992efc"}, ] +[[package]] +name = "setuptools" +version = "68.1.2" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +category = "main" +optional = false +python-versions = ">=3.8" +files = [ + {file = "setuptools-68.1.2-py3-none-any.whl", hash = "sha256:3d8083eed2d13afc9426f227b24fd1659489ec107c0e86cec2ffdde5c92e790b"}, + {file = "setuptools-68.1.2.tar.gz", hash = "sha256:3d4dfa6d95f1b101d695a6160a7626e15583af71a5f52176efa5d39a054d475d"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5,<=7.1.2)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pip (>=19.1)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] + [[package]] name = "tomli" version = "2.0.1" @@ -338,4 +355,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = ">=3.10" -content-hash = "08e5f7b2b5bd712d005ab610be8b77f518cc02aa74b56e661d948e113aa93a7c" +content-hash = "0871b2e72bc3a35e481b388aaccd898b4225a2f5ab3368770188a2411cfab7de" diff --git a/pyproject.toml b/pyproject.toml index a3c32f9..ceb8ad3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,11 @@ python = ">=3.10" capstone = "^5.0.1" lief = "^0.13.2" apsw = "^3.43.0.0" +# TODO(fzakaria): Would love to specify this as an exact version +# but I was getting weird failures with `nix build` +# ERROR: Could not find a version that satisfies the requirement setuptools<61.0.0,>=60.0.0 (from sqlelf) (from versions: none) +# ERROR: No matching distribution found for setuptools<61.0.0,>=60.0.0 +setuptools = "*" [tool.poetry.group.dev.dependencies] black = "^23.7.0" @@ -28,10 +33,6 @@ sqlelf = "sqlelf.cli:start" skip = [".git", "result"] profile = "black" -[tool.flake8] -extend-ignore = "E203" -max-line-length = 88 - [tool.pytest.ini_options] addopts = "" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..213eb8d --- /dev/null +++ b/setup.cfg @@ -0,0 +1,3 @@ +[flake8] +extend-ignore = E203 +max-line-length = 88 \ No newline at end of file diff --git a/sqlelf/cli.py b/sqlelf/cli.py index 461a0d0..55409f5 100644 --- a/sqlelf/cli.py +++ b/sqlelf/cli.py @@ -26,7 +26,7 @@ def start(): args = parser.parse_args() # Iterate through our arguments and if one of them is a directory explode it out - filenames = reduce( + filenames: list[str] = reduce( lambda a, b: a + b, map( lambda dir: [os.path.join(dir, f) for f in os.listdir(dir)]