Merge pull request #207420 from sephii/new-python-packages

New python packages batch
This commit is contained in:
Fabian Affolter 2023-01-10 17:51:25 +01:00 committed by GitHub
commit 07ef577ced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 419 additions and 2 deletions

View File

@ -12730,6 +12730,15 @@
githubId = 893474;
name = "Stefan Wiehler";
};
sephi = {
name = "Sylvain Fankhauser";
email = "sephi@fhtagn.top";
github = "sephii";
githubId = 754333;
keys = [{
fingerprint = "2A9D 8E76 5EE2 237D 7B6B A2A5 4228 AB9E C061 2ADA";
}];
};
sepi = {
email = "raffael@mancini.lu";
github = "sepi";

View File

@ -0,0 +1,38 @@
{ lib
, buildPythonPackage
, django_4
, fetchPypi
, pythonOlder
}:
buildPythonPackage rec {
pname = "django-admin-sortable2";
version = "2.1.4";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit version pname;
sha256 = "sha256-fcCP8PvOWFlQL4CdEIwElfOw2UYJJp6u27EjfgMISss=";
};
propagatedBuildInputs = [
django_4
];
pythonImportsCheck = [
"adminsortable2"
];
# Tests are very slow (end-to-end with playwright)
doCheck = false;
meta = with lib; {
description = "Generic drag-and-drop ordering for objects in the Django admin interface";
homepage = "https://github.com/jrief/django-admin-sortable2";
changelog = "https://github.com/jrief/django-admin-sortable2/blob/${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ sephi ];
};
}

View File

@ -0,0 +1,55 @@
{ lib
, buildPythonPackage
, chardet
, diff-match-patch
, django
, fetchFromGitHub
, python
, pythonOlder
, pytz
, tablib
}:
buildPythonPackage rec {
pname = "django-import-export";
version = "2.8.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "django-import-export";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-km6TQq4OZZtx9/lgBzS3tEifAYjkkUX//9FRATDLX/0=";
};
propagatedBuildInputs = [
diff-match-patch
django
tablib
] ++ (with tablib.optional-dependencies; html ++ ods ++ xls ++ xlsx ++ yaml);
checkInputs = [
chardet
pytz
];
checkPhase = ''
runHook preCheck
${python.interpreter} tests/manage.py test core --settings=settings
runHook postCheck
'';
pythonImportsCheck = [
"import_export"
];
meta = with lib; {
description = "Django application and library for importing and exporting data with admin integration";
homepage = "https://github.com/django-import-export/django-import-export";
changelog = "https://github.com/django-import-export/django-import-export/blob/${version}/docs/changelog.rst";
license = licenses.bsd2;
maintainers = with maintainers; [ sephi ];
};
}

View File

@ -0,0 +1,58 @@
{ lib
, babel
, buildPythonPackage
, django
, djangorestframework
, fetchFromGitHub
, phonenumbers
, python
, pythonOlder
, setuptools-scm
}:
buildPythonPackage rec {
pname = "django-phonenumber-field";
version = "6.4.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "stefanfoulis";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-rrJTCWn1mFV4QQu8wyLDxheHkZQ/FIE7mRC/9nXNSaM=";
};
SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [
setuptools-scm
];
propagatedBuildInputs = [
django
phonenumbers
babel
];
checkInputs = [
djangorestframework
];
pythonImportsCheck = [
"phonenumber_field"
];
checkPhase = ''
${python.interpreter} -m django test --settings tests.settings
'';
meta = with lib; {
description = "A django model and form field for normalised phone numbers using python-phonenumbers";
homepage = "https://github.com/stefanfoulis/django-phonenumber-field/";
changelog = "https://github.com/stefanfoulis/django-phonenumber-field/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ sephi ];
};
}

View File

