3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #200114 from SuperSandro2000/changedetection-io

This commit is contained in:
Sandro 2022-11-28 02:54:54 +01:00 committed by GitHub
commit 4991514dbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 68 additions and 72 deletions

View file

@ -138,7 +138,8 @@ in
StateDirectory = mkIf defaultStateDir "changedetection-io";
StateDirectoryMode = mkIf defaultStateDir "0750";
WorkingDirectory = cfg.datastorePath;
Environment = lib.optional (cfg.baseURL != null) "BASE_URL=${cfg.baseURL}"
Environment = [ "HIDE_REFERER=true" ]
++ lib.optional (cfg.baseURL != null) "BASE_URL=${cfg.baseURL}"
++ lib.optional cfg.behindProxy "USE_X_SETTINGS=1"
++ lib.optional cfg.webDriverSupport "WEBDRIVER_URL=http://127.0.0.1:${toString cfg.chromePort}/wd/hub"
++ lib.optional cfg.playwrightSupport "PLAYWRIGHT_DRIVER_URL=ws://127.0.0.1:${toString cfg.chromePort}/?stealth=1&--disable-web-security=true";

View file

@ -1,6 +1,6 @@
{ lib, buildPythonPackage, fetchPypi, isPyPy
, pytest, pytest-cov, pytest-mock, freezegun
, jinja2, future, binaryornot, click, jinja2_time, requests
, jinja2, future, binaryornot, click, jinja2-time, requests
, python-slugify
, pyyaml
}:
@ -23,7 +23,7 @@ buildPythonPackage rec {
jinja2
click
pyyaml
jinja2_time
jinja2-time
python-slugify
requests
];

View file

@ -1,25 +1,40 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, arrow
, freezegun
, jinja2
, pytestCheckHook
}:
buildPythonPackage rec {
version = "0.2.0";
pname = "jinja2-time";
version = "0.2.0";
src = fetchPypi {
inherit pname version;
sha256 = "0h0dr7cfpjnjj8bgl2vk9063a53649pn37wnlkd8hxjy656slkni";
};
patches = [
# fix usage of arrow in tests
(fetchpatch {
url = "https://github.com/hackebrot/jinja2-time/pull/19/commits/3b2476c266ba53262352153104ca3501722823a4.patch";
sha256 = "sha256-zh4PpAj2GtpgaEap/Yvu6DNY84AwH/YTJlUPRRHPyTs=";
})
];
propagatedBuildInputs = [ arrow jinja2 ];
checkInputs = [ freezegun pytestCheckHook ];
pythonImportsCheck = [ "jinja2_time" ];
meta = with lib; {
homepage = "https://github.com/hackebrot/jinja2-time";
description = "Jinja2 Extension for Dates and Times";
license = licenses.mit;
maintainers = with maintainers; [ ];
};
}

View file

