Merge master into staging-next

This commit is contained in:
Frederik Rietdijk
2020-06-15 08:07:00 +02:00
106 changed files with 1073 additions and 729 deletions

View File

@@ -1,8 +1,11 @@
{ stdenv
, python
, buildPythonPackage
, fetchPypi
, isPy3k
, substituteAll
, pyparsing
, graphviz
, texlive
}:
buildPythonPackage rec {
@@ -14,11 +17,26 @@ buildPythonPackage rec {
sha256 = "1kp77wiv7b5qib82i3y3sn9r49rym43aaqm5aw1bwnzfbbq2m6i9";
};
# Tests fail with 3.x. Furthermore, package is no longer maintained.
disabled = isPy3k;
patches = [
(substituteAll {
src = ./path.patch;
inherit graphviz;
})
./test.patch # https://github.com/kjellmf/dot2tex/issues/5
];
propagatedBuildInputs = [ pyparsing ];
checkInputs = [
(texlive.combine {
inherit (texlive) scheme-small preview pstricks;
})
];
checkPhase = ''
${python.interpreter} tests/test_dot2tex.py
'';
meta = with stdenv.lib; {
description = "Convert graphs generated by Graphviz to LaTeX friendly formats";
homepage = "https://github.com/kjellmf/dot2tex";

View File

@@ -0,0 +1,104 @@
diff --git a/dot2tex/dotparsing.py b/dot2tex/dotparsing.py
index 391b5dc..6dc77a3 100644
--- a/dot2tex/dotparsing.py
+++ b/dot2tex/dotparsing.py
@@ -180,18 +180,8 @@ def __find_executables(path):
def find_graphviz():
"""Locate Graphviz's executables in the system.
- Tries three methods:
-
- First: Windows Registry (Windows only)
- This requires Mark Hammond's pywin32 is installed.
-
- Secondly: Search the path
- It will look for 'dot', 'twopi' and 'neato' in all the directories
- specified in the PATH environment variable.
-
- Thirdly: Default install location (Windows only)
- It will look for 'dot', 'twopi' and 'neato' in the default install
- location under the "Program Files" directory.
+ It will look for 'dot', 'twopi' and 'neato' in
+ @graphviz@/bin.
It will return a dictionary containing the program names as keys
and their paths as values.
@@ -199,75 +189,9 @@ def find_graphviz():
If this fails, it returns None.
"""
- # Method 1 (Windows only)
- #
- if os.sys.platform == 'win32':
- try:
- import win32api, win32con
-
- # Get the GraphViz install path from the registry
- #
- hkey = win32api.RegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE,
- "SOFTWARE\AT&T Research Labs\Graphviz", 0, win32con.KEY_QUERY_VALUE)
-
- path = win32api.RegQueryValueEx(hkey, "InstallPath")[0]
- win32api.RegCloseKey(hkey)
-
- # Now append the "bin" subdirectory:
- #
- path = os.path.join(path, "bin")
- progs = __find_executables(path)
- if progs is not None:
- # print("Used Windows registry")
- return progs
-
- except ImportError:
- # Print a messaged suggesting they install these?
- #
- log.debug('The win32api is not installed')
- pass
- except:
- log.debug('Failed to access the registry key')
-
- # Method 2 (Linux, Windows etc)
- #
- if 'PATH' in os.environ:
- for path in os.environ['PATH'].split(os.pathsep):
- progs = __find_executables(path)
- if progs is not None:
- return progs
-
- # Method 3 (Windows only)
- #
- if os.sys.platform == 'win32':
- # Try and work out the equivalent of "C:\Program Files" on this
- # machine (might be on drive D:, or in a different language)
- #
- if 'PROGRAMFILES' in os.environ:
- # Note, we could also use the win32api to get this
- # information, but win32api may not be installed.
-
- path = os.path.join(os.environ['PROGRAMFILES'], 'ATT', 'GraphViz', 'bin')
-
- else:
- # Just in case, try the default...
- path = r"C:\Program Files\att\Graphviz\bin"
-
- progs = __find_executables(path)
-
- if progs is not None:
- # print("Used default install location")
- return progs
-
- for path in (
- '/usr/bin', '/usr/local/bin',
- '/opt/local/bin',
- '/opt/bin', '/sw/bin', '/usr/share',
- '/Applications/Graphviz.app/Contents/MacOS/'):
- progs = __find_executables(path)
- if progs is not None:
- # print("Used path")
- return progs
+ progs = __find_executables('@graphviz@/bin')
+ if progs is not None:
+ return progs
# Failed to find GraphViz
#

View File

@@ -0,0 +1,12 @@
diff --git a/tests/test_dot2tex.py b/tests/test_dot2tex.py
index 74b01ed..7be9aba 100644
--- a/tests/test_dot2tex.py
+++ b/tests/test_dot2tex.py
@@ -147,6 +147,7 @@ class NeedsQuotesTests(unittest.TestCase):
class MultipleStatements(unittest.TestCase):
# https://github.com/kjellmf/dot2tex/issues/5
+ @unittest.skip('fails upstream')
def test_semicolon(self):
"""Test for issue 5"""
testgraph1 = """

View File

@@ -0,0 +1,22 @@
{ stdenv, fetchPypi, buildPythonPackage, six, pytest }:
buildPythonPackage rec {
pname = "fake-useragent";
version = "0.1.11";
src = fetchPypi {
inherit pname version;
sha256 = "0dfz3bpmjmaxlhda6hfgsac7afb65pljibi8zkp9gc0ffn5rj161";
};
propagatedBuildInputs = [ six ];
checkInputs = [ pytest ];
meta = with stdenv.lib; {
description = "Up to date simple useragent faker with real world database";
homepage = "https://github.com/hellysmile/fake-useragent";
license = licenses.asl20;
maintainers = with maintainers; [ evanjs ];
};
}

View File

@@ -0,0 +1,21 @@
{ stdenv, buildPythonPackage, isPy27, fetchPypi }:
buildPythonPackage rec {
pname = "libevdev";
version = "0.7";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "10gwj08kn2rs4waq7807mq34cbavgkpg8fpir8mvnba601b8q4r4";
};
doCheck = false;
meta = with stdenv.lib; {
description = "Python wrapper around the libevdev C library";
homepage = "https://gitlab.freedesktop.org/libevdev/python-libevdev";
license = licenses.mit;
maintainers = with maintainers; [ nickhu ];
};
}

View File

@@ -0,0 +1,25 @@
{ stdenv, buildPythonPackage, fetchPypi, sphinx, setuptools-lint, xlib }:
buildPythonPackage rec {
pname = "pynput";
version = "1.6.8";
src = fetchPypi {
inherit pname version;
sha256 = "16h4wn7f54rw30jrya7rmqkx3f51pxn8cplid95v880md8yqdhb8";
};
nativeBuildInputs = [ sphinx ];
propagatedBuildInputs = [ setuptools-lint xlib ];
doCheck = false;
meta = with stdenv.lib; {
description = "A library to control and monitor input devices";
homepage = "https://github.com/moses-palmer/pynput";
license = licenses.lgpl3;
maintainers = with maintainers; [ nickhu ];
};
}

View File

@@ -0,0 +1,22 @@
{ stdenv, fetchPypi, buildPythonPackage, pytest, scrapy, bsddb3 }:
buildPythonPackage rec {
pname = "scrapy-deltafetch";
version = "1.2.1";
src = fetchPypi {
inherit pname version;
sha256 = "1m511psddvlapg492ny36l8rzy7z4i39yx6a1agxzfz6s9b83fq8";
};
propagatedBuildInputs = [ bsddb3 scrapy ];
checkInputs = [ pytest ];
meta = with stdenv.lib; {
description = "Scrapy spider middleware to ignore requests to pages containing items seen in previous crawls";
homepage = "https://github.com/scrapy-plugins/scrapy-deltafetch";
license = licenses.bsd3;
maintainers = with maintainers; [ evanjs ];
};
}

View File

@@ -0,0 +1,21 @@
{ stdenv, fetchPypi, buildPythonPackage, pytest, fake-useragent, scrapy }:
buildPythonPackage rec {
pname = "scrapy-fake-useragent";
version = "1.2.0";
src = fetchPypi {
inherit pname version;
sha256 = "02mayk804vdl15wjpx7jcjkc4zgrra4izf6iv00mcxq4fd4ck03l";
};
propagatedBuildInputs = [ fake-useragent ];
checkInputs = [ pytest scrapy ];
meta = with stdenv.lib; {
description = "Random User-Agent middleware based on fake-useragent";
homepage = "https://github.com/alecxe/scrapy-fake-useragent";
license = licenses.bsd3;
};
}

View File

@@ -0,0 +1,20 @@
{ stdenv, fetchPypi, buildPythonPackage, pytest, hypothesis, scrapy }:
buildPythonPackage rec {
pname = "scrapy-splash";
version = "0.7.2";
src = fetchPypi {
inherit pname version;
sha256 = "1dg7csdza2hzqskd9b9gx0v3saqsch4f0fwdp0a3p0822aqqi488";
};
checkInputs = [ pytest hypothesis scrapy ];
meta = with stdenv.lib; {
description = "Scrapy+Splash for JavaScript integration";
homepage = "https://github.com/scrapy-plugins/scrapy-splash";
license = licenses.bsd3;
maintainers = with maintainers; [ evanjs ];
};
}

View File

@@ -0,0 +1,35 @@
{ stdenv, buildPythonApplication, fetchPypi, isPy36, dataclasses, libX11, libXinerama, libXrandr }:
buildPythonApplication rec {
pname = "screeninfo";
version = "0.6.5";
src = fetchPypi {
inherit pname version;
sha256 = "0vcw54crdgmbzwlrfg80kd1a8p9i10yks8k0szzi0k5q80zhp8xz";
};
# dataclasses is a compatibility shim for python 3.6 ONLY
patchPhase = if isPy36 then "" else ''
substituteInPlace setup.py \
--replace "\"dataclasses\"," ""
'' + ''
substituteInPlace screeninfo/enumerators/xinerama.py \
--replace "load_library(\"X11\")" "ctypes.cdll.LoadLibrary(\"${libX11}/lib/libX11.so\")" \
--replace "load_library(\"Xinerama\")" "ctypes.cdll.LoadLibrary(\"${libXinerama}/lib/libXinerama.so\")"
substituteInPlace screeninfo/enumerators/xrandr.py \
--replace "load_library(\"X11\")" "ctypes.cdll.LoadLibrary(\"${libX11}/lib/libX11.so\")" \
--replace "load_library(\"Xrandr\")" "ctypes.cdll.LoadLibrary(\"${libXrandr}/lib/libXrandr.so\")"
'';
propagatedBuildInputs = stdenv.lib.optional isPy36 dataclasses;
buildInputs = [ libX11 libXinerama libXrandr];
meta = with stdenv.lib; {
description = "Fetch location and size of physical screens";
homepage = "https://github.com/rr-/screeninfo";
license = licenses.mit;
maintainers = [ maintainers.nickhu ];
};
}

View File

@@ -0,0 +1,21 @@
{ stdenv, buildPythonPackage, fetchPypi, pylint }:
buildPythonPackage rec {
pname = "setuptools-lint";
version = "0.6.0";
src = fetchPypi {
inherit pname version;
sha256 = "16a1ac5n7k7sx15cnk03gw3fmslab3a7m74dc45rgpldgiff3577";
};
propagatedBuildInputs = [ pylint ];
meta = with stdenv.lib; {
description = "Package to expose pylint as a lint command into setup.py";
homepage = "https://github.com/johnnoone/setuptools-pylint";
license = licenses.bsdOriginal;
maintainers = with maintainers; [ nickhu ];
};
}

View File

@@ -2,14 +2,14 @@
buildPythonPackage rec {
pname = "SoMaJo";
version = "2.0.5";
version = "2.0.6";
disabled = !isPy3k;
src = fetchFromGitHub {
owner = "tsproisl";
repo = pname;
rev = "v${version}";
sha256 = "01zvmqilnndh2b257z7bhcc7av5vhjm1g8gmdiiw15gcd2xfmqjs";
sha256 = "08nicj3nj6pi6djli26gf0kf3s2da9ysn1cpkyw7j88v8vav0p7s";
};
propagatedBuildInputs = [ regex ];