@ -0,0 +1,53 @@
{ lib
, buildPythonPackage
, django
, djangorestframework
, fetchFromGitHub
, pytest-django
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "django-rest-registration";
version = "0.7.3";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "apragacz";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-JoIeVjl5s60ilq9kU28Jo+GaYRKU61hoqy1GzYmMdZQ=";
};
propagatedBuildInputs = [
django
djangorestframework
];
checkInputs = [
pytestCheckHook
pytest-django
];
pythonImportsCheck = [
"rest_registration"
];
disabledTests = [
# This test fails on Python 3.10
"test_convert_html_to_text_fails"
# This test is broken and was removed after 0.7.3. Remove this line once version > 0.7.3
"test_coreapi_autoschema_success"
];
meta = with lib; {
description = "User-related REST API based on the awesome Django REST Framework";
homepage = "https://github.com/apragacz/django-rest-registration/";
changelog = "https://github.com/apragacz/django-rest-registration/releases/tag/${version}";
license = licenses.mit;
maintainers = with maintainers; [ sephi ];
};
}

View File

@ -0,0 +1,40 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, django
, pythonOlder
}:
buildPythonPackage rec {
pname = "django-vite";
version = "2.0.2";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "MrBin99";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-lYRFNHTIQBn7CDnWFxSzXELzqEtQcbwHedSZnR7ZtbE=";
};
propagatedBuildInputs = [
django
];
# Package doesnt have any tests
doCheck = false;
pythonImportsCheck = [
"django_vite"
];
meta = with lib; {
description = "Integration of ViteJS in a Django project";
homepage = "https://github.com/MrBin99/django-vite";
changelog = "https://github.com/MrBin99/django-vite/releases/tag/${version}";
license = licenses.asl20;
maintainers = with maintainers; [ sephi ];
};
}

View File

@ -0,0 +1,24 @@
{ lib, fetchPypi, buildPythonPackage }:
buildPythonPackage rec {
pname = "markuppy";
version = "1.14";
src = fetchPypi {
pname = "MarkupPy";
inherit version;
sha256 = "sha256-Gt7iwKVCrzeP6EVI/29rAWjzy39Ca0aWEDiivPqtDV8=";
};
# has no tests
doCheck = false;
pythonImportsCheck = [ "MarkupPy" ];
meta = with lib; {
description = "An HTML/XML generator";
homepage = "https://github.com/tylerbakke/MarkupPy";
license = licenses.mit;
maintainers = with maintainers; [ sephi ];
};
}

View File

@ -193,6 +193,8 @@ buildPythonPackage rec {
ln -s ${driver} $out/${python.sitePackages}/playwright/driver
'';
SETUPTOOLS_SCM_PRETEND_VERSION = version;
# Skip tests because they require network access.
doCheck = false;

View File

@ -0,0 +1,58 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, poetry-core
, pytest
, pytest-localserver
, requests
, pytestCheckHook
, pythonOlder
}:
buildPythonPackage rec {
pname = "pytest-base-url";
version = "2.0.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "pytest-dev";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-v6pLejWNeb9Do6x2EJqmLKj8DNqcMtmYIs+7iDYsbjk=";
};
nativeBuildInputs = [
poetry-core
];
buildInputs = [
pytest
];
propagatedBuildInputs = [
requests
];
checkInputs = [
pytestCheckHook
pytest-localserver
];
pytestFlagsArray = [
"tests"
];
pythonImportsCheck = [
"pytest_base_url"
];
meta = with lib; {
description = "pytest plugin for URL based tests";
homepage = "https://github.com/pytest-dev/pytest-base-url";
changelog = "https://github.com/pytest-dev/pytest-base-url/blob/v${version}/CHANGES.rst";
license = licenses.mpl20;
maintainers = with maintainers; [ sephi ];
};
}

View File

@ -0,0 +1,63 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, playwright
, pytest
, pytest-base-url
, pytestCheckHook
, python-slugify
, pythonOlder
, setuptools-scm
, django
}:
buildPythonPackage rec {
pname = "pytest-playwright";
version = "0.3.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "microsoft";
repo = "playwright-pytest";
rev = "refs/tags/v${version}";
hash = "sha256-fHzQxbQBSEkCFu/ualjzSmIt3SiEa2ktTvIJKPZLT9Q=";
};
SETUPTOOLS_SCM_PRETEND_VERSION = version;
nativeBuildInputs = [
setuptools-scm
];
buildInputs = [
pytest
];
propagatedBuildInputs = [
playwright
pytest-base-url
python-slugify
];
# Most of the tests rely on network access, or on unavailable browsers such as
# msedge, chrome or webkit
doCheck = false;
preCheck = ''
export PLAYWRIGHT_BROWSERS_PATH=${playwright.browsers}
'';
pythonImportsCheck = [
"pytest_playwright"
];
meta = with lib; {
description = "Pytest plugin to write end-to-end browser tests with Playwright";
homepage = "https://github.com/microsoft/playwright-pytest";
changelog = "https://github.com/microsoft/playwright-pytest/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ sephi ];
};
}