@ -1,12 +1,14 @@
{ buildPythonPackage, fetchPypi, lib, jq }:
{ lib, buildPythonPackage, fetchFromGitHub, cython, jq, pytestCheckHook }:
buildPythonPackage rec {
pname = "jq";
version = "1.2.3";
version = "1.3.0";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-15bXqaa6c6RMoHKqUAcOhPrhMBbqYHrDdnZAaFaHElc=";
src = fetchFromGitHub {
owner = "mwilliamson";
repo = "jq.py";
rev = version;
sha256 = "sha256-1EQm5ShjFHbO1IO5QD42fsGHFGDBrJulLrcl+WeU7wo=";
};
patches = [
@ -14,10 +16,18 @@ buildPythonPackage rec {
./jq-py-setup.patch
];
nativeBuildInputs = [ cython ];
buildInputs = [ jq ];
# no tests executed
doCheck = false;
preBuild = ''
cython jq.pyx
'';
checkInputs = [
pytestCheckHook
];
pythonImportsCheck = [ "jq" ];
meta = {

View file

@ -1,17 +1,8 @@
From bef841b73ba7c9a79211146798ac888fce9bb55a Mon Sep 17 00:00:00 2001
From: "Robert T. McGibbon" <rmcgibbo@gmail.com>
Date: Fri, 7 May 2021 19:14:20 -0400
Subject: [PATCH 1/1] Vastly simplify setup.py for distro compatibility
---
setup.py | 98 +-------------------------------------------------------
1 file changed, 1 insertion(+), 97 deletions(-)
diff --git a/setup.py b/setup.py
index 663792c..3ebcabe 100644
index 01cc813..15e9048 100644
--- a/setup.py
+++ b/setup.py
@@ -1,113 +1,19 @@
@@ -1,97 +1,18 @@
#!/usr/bin/env python
import os
@ -20,50 +11,42 @@ index 663792c..3ebcabe 100644
-import shutil
-import sysconfig
-import requests
from setuptools import setup
-from setuptools.command.build_ext import build_ext
from setuptools.extension import Extension
-def urlretrieve(source_url, destination_path):
- response = requests.get(source_url, stream=True)
- if response.status_code != 200:
- raise Exception("status code was: {}".format(response.status_code))
-
- with open(destination_path, "wb") as fileobj:
- for chunk in response.iter_content(chunk_size=128):
- fileobj.write(chunk)
-
-def path_in_dir(relative_path):
-def _path_in_dir(relative_path):
- return os.path.abspath(os.path.join(os.path.dirname(__file__), relative_path))
-
-def dependency_path(relative_path):
- return os.path.join(path_in_dir("_deps"), relative_path)
-def _dep_source_path(relative_path):
- return os.path.join(_path_in_dir("deps"), relative_path)
-
def read(fname):
-def _dep_build_path(relative_path):
- return os.path.join(_path_in_dir("_deps/build"), relative_path)
-
def _read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
-jq_lib_tarball_path = dependency_path("jq-lib-1.6.tar.gz")
-jq_lib_dir = dependency_path("jq-1.6")
-jq_lib_tarball_path = _dep_source_path("jq-1.6.tar.gz")
-jq_lib_dir = _dep_build_path("jq-1.6")
-
-oniguruma_version = "6.9.4"
-oniguruma_lib_tarball_path = dependency_path("onig-{}.tar.gz".format(oniguruma_version))
-oniguruma_lib_build_dir = dependency_path("onig-{}".format(oniguruma_version))
-oniguruma_lib_install_dir = dependency_path("onig-install-{}".format(oniguruma_version))
-oniguruma_lib_tarball_path = _dep_source_path("onig-{}.tar.gz".format(oniguruma_version))
-oniguruma_lib_build_dir = _dep_build_path("onig-{}".format(oniguruma_version))
-oniguruma_lib_install_dir = _dep_build_path("onig-install-{}".format(oniguruma_version))
-
-class jq_build_ext(build_ext):
- def run(self):
- if not os.path.exists(dependency_path(".")):
- os.makedirs(dependency_path("."))
- if not os.path.exists(_dep_build_path(".")):
- os.makedirs(_dep_build_path("."))
- self._build_oniguruma()
- self._build_libjq()
- build_ext.run(self)
-
- def _build_oniguruma(self):
- self._build_lib(
- source_url="https://github.com/kkos/oniguruma/releases/download/v{0}/onig-{0}.tar.gz".format(oniguruma_version),
- tarball_path=oniguruma_lib_tarball_path,
- lib_dir=oniguruma_lib_build_dir,
- commands=[
@ -75,7 +58,6 @@ index 663792c..3ebcabe 100644
-
- def _build_libjq(self):
- self._build_lib(
- source_url="https://github.com/stedolan/jq/releases/download/jq-1.6/jq-1.6.tar.gz",
- tarball_path=jq_lib_tarball_path,
- lib_dir=jq_lib_dir,
- commands=[
@ -83,9 +65,8 @@ index 663792c..3ebcabe 100644
- ["make"],
- ])
-
- def _build_lib(self, source_url, tarball_path, lib_dir, commands):
- self._download_tarball(
- source_url=source_url,
- def _build_lib(self, tarball_path, lib_dir, commands):
- self._extract_tarball(
- tarball_path=tarball_path,
- lib_dir=lib_dir,
- )
@ -101,16 +82,10 @@ index 663792c..3ebcabe 100644
- for command in commands:
- run_command(command)
-
- def _download_tarball(self, source_url, tarball_path, lib_dir):
- if os.path.exists(tarball_path):
- os.unlink(tarball_path)
- print("Downloading {}".format(source_url))
- urlretrieve(source_url, tarball_path)
- print("Downloaded {}".format(source_url))
-
- def _extract_tarball(self, tarball_path, lib_dir):
- if os.path.exists(lib_dir):
- shutil.rmtree(lib_dir)
- tarfile.open(tarball_path, "r:gz").extractall(dependency_path("."))
- tarfile.open(tarball_path, "r:gz").extractall(_dep_build_path("."))
-
-
jq_extension = Extension(
@ -126,19 +101,11 @@ index 663792c..3ebcabe 100644
)
setup(
@@ -120,7 +26,6 @@ setup(
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
@@ -104,7 +25,6 @@ def _extract_tarball(self, tarball_path, lib_dir):
python_requires='>=3.5',
license='BSD 2-Clause',
ext_modules = [jq_extension],
- cmdclass={"build_ext": jq_build_ext},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
@@ -137,4 +42,3 @@ setup(
'Programming Language :: Python :: 3.9',
],
)
-
--
2.29.3

View file

@ -31,21 +31,21 @@ let
in
py.pkgs.buildPythonApplication rec {
pname = "changedetection-io";
version = "0.39.20.4";
version = "0.39.21.1";
format = "setuptools";
src = fetchFromGitHub {
owner = "dgtlmoon";
repo = "changedetection.io";
rev = version;
sha256 = "sha256-XhCByQbGWAwWe71jsitpYJnQ2xRIdmhc9mY6Smxmp3w=";
sha256 = "sha256-cX2HwlsWOJ34msEnPP38jq+kzSxOM/spe0Ja2lZ/Q7w=";
};
postPatch = ''
substituteInPlace requirements.txt \
--replace "bs4" "beautifulsoup4" \
--replace "cryptography ~= 3.4" "cryptography" \
--replace "selenium ~= 4.1.0" "selenium"
--replace "cryptography~=3.4" "cryptography" \
--replace "selenium~=4.1.0" "selenium"
'';
propagatedBuildInputs = with py.pkgs; [
@ -58,6 +58,8 @@ py.pkgs.buildPythonApplication rec {
feedgen
flask-login
flask-restful
jinja2
jinja2-time
pytz
brotli
requests

View file

@ -101,6 +101,7 @@ mapAliases ({
ipaddress = throw "ipaddress has been removed because it is no longer required since python 2.7."; # added 2022-05-30
influxgraph = throw "influxgraph has been removed because it is no longer maintained"; # added 2022-07-10
itanium_demangler = itanium-demangler; # added 2022-1017
jinja2_time = jinja2-time; # added 2022-11-07
jupyter_client = jupyter-client; # added 2021-10-15
Keras = keras; # added 2021-11-25
ldap = python-ldap; # added 2022-09-16

View file

@ -4756,7 +4756,7 @@ self: super: with self; {
jinja2_pluralize = callPackage ../development/python-modules/jinja2_pluralize { };
jinja2_time = callPackage ../development/python-modules/jinja2_time { };
jinja2-time = callPackage ../development/python-modules/jinja2-time { };
jira = callPackage ../development/python-modules/jira { };