Unverified Commit 51106463 authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

python312Packages.flask: modernize (#373118)

parents dbbe630a b4e5418d
Loading
Loading
Loading
Loading
+29 −8
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchPypi,
  fetchFromGitHub,
  setuptools,
  flask,
  visitor,
  dominate,
  pytestCheckHook,
  requests,
}:

buildPythonPackage rec {
  pname = "flask-bootstrap";
  version = "3.3.7.1";
  pyproject = true;

  src = fetchPypi {
    pname = "Flask-Bootstrap";
    inherit version;
    sha256 = "1j1s2bplaifsnmr8vfxa3czca4rz78xyhrg4chx39xl306afs26b";
  src = fetchFromGitHub {
    owner = "mbr";
    repo = "flask-bootstrap";
    tag = version;
    hash = "sha256-TsRSNhrI1jZU/beX3G7LM64IrFagD6AYiluoGzy12jE=";
  };

  propagatedBuildInputs = [
  build-system = [ setuptools ];

  dependencies = [
    flask
    visitor
    dominate
  ];

  meta = with lib; {
  pythonImportsCheck = [ "flask_bootstrap" ];

  nativeCheckInputs = [
    pytestCheckHook
    requests
  ];

  disabledTests = [
    # requires network access
    "test_bootstrap_version_matches"
    # requires flask-appconfig
    "test_index"
  ];

  meta = {
    homepage = "https://github.com/mbr/flask-bootstrap";
    description = "Ready-to-use Twitter-bootstrap for use in Flask";
    license = licenses.asl20;
    license = lib.licenses.asl20;
    maintainers = [ ];
  };
}
+0 −39
Original line number Diff line number Diff line
{
  lib,
  fetchPypi,
  buildPythonPackage,
  crayons,
  flask,
  flask-caching,
  gunicorn,
  maya,
  meinheld,
  whitenoise,
}:

buildPythonPackage rec {
  pname = "flask-common";
  version = "0.3.0";

  src = fetchPypi {
    pname = "Flask-Common";
    inherit version;
    sha256 = "13d99f2dbc0a332b8bc4b2cc394d3e48f89672c266868e372cd9d7b433d921a9";
  };

  propagatedBuildInputs = [
    crayons
    flask
    flask-caching
    gunicorn
    maya
    meinheld
    whitenoise
  ];

  meta = with lib; {
    description = "Flask extension with lots of common time-savers";
    homepage = "https://github.com/kennethreitz/flask-common";
    license = licenses.asl20; # XXX: setup.py lists BSD but git repo has Apache 2.0 LICENSE
  };
}
+12 −25
Original line number Diff line number Diff line
{
  lib,
  fetchFromGitHub,
  fetchpatch,
  buildPythonPackage,
  isPy3k,
  setuptools,
  flask,
  mock,
  unittestCheckHook,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "flask-seasurf";
  version = "1.1.1";
  disabled = !isPy3k;
  version = "2.0.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "maxcountryman";
    repo = "flask-seasurf";
    rev = version;
    hash = "sha256-L/ZUEqqHmsyXG5eShcITII36ttwQlZN5GBngo+GcCdw=";
    tag = version;
    hash = "sha256-ajQiDizNaF0em9CVeaHEuJEeSaYraJh9YgvhvBPTIsk=";
  };

  patches = [
    # Remove usage of deprecated flask._app_ctx_stack
    (fetchpatch {
      url = "https://github.com/maxcountryman/flask-seasurf/commit/9039764a4e44aeb1acb6ae7747deb438bee0826b.patch";
      hash = "sha256-bVYzJN6MXzH3fNMknd2bh+04JlPJRkU0cLcWv+Rigqc=";
    })
    ./0001-Fix-with-new-dependency-versions.patch
  ];

  postPatch = ''
    # Disable some tests, pytest is not supported
    sed -i "s#\(\(test_header_set_on_post\|test_https_good_referer\|test_https_referer_check_disabled\)(self):\)#\1\n        return#g" test_seasurf.py
  '';
  build-system = [ setuptools ];

  propagatedBuildInputs = [ flask ];
  dependencies = [ flask ];

  nativeCheckInputs = [
    unittestCheckHook
    pytestCheckHook
    mock
  ];

  pythonImportsCheck = [ "flask_seasurf" ];

  meta = with lib; {
  meta = {
    description = "Flask extension for preventing cross-site request forgery";
    homepage = "https://github.com/maxcountryman/flask-seasurf";
    license = licenses.bsd3;
    maintainers = with maintainers; [ zhaofengli ];
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ zhaofengli ];
  };
}
+22 −6
Original line number Diff line number Diff line
@@ -2,12 +2,15 @@
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  setuptools,
  flask,
  pytestCheckHook,
}:

buildPythonPackage {
  pname = "flask-silk";
  version = "unstable-2018-06-28";
  version = "0.2-unstable-2018-06-14";
  pyproject = true;

  # master fixes flask import syntax and has no major changes
  # new release requested: https://github.com/sublee/flask-silk/pull/6
@@ -15,15 +18,28 @@ buildPythonPackage {
    owner = "sublee";
    repo = "flask-silk";
    rev = "3a8166550f9a0ec52edae7bf31d9818c4c15c531";
    sha256 = "0mplziqw52jfspas6vsm210lmxqqzgj0dxm8y0i3gpbyyykwcmh0";
    hash = "sha256-AFbGp/d+3Tci8Kj2BuT7GPdKQRBVb6PV1U6KwnH89FY=";
  };

  propagatedBuildInputs = [ flask ];
  build-system = [ setuptools ];

  meta = with lib; {
  dependencies = [ flask ];

  pythonImportsCheck = [ "flask_silk" ];

  nativeCheckInputs = [ pytestCheckHook ];

  pytestFlagsArray = [ "test.py" ];

  disabledTests = [
    # requires network access
    "test_subdomain"
  ];

  meta = {
    description = "Adds silk icons to your Flask application or module, or extension";
    license = licenses.bsd3;
    maintainers = teams.sage.members;
    license = lib.licenses.bsd3;
    maintainers = lib.teams.sage.members;
    homepage = "https://github.com/sublee/flask-silk";
  };
}
+10 −5
Original line number Diff line number Diff line
@@ -3,27 +3,32 @@
  fetchPypi,
  buildPythonPackage,
  flask,
  setuptools,
}:

buildPythonPackage rec {
  pname = "flask-sslify";
  version = "0.1.5";
  pyproject = true;

  src = fetchPypi {
    pname = "Flask-SSLify";
    inherit version;
    sha256 = "0gjl1m828z5dm3c5dpc2qjgi4llf84cp72mafr0ib5fd14y1sgnk";
    hash = "sha256-0z4dPAnNlRVBdqqKcxlBjlISn8SC3VbYqK18JFANVD4=";
  };

  propagatedBuildInputs = [ flask ];
  build-system = [ setuptools ];

  dependencies = [ flask ];

  # no tests
  doCheck = false;
  pythonImportsCheck = [ "flask_sslify" ];

  meta = with lib; {
  meta = {
    description = "Flask extension that redirects all incoming requests to HTTPS";
    homepage = "https://github.com/kennethreitz42/flask-sslify";
    license = licenses.bsd2;
    maintainers = with maintainers; [ zhaofengli ];
    license = lib.licenses.bsd2;
    maintainers = with lib.maintainers; [ zhaofengli ];
  };
}
Loading