View File

@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
, markuppy
, odfpy
, openpyxl
, pandas
@ -37,7 +38,7 @@ buildPythonPackage rec {
passthru.optional-dependencies = {
all = [
# markuppy
markuppy
odfpy
openpyxl
pandas
@ -50,7 +51,7 @@ buildPythonPackage rec {
tabulate
];
html = [
# markuppy
markuppy
];
ods = [
odfpy

View File

@ -2473,6 +2473,8 @@ self: super: with self; {
# Current latest
django_4 = callPackage ../development/python-modules/django/4.nix { };
django-admin-sortable2 = callPackage ../development/python-modules/django-admin-sortable2 { };
django-allauth = callPackage ../development/python-modules/django-allauth { };
django-anymail = callPackage ../development/python-modules/django-anymail { };
@ -2548,6 +2550,8 @@ self: super: with self; {
django_hijack = callPackage ../development/python-modules/django-hijack { };
# This package may need an older version of Django. Override the package set and set e.g. `django = super.django_1_9`. See the Nixpkgs manual for examples on how to override the package set.
django-import-export = callPackage ../development/python-modules/django-import-export { };
django-ipware = callPackage ../development/python-modules/django-ipware { };
django-jinja = callPackage ../development/python-modules/django-jinja2 { };
@ -2580,6 +2584,8 @@ self: super: with self; {
django-pglocks = callPackage ../development/python-modules/django-pglocks { };
django-phonenumber-field = callPackage ../development/python-modules/django-phonenumber-field { };
django-picklefield = callPackage ../development/python-modules/django-picklefield { };
django-polymorphic = callPackage ../development/python-modules/django-polymorphic { };
@ -2606,6 +2612,8 @@ self: super: with self; {
django-rest-polymorphic = callPackage ../development/python-modules/django-rest-polymorphic { };
django-rest-registration = callPackage ../development/python-modules/django-rest-registration { };
django-rq = callPackage ../development/python-modules/django-rq { };
djangorestframework = callPackage ../development/python-modules/djangorestframework { };
@ -2654,6 +2662,8 @@ self: super: with self; {
django-versatileimagefield = callPackage ../development/python-modules/django-versatileimagefield { };
django-vite = callPackage ../development/python-modules/django-vite { };
django-webpack-loader = callPackage ../development/python-modules/django-webpack-loader { };
django-widget-tweaks = callPackage ../development/python-modules/django-widget-tweaks { };
@ -5609,6 +5619,8 @@ self: super: with self; {
markupsafe = callPackage ../development/python-modules/markupsafe { };
markuppy = callPackage ../development/python-modules/markuppy { };
markups = callPackage ../development/python-modules/markups { };
marshmallow = callPackage ../development/python-modules/marshmallow { };
@ -8848,6 +8860,8 @@ self: super: with self; {
pytest-cache = self.pytestcache; # added 2021-01-04
pytestcache = callPackage ../development/python-modules/pytestcache { };
pytest-base-url = callPackage ../development/python-modules/pytest-base-url { };
pytest-cases = callPackage ../development/python-modules/pytest-cases{ };
pytest-catchlog = callPackage ../development/python-modules/pytest-catchlog { };
@ -8948,6 +8962,8 @@ self: super: with self; {
pytest-param-files = callPackage ../development/python-modules/pytest-param-files { };
pytest-playwright = callPackage ../development/python-modules/pytest-playwright {};
pytest-plt = callPackage ../development/python-modules/pytest-plt { };
pytest-pylint = callPackage ../development/python-modules/pytest-pylint { };