Skip to content

Commit

Permalink
Merge pull request #218587 from sephii/python-wagtail
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 committed Mar 30, 2023
2 parents 5fce1c9 + b6629ca commit e3652e0
Show file tree
Hide file tree
Showing 12 changed files with 488 additions and 0 deletions.
38 changes: 38 additions & 0 deletions pkgs/development/python-modules/azure-mgmt-frontdoor/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{ azure-common
, azure-mgmt-core
, buildPythonPackage
, fetchPypi
, lib
, msrest
, msrestazure
}:

buildPythonPackage rec {
pname = "azure-mgmt-frontdoor";
version = "1.0.1";

src = fetchPypi {
inherit pname version;
extension = "zip";
sha256 = "sha256-nJXQ/BpyOwmybNUqE4cBxq5xxZE56lqgHSTKZTIHIuU=";
};

propagatedBuildInputs = [
msrest
msrestazure
azure-common
azure-mgmt-core
];

# has no tests
doCheck = false;

pythonImportsCheck = [ "azure.mgmt.frontdoor" ];

meta = with lib; {
description = "Microsoft Azure Front Door Service Client Library for Python";
homepage = "https://github.com/Azure/azure-sdk-for-python";
license = licenses.mit;
maintainers = with maintainers; [ sephi ];
};
}
55 changes: 55 additions & 0 deletions pkgs/development/python-modules/django-pattern-library/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{ beautifulsoup4
, buildPythonPackage
, django
, fetchFromGitHub
, lib
, markdown
, poetry-core
, python
, pyyaml
}:

buildPythonPackage rec {
pname = "django-pattern-library";
version = "1.0.0";
format = "pyproject";

src = fetchFromGitHub {
repo = pname;
owner = "torchbox";
rev = "v${version}";
sha256 = "sha256-V299HpbfNLa9cpVhBfzD41oe95xqh+ktQVMMVvm5Xao=";
};

propagatedBuildInputs = [
django
pyyaml
markdown
];

postPatch = ''
substituteInPlace pyproject.toml \
--replace poetry.masonry.api poetry.core.masonry.api
'';

nativeBuildInputs = [ poetry-core ];

checkInputs = [
beautifulsoup4
];

checkPhase = ''
export DJANGO_SETTINGS_MODULE=tests.settings.dev
${python.interpreter} -m django test
'';

pythonImportsCheck = [ "pattern_library" ];

meta = with lib; {
description = "UI pattern libraries for Django templates";
homepage = "https://github.com/torchbox/django-pattern-library/";
changelog = "https://github.com/torchbox/django-pattern-library/blob/v${version}/CHANGELOG.md";
license = licenses.bsd3;
maintainers = with maintainers; [ sephi ];
};
}
45 changes: 45 additions & 0 deletions pkgs/development/python-modules/draftjs-exporter/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{ beautifulsoup4
, buildPythonPackage
, fetchFromGitHub
, html5lib
, lib
, lxml
, python
}:

buildPythonPackage rec {
pname = "draftjs-exporter";
version = "2.1.7";

src = fetchFromGitHub {
repo = "draftjs_exporter";
owner = "springload";
rev = "v${version}";
sha256 = "sha256-tw0r9RnQdIwcY+pqnW8fcV0o2LzmxW0MZPn5drNgK80=";
};

passthru.optional-dependencies = {
lxml = [ lxml ];
html5lib = [ beautifulsoup4 html5lib ];
};

checkInputs = passthru.optional-dependencies.lxml ++ passthru.optional-dependencies.html5lib;

checkPhase = ''
# 2 tests in this file randomly fail because they depend on the order of
# HTML attributes
rm tests/test_exports.py
${python.interpreter} -m unittest discover
'';

pythonImportsCheck = [ "draftjs_exporter" ];

meta = with lib; {
description = "Library to convert Draft.js ContentState to HTML";
homepage = "https://github.com/springload/draftjs_exporter";
changelog = "https://github.com/springload/draftjs_exporter/blob/v${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ sephi ];
};
}
30 changes: 30 additions & 0 deletions pkgs/development/python-modules/l18n/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ buildPythonPackage
, django
, fetchFromGitHub
, fetchPypi
, lib
, pytz
, six
}:

buildPythonPackage rec {
pname = "l18n";
version = "2021.3";

src = fetchPypi {
inherit pname version;
sha256 = "sha256-GVbokNZz0XE1zCCRMlPBVPa8HAAmbCK31QPMGlpC2Eg=";
};

propagatedBuildInputs = [ pytz six ];

pythonImportsCheck = [ "l18n" ];

meta = with lib; {
description = "Locale internationalization package";
homepage = "https://github.com/tkhyn/l18n";
changelog = "https://github.com/tkhyn/l18n/blob/${version}/CHANGES.rst";
license = licenses.mit;
maintainers = with maintainers; [ sephi ];
};
}
39 changes: 39 additions & 0 deletions pkgs/development/python-modules/permissionedforms/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{ buildPythonPackage
, django
, django-modelcluster
, fetchFromGitHub
, lib
, python
}:

