2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, python3
|
2021-05-20 23:08:51 +00:00
|
|
|
, callPackage
|
|
|
|
, recurseIntoAttrs
|
2022-06-16 17:23:12 +00:00
|
|
|
, nixosTests
|
2023-02-09 11:40:11 +00:00
|
|
|
, config
|
2023-11-16 04:20:00 +00:00
|
|
|
, fetchPypi
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# To expose the *srht modules, they have to be a python module so we use `buildPythonModule`
|
|
|
|
# Then we expose them through all-packages.nix as an application through `toPythonApplication`
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/54425#discussion_r250688781
|
|
|
|
let
|
2021-05-20 23:08:51 +00:00
|
|
|
python = python3.override {
|
2020-04-24 23:36:52 +00:00
|
|
|
packageOverrides = self: super: {
|
2023-11-16 04:20:00 +00:00
|
|
|
srht = self.callPackage ./core.nix { };
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildsrht = self.callPackage ./builds.nix { };
|
|
|
|
gitsrht = self.callPackage ./git.nix { };
|
|
|
|
hgsrht = self.callPackage ./hg.nix { };
|
2020-09-25 04:45:31 +00:00
|
|
|
hubsrht = self.callPackage ./hub.nix { };
|
2020-04-24 23:36:52 +00:00
|
|
|
listssrht = self.callPackage ./lists.nix { };
|
|
|
|
mansrht = self.callPackage ./man.nix { };
|
|
|
|
metasrht = self.callPackage ./meta.nix { };
|
|
|
|
pastesrht = self.callPackage ./paste.nix { };
|
|
|
|
todosrht = self.callPackage ./todo.nix { };
|
|
|
|
|
|
|
|
scmsrht = self.callPackage ./scm.nix { };
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
# sourcehut is not (yet) compatible with SQLAlchemy 2.x
|
|
|
|
sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "1.4.46";
|
|
|
|
src = fetchPypi {
|
|
|
|
pname = "SQLAlchemy";
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-aRO4JH2KKS74MVFipRkx4rQM6RaB8bbxj2lwRSAMSjA=";
|
|
|
|
};
|
|
|
|
nativeCheckInputs = with super; [ pytestCheckHook mock ];
|
|
|
|
disabledTestPaths = []
|
|
|
|
# Disable incompatible tests on Darwin.
|
|
|
|
++ lib.optionals stdenv.isDarwin [ "test/aaa_profiling" ];
|
|
|
|
});
|
|
|
|
|
|
|
|
flask-sqlalchemy = super.flask-sqlalchemy.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "2.5.1";
|
|
|
|
format = "setuptools";
|
|
|
|
src = fetchPypi {
|
|
|
|
pname = "Flask-SQLAlchemy";
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-K9pEtD58rLFdTgX/PMH4vJeTbMRkYjQkECv8LDXpWRI=";
|
|
|
|
};
|
|
|
|
propagatedBuildInputs = with self; [
|
|
|
|
flask
|
|
|
|
sqlalchemy
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
# sourcehut is not (yet) compatible with factory-boy 3.x
|
|
|
|
factory-boy = super.factory-boy.overridePythonAttrs (oldAttrs: rec {
|
|
|
|
version = "2.12.0";
|
|
|
|
src = fetchPypi {
|
|
|
|
pname = "factory_boy";
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-+vSNYIoXNfDQo8nL9TbWT5EytUfa57pFLE2Zp56Eo3A=";
|
|
|
|
};
|
|
|
|
nativeCheckInputs = (with super; [
|
|
|
|
django
|
|
|
|
flask
|
|
|
|
mongoengine
|
|
|
|
pytestCheckHook
|
|
|
|
]) ++ (with self; [
|
|
|
|
sqlalchemy
|
|
|
|
flask-sqlalchemy
|
|
|
|
]);
|
|
|
|
postPatch = "";
|
|
|
|
});
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
};
|
2021-05-20 23:08:51 +00:00
|
|
|
in
|
2023-02-09 11:40:11 +00:00
|
|
|
with python.pkgs; recurseIntoAttrs ({
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit python;
|
2021-06-06 07:54:09 +00:00
|
|
|
coresrht = toPythonApplication srht;
|
2020-04-24 23:36:52 +00:00
|
|
|
buildsrht = toPythonApplication buildsrht;
|
|
|
|
gitsrht = toPythonApplication gitsrht;
|
|
|
|
hgsrht = toPythonApplication hgsrht;
|
2020-09-25 04:45:31 +00:00
|
|
|
hubsrht = toPythonApplication hubsrht;
|
2020-04-24 23:36:52 +00:00
|
|
|
listssrht = toPythonApplication listssrht;
|
|
|
|
mansrht = toPythonApplication mansrht;
|
|
|
|
metasrht = toPythonApplication metasrht;
|
2022-11-02 22:02:43 +00:00
|
|
|
pagessrht = callPackage ./pages.nix { };
|
2020-04-24 23:36:52 +00:00
|
|
|
pastesrht = toPythonApplication pastesrht;
|
|
|
|
todosrht = toPythonApplication todosrht;
|
2022-06-16 17:23:12 +00:00
|
|
|
passthru.tests = {
|
|
|
|
nixos-sourcehut = nixosTests.sourcehut;
|
|
|
|
};
|
2023-02-09 11:40:11 +00:00
|
|
|
} // lib.optionalAttrs config.allowAliases {
|
|
|
|
# Added 2022-10-29
|
|
|
|
dispatchsrht = throw "dispatch is deprecated. See https://sourcehut.org/blog/2022-08-01-dispatch-deprecation-plans/ for more information.";
|
|
|
|
})
|