uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
{ interpreter, lib, gdb, writeText, runCommand }:
|
||||
|
||||
let
|
||||
crashme-py = writeText "crashme.py" ''
|
||||
import ctypes
|
||||
|
||||
def sentinel_foo_bar():
|
||||
ctypes.memset(0, 1, 1)
|
||||
|
||||
sentinel_foo_bar()
|
||||
'';
|
||||
in runCommand "python-gdb" {} ''
|
||||
# test that gdb is able to recover the python stack frame of this segfault
|
||||
${gdb}/bin/gdb -batch -ex 'set debug-file-directory ${interpreter.debug}/lib/debug' \
|
||||
-ex 'source ${interpreter}/share/gdb/libpython.py' \
|
||||
-ex r \
|
||||
-ex py-bt \
|
||||
--args ${interpreter}/bin/python ${crashme-py} | grep 'in sentinel_foo_bar' > /dev/null
|
||||
|
||||
# success.
|
||||
touch $out
|
||||
''
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
"""
|
||||
Python interpreter and environment tests.
|
||||
|
||||
These need to be executed with the standard library unittest.
|
||||
Third party test runners such as pytest cannot be used because
|
||||
that would interfere with the tests.
|
||||
"""
|
||||
|
||||
import platform
|
||||
import sys
|
||||
import unittest
|
||||
import site
|
||||
|
||||
|
||||
ENV = "@env@"
|
||||
INTERPRETER = "@interpreter@"
|
||||
PYTHON_VERSION = "@pythonVersion@"
|
||||
|
||||
IS_VIRTUALENV = @is_virtualenv@
|
||||
IS_VENV = @is_venv@
|
||||
IS_NIXENV = @is_nixenv@
|
||||
IS_PYPY = platform.python_implementation() == "PyPy"
|
||||
|
||||
|
||||
class TestCasePython(unittest.TestCase):
|
||||
|
||||
@unittest.skipIf(IS_PYPY, "Executable is incorrect and needs to be fixed.")
|
||||
def test_interpreter(self):
|
||||
self.assertEqual(sys.executable, INTERPRETER)
|
||||
|
||||
@unittest.skipIf(IS_PYPY, "Prefix is incorrect and needs to be fixed.")
|
||||
def test_prefix(self):
|
||||
self.assertEqual(sys.prefix, ENV)
|
||||
self.assertEqual(sys.prefix, sys.exec_prefix)
|
||||
|
||||
def test_site_prefix(self):
|
||||
self.assertTrue(sys.prefix in site.PREFIXES)
|
||||
|
||||
@unittest.skipIf(IS_PYPY or sys.version_info.major==2, "Python 2 does not have base_prefix")
|
||||
def test_base_prefix(self):
|
||||
if IS_VENV or IS_NIXENV or IS_VIRTUALENV:
|
||||
self.assertNotEqual(sys.prefix, sys.base_prefix)
|
||||
else:
|
||||
self.assertEqual(sys.prefix, sys.base_prefix)
|
||||
|
||||
@unittest.skipIf(sys.version_info.major==3, "sys.real_prefix is only set by virtualenv in case of Python 2.")
|
||||
def test_real_prefix(self):
|
||||
self.assertTrue(hasattr(sys, "real_prefix") == IS_VIRTUALENV)
|
||||
|
||||
def test_python_version(self):
|
||||
self.assertTrue(platform.python_version().startswith(PYTHON_VERSION))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
{ interpreter, writeText, runCommand }:
|
||||
|
||||
let
|
||||
|
||||
python = let
|
||||
packageOverrides = self: super: {
|
||||
typeddep = self.callPackage ./typeddep {};
|
||||
};
|
||||
in interpreter.override {inherit packageOverrides; self = python;};
|
||||
|
||||
pythonEnv = python.withPackages(ps: [
|
||||
ps.typeddep
|
||||
ps.mypy
|
||||
]);
|
||||
|
||||
pythonScript = writeText "myscript.py" ''
|
||||
from typeddep import util
|
||||
s: str = util.echo("hello")
|
||||
print(s)
|
||||
'';
|
||||
|
||||
in runCommand "${interpreter.name}-site-prefix-mypy-test" {} ''
|
||||
${pythonEnv}/bin/mypy ${pythonScript}
|
||||
touch $out
|
||||
''
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ buildPythonPackage, pythonOlder }:
|
||||
|
||||
|
||||
buildPythonPackage {
|
||||
|
||||
pname = "typeddep";
|
||||
version = "1.3.3.7";
|
||||
|
||||
src = ./.;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
from setuptools import setup
|
||||
|
||||
setup(**{
|
||||
'name': 'typeddep',
|
||||
'version': '1.3.3.7',
|
||||
'description': 'Minimal repro to test mypy and site prefixes with Nix',
|
||||
'long_description': None,
|
||||
'author': 'adisbladis',
|
||||
'author_email': 'adisbladis@gmail.com',
|
||||
'maintainer': None,
|
||||
'maintainer_email': None,
|
||||
'url': None,
|
||||
'packages': ['typeddep'],
|
||||
'package_data': {'': ['*']},
|
||||
'install_requires': [],
|
||||
'entry_points': {},
|
||||
'python_requires': '>=3.7,<4.0',
|
||||
})
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
def echo(s: str) -> str:
|
||||
return s
|
||||
Loading…
Add table
Add a link
Reference in a new issue