diff --git a/pkgs/development/python-modules/monkeytype/default.nix b/pkgs/development/python-modules/monkeytype/default.nix new file mode 100644 index 000000000000..1f24608c8d17 --- /dev/null +++ b/pkgs/development/python-modules/monkeytype/default.nix @@ -0,0 +1,58 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + libcst, + mypy-extensions, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "monkeytype"; + version = "23.3.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "Instagram"; + repo = "MonkeyType"; + rev = "refs/tags/v${version}"; + hash = "sha256-DQ/3go53+0PQkhZcL2dX8MI/z4Iq7kTYd5EbacMNxT4="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + libcst + mypy-extensions + ]; + + pythonImportsCheck = [ + "monkeytype" + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + # Disable broken tests + "test_excludes_site_packages" + "test_callee_throws_recovers" + "test_nested_callee_throws_recovers" + "test_caller_handles_callee_exception" + "test_generator_trace" + "test_return_none" + "test_access_property" + ]; + + meta = { + description = "Python library that generates static type annotations by collecting runtime types"; + homepage = "https://github.com/Instagram/MonkeyType/"; + changelog = "https://github.com/Instagram/MonkeyType/blob/${src.rev}/CHANGES.rst"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/development/python-modules/sotabenchapi/default.nix b/pkgs/development/python-modules/sotabenchapi/default.nix new file mode 100644 index 000000000000..b8a1b0b918da --- /dev/null +++ b/pkgs/development/python-modules/sotabenchapi/default.nix @@ -0,0 +1,52 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, + click, + requests, + tabulate, +}: + +let + version = "0.0.16"; + pname = "sotabenchapi"; +in +buildPythonPackage { + inherit pname version; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-thbVH4aLmEgi8K17PkmbUg4nHqGj+dEiXPDILjvQMzk="; + }; + + # requirements.txt is missing in the Pypi archive and this makes the setup.py script fails + postPatch = '' + touch requirements.txt + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ + click + requests + tabulate + ]; + + pythonImportsCheck = [ + "sotabenchapi" + ]; + + # No tests + doCheck = false; + + meta = { + description = "Easily benchmark Machine Learning models on selected tasks and datasets"; + homepage = "https://pypi.org/project/sotabenchapi/"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/development/python-modules/submitit/default.nix b/pkgs/development/python-modules/submitit/default.nix new file mode 100644 index 000000000000..eb39da57d935 --- /dev/null +++ b/pkgs/development/python-modules/submitit/default.nix @@ -0,0 +1,62 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + cloudpickle, + flit-core, + typing-extensions, + pytestCheckHook, + pytest-asyncio, +}: + +buildPythonPackage rec { + pname = "submitit"; + version = "1.5.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "facebookincubator"; + repo = "submitit"; + rev = "refs/tags/${version}"; + hash = "sha256-PDQLzqQjoBAZM9FKsoRby26Pbh4nik3SltIHUw/xWcY="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + cloudpickle + flit-core + typing-extensions + ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-asyncio + ]; + + pythonImportsCheck = [ + "submitit" + ]; + + disabledTests = [ + # These tests are broken + "test_snapshot" + "test_snapshot_excludes" + "test_job_use_snapshot_cwd" + "test_job_use_snapshot_modules" + "test_nested_pickling" + "test_setup" + "test_requeuing" + ]; + + meta = { + changelog = "https://github.com/facebookincubator/submitit/releases/tag/${version}"; + description = "Python 3.8+ toolbox for submitting jobs to Slurm"; + homepage = "https://github.com/facebookincubator/submitit"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/development/python-modules/torchbench/default.nix b/pkgs/development/python-modules/torchbench/default.nix new file mode 100644 index 000000000000..3593ae792130 --- /dev/null +++ b/pkgs/development/python-modules/torchbench/default.nix @@ -0,0 +1,58 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, + numpy, + opencv4, + sotabenchapi, + torch, + torchvision, + tqdm, +}: + +let + version = "0.0.31"; + pname = "torchbench"; +in +buildPythonPackage { + inherit pname version; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-EBZzcnRT50KREIOPrr/OZTJ4639ZUEejcelh3QSBcZ8="; + }; + + # requirements.txt is missing in the Pypi archive and this makes the setup.py script fails + postPatch = '' + touch requirements.txt + ''; + + build-system = [ + setuptools + ]; + + dependencies = [ + numpy + opencv4 + sotabenchapi + torch + torchvision + tqdm + ]; + + pythonImportsCheck = [ + "torchbench" + ]; + + # No tests + doCheck = false; + + meta = { + description = "Easily benchmark machine learning models in PyTorch"; + homepage = "https://github.com/paperswithcode/torchbench"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ drupol ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6b4ce7eebdcc..1617ac5b9b95 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8151,6 +8151,8 @@ self: super: with self; { monkeyhex = callPackage ../development/python-modules/monkeyhex { }; + monkeytype = callPackage ../development/python-modules/monkeytype { }; + monosat = pkgs.monosat.python { inherit buildPythonPackage; inherit (self) cython pytestCheckHook; @@ -14649,6 +14651,8 @@ self: super: with self; { sortedcontainers = callPackage ../development/python-modules/sortedcontainers { }; + sotabenchapi = callPackage ../development/python-modules/sotabenchapi { }; + soundcard = callPackage ../development/python-modules/soundcard { }; soundcloud-v2 = callPackage ../development/python-modules/soundcloud-v2 { }; @@ -15146,6 +15150,8 @@ self: super: with self; { subliminal = callPackage ../development/python-modules/subliminal { }; + submitit = callPackage ../development/python-modules/submitit { }; + subprocess-tee = callPackage ../development/python-modules/subprocess-tee { }; subunit = callPackage ../development/python-modules/subunit { @@ -15774,6 +15780,8 @@ self: super: with self; { triton = self.triton-bin; }; + torchbench = callPackage ../development/python-modules/torchbench { }; + torchsnapshot = callPackage ../development/python-modules/torchsnapshot { }; torchWithCuda = self.torch.override {