about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/database/sqlfluff/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-06-23 08:16:49 +0000
committerAlyssa Ross <hi@alyssa.is>2021-06-23 08:16:49 +0000
commit4dc730a187d41f9f2dce4fe2680c32dcecb79b93 (patch)
tree67673deb1649dc0a40962e70e6da302d7b6c4bf0 /nixpkgs/pkgs/development/tools/database/sqlfluff/default.nix
parent633cab0ecb07627706c6b523e219490f019eaab5 (diff)
parent7e567a3d092b7de69cdf5deaeb8d9526de230916 (diff)
downloadnixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar
nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar.gz
nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar.bz2
nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar.lz
nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar.xz
nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.tar.zst
nixlib-4dc730a187d41f9f2dce4fe2680c32dcecb79b93.zip
Merge commit '7e567a3d092b7de69cdf5deaeb8d9526de230916'
# Conflicts:
#	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/development/tools/database/sqlfluff/default.nix')
-rw-r--r--nixpkgs/pkgs/development/tools/database/sqlfluff/default.nix65
1 files changed, 65 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/database/sqlfluff/default.nix b/nixpkgs/pkgs/development/tools/database/sqlfluff/default.nix
new file mode 100644
index 000000000000..01f4941c8e4f
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/database/sqlfluff/default.nix
@@ -0,0 +1,65 @@
+{ lib
+, fetchFromGitHub
+, python3
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "sqlfluff";
+  version = "0.6.0a2";
+  disabled = python3.pythonOlder "3.6";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = version;
+    sha256 = "13hzr0jialzi2nlvqwvff3w0h6jikqvcg0p2p4irwlisg4db8w7w";
+  };
+
+  propagatedBuildInputs = with python3.pkgs; [
+    appdirs
+    cached-property
+    click
+    colorama
+    configparser
+    diff_cover
+    jinja2
+    oyaml
+    pathspec
+    pytest
+    tblib
+    toml
+  ] ++ lib.optionals (pythonOlder "3.7") [
+    dataclasses
+  ] ++ lib.optionals (pythonOlder "3.9") [
+    typing-extensions
+  ];
+
+  checkInputs = with python3.pkgs; [
+    hypothesis
+    pytestCheckHook
+  ];
+
+  disabledTestPaths = [
+    # dbt is not available yet
+    "test/core/templaters/dbt_test.py"
+    # Don't run the plugin related tests
+    "test/core/plugin_test.py"
+    "plugins/sqlfluff-plugin-example/test/rules/rule_test_cases_test.py"
+  ];
+
+  disabledTests = [
+    # dbt is not available yet
+    "test__linter__skip_dbt_model_disabled"
+    "test_rules__test_helper_has_variable_introspection"
+    "test__rules__std_file_dbt"
+  ];
+
+  pythonImportsCheck = [ "sqlfluff" ];
+
+  meta = with lib; {
+    description = "SQL linter and auto-formatter";
+    homepage = "https://www.sqlfluff.com/";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}