buildPythonPackage rec {
pname = "permissionedforms";
version = "0.1";

src = fetchFromGitHub {
repo = "django-permissionedforms";
owner = "wagtail";
rev = "v${version}";
sha256 = "sha256-DQzPGmh5UEVpGWnW3IrEVPkZZ8mdiW9J851Ej4agTDc=";
};

propagatedBuildInputs = [
django
];

checkInputs = [ django-modelcluster ];

checkPhase = ''
${python.interpreter} runtests.py
'';

pythonImportsCheck = [ "permissionedforms" ];

meta = with lib; {
description = "A Django extension for creating forms that vary according to user permissions";
homepage = "https://github.com/wagtail/permissionedforms";
changelog = "https://github.com/wagtail/permissionedforms/blob/v${version}/CHANGELOG.md";
license = licenses.bsd3;
maintainers = with maintainers; [ sephi ];
};
}
34 changes: 34 additions & 0 deletions pkgs/development/python-modules/telepath/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{ buildPythonPackage
, django
, fetchFromGitHub
, lib
, python
}:

buildPythonPackage rec {
pname = "telepath";
version = "0.3";

src = fetchFromGitHub {
repo = "telepath";
owner = "wagtail";
rev = "v${version}";
sha256 = "sha256-kfEAYCXbK0HTf1Gut/APkpw2krMa6C6mU/dJ0dsqzS0=";
};

checkInputs = [ django ];

checkPhase = ''
${python.interpreter} -m django test --settings=telepath.test_settings
'';

pythonImportsCheck = [ "telepath" ];

meta = with lib; {
description = "A library for exchanging data between Python and JavaScript";
homepage = "https://github.com/wagtail/telepath";
changelog = "https://github.com/wagtail/telepath/blob/v${version}/CHANGELOG.md";
license = licenses.bsd3;
maintainers = with maintainers; [ sephi ];
};
}
38 changes: 38 additions & 0 deletions pkgs/development/python-modules/wagtail-factories/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{ buildPythonPackage
, callPackage
, factory_boy
, fetchFromGitHub
, lib
, wagtail
}:

buildPythonPackage rec {
pname = "wagtail-factories";
version = "4.0.0";

src = fetchFromGitHub {
repo = pname;
owner = "wagtail";
rev = version;
sha256 = "sha256-JmFWf+TODQNsSSxYD/JYVhWc82o6rJL13j5J23r8J9A=";
};

propagatedBuildInputs = [
factory_boy
wagtail
];

# Tests require wagtail which in turn requires wagtail-factories
# Note that pythonImportsCheck is not used because it requires a Django app
doCheck = false;

passthru.tests.wagtail-factories = callPackage ./tests.nix { };

meta = with lib; {
description = "Factory boy classes for wagtail";
homepage = "https://github.com/wagtail/wagtail-factories";
changelog = "https://github.com/wagtail/wagtail-factories/blob/${version}/CHANGES";
license = licenses.mit;
maintainers = with maintainers; [ sephi ];
};
}
24 changes: 24 additions & 0 deletions pkgs/development/python-modules/wagtail-factories/tests.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ buildPythonPackage
, django-pattern-library
, pytest-django
, pytestCheckHook
, wagtail
, wagtail-factories
}:

buildPythonPackage {
pname = "wagtail-factories-tests";
format = "other";
inherit (wagtail-factories) src version;

dontBuild = true;
dontInstall = true;

checkInputs = [
django-pattern-library
pytestCheckHook
pytest-django
wagtail
wagtail-factories
];
}
59 changes: 59 additions & 0 deletions pkgs/development/python-modules/wagtail-localize/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{ buildPythonPackage
, dj-database-url
, django
, django-rq
, fetchFromGitHub
, flit-core
, freezegun
, google-cloud-translate
, lib
, polib
, python
, typing-extensions
, wagtail
}:

buildPythonPackage rec {
pname = "wagtail-localize";
version = "1.5";
format = "pyproject";

src = fetchFromGitHub {
repo = pname;
owner = "wagtail";
rev = "v${version}";
sha256 = "sha256-aNz4OoUUXWMCahMxuYBxvNWnw7Inxd5svBgwLgoirW8=";
};

propagatedBuildInputs = [
django
wagtail
polib
typing-extensions
];

checkInputs = [
dj-database-url
django-rq
freezegun
google-cloud-translate
];

nativeBuildInputs = [ flit-core ];

passthru.optional-dependencies = {
google = [ google-cloud-translate ];
};

checkPhase = ''
${python.interpreter} testmanage.py test
'';

meta = with lib; {
description = "Translation plugin for Wagtail CMS";
homepage = "https://github.com/wagtail/wagtail-localize";
changelog = "https://github.com/wagtail/wagtail-localize/blob/v${version}/CHANGELOG.md";
license = licenses.bsd3;
maintainers = with maintainers; [ sephi ];
};
}
Loading

0 comments on commit e3652e0

Please sign in to comment.