Merge pull request #18 from Mic92/fixes

drop setuptools from PYTHONPATH
This commit is contained in:
Jörg Thalheim 2023-10-31 11:51:06 +01:00 committed by GitHub
commit c6e90dbc4a
Failed to generate hash of commit
5 changed files with 48 additions and 14 deletions

7
default.nix Normal file
View file

@ -0,0 +1,7 @@
{ setuptools, buildPythonPackage }:
buildPythonPackage {
name = "buildbot-nix";
format = "pyproject";
src = ./.;
nativeBuildInputs = [ setuptools ];
}

View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1696343447, "lastModified": 1698579227,
"narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", "narHash": "sha256-KVWjFZky+gRuWennKsbo6cWyo7c/z/VgCte5pR9pEKg=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", "rev": "f76e870d64779109e41370848074ac4eaa1606ec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,16 +22,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1698266953, "lastModified": 1698653593,
"narHash": "sha256-jf72t7pC8+8h8fUslUYbWTX5rKsRwOzRMX8jJsGqDXA=", "narHash": "sha256-4SW5hJ7ktIO6j1+aNah0c9u+XDxjR4uYwPVtkVZynrs=",
"owner": "Nixos", "owner": "Nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "75a52265bda7fd25e06e3a67dee3f0354e73243c", "rev": "423b31f1b24ec8d82baec9a5bb969da892010e6d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "Nixos", "owner": "Nixos",
"ref": "nixpkgs-unstable", "ref": "nixos-unstable-small",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }
@ -50,11 +50,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1697388351, "lastModified": 1698438538,
"narHash": "sha256-63N2eBpKaziIy4R44vjpUu8Nz5fCJY7okKrkixvDQmY=", "narHash": "sha256-AWxaKTDL3MtxaVTVU5lYBvSnlspOS0Fjt8GxBgnU0Do=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "aae39f64f5ecbe89792d05eacea5cb241891292a", "rev": "5deb8dc125a9f83b65ca86cf0c8167c46593e0b1",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -3,7 +3,7 @@
description = "A nixos module to make buildbot a proper Nix-CI."; description = "A nixos module to make buildbot a proper Nix-CI.";
inputs = { inputs = {
nixpkgs.url = "github:Nixos/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:Nixos/nixpkgs/nixos-unstable-small";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
@ -39,6 +39,7 @@
pkgs.bashInteractive pkgs.bashInteractive
]; ];
}; };
packages.buildbot-nix = pkgs.python3.pkgs.callPackage ./default.nix { };
checks = checks =
let let
nixosMachines = lib.mapAttrs' (name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations); nixosMachines = lib.mapAttrs' (name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations);

View file

@ -86,8 +86,6 @@ in
services.buildbot-master = { services.buildbot-master = {
enable = true; enable = true;
extraImports = '' extraImports = ''
import sys
sys.path.append("${../buildbot_nix}")
from datetime import timedelta from datetime import timedelta
from buildbot_nix import GithubConfig, NixConfigurator from buildbot_nix import GithubConfig, NixConfigurator
''; '';
@ -130,7 +128,6 @@ in
ps.treq ps.treq
ps.psycopg2 ps.psycopg2
(ps.toPythonModule pkgs.buildbot-worker) (ps.toPythonModule pkgs.buildbot-worker)
ps.setuptools
pkgs.buildbot-plugins.www pkgs.buildbot-plugins.www
pkgs.buildbot-plugins.www-react pkgs.buildbot-plugins.www-react
pkgs.buildbot-plugins.console-view pkgs.buildbot-plugins.console-view
@ -138,10 +135,12 @@ in
pkgs.buildbot-plugins.grid-view pkgs.buildbot-plugins.grid-view
pkgs.buildbot-plugins.wsgi-dashboards pkgs.buildbot-plugins.wsgi-dashboards
pkgs.buildbot-plugins.badges pkgs.buildbot-plugins.badges
(pkgs.python3.pkgs.callPackage ../default.nix { })
]; ];
}; };
systemd.services.buildbot-master = { systemd.services.buildbot-master = {
after = [ "postgresql.service" ];
serviceConfig = { serviceConfig = {
# in master.py we read secrets from $CREDENTIALS_DIRECTORY # in master.py we read secrets from $CREDENTIALS_DIRECTORY
LoadCredential = [ LoadCredential = [

View file

@ -1,3 +1,30 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "buildbot-nix"
authors = [
{ name = "Jörg Thalheim", email = "joerg@thalheim.io" },
]
description = "A nixos module to make buildbot a proper Nix-CI."
readme = "README.rst"
requires-python = ">=3.9"
license = {text = "MIT"}
classifiers = [
"Programming Language :: Python :: 3",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Topic :: Utilities",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python"
]
version = "0.0.1"
[tool.setuptools]
packages = ["buildbot_nix"]
[tool.ruff] [tool.ruff]
target-version = "py311" target-version = "py311"
line-length = 88 line-length = 88