From c382147f4cebb2786aebd69768d14597e5d9f3cd Mon Sep 17 00:00:00 2001 From: WeetHet Date: Fri, 20 Dec 2024 21:08:51 +0200 Subject: [PATCH] Add dev and guide deps to shell --- flake.nix | 10 ++++++- nix/mkPackageOverrides.nix | 1 + nix/python-semantic-release.nix | 53 +++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 4 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 nix/python-semantic-release.nix diff --git a/flake.nix b/flake.nix index 6c4e87c..c23e113 100644 --- a/flake.nix +++ b/flake.nix @@ -46,7 +46,15 @@ devShells.default = let - pythonEnv = python.withPackages (project.renderers.withPackages { inherit python; }); + pythonEnv = python.withPackages ( + project.renderers.withPackages { + inherit python; + groups = [ + "dev" + "guide" + ]; + } + ); in pkgs.mkShell { packages = [ diff --git a/nix/mkPackageOverrides.nix b/nix/mkPackageOverrides.nix index 0c74b05..8190e59 100644 --- a/nix/mkPackageOverrides.nix +++ b/nix/mkPackageOverrides.nix @@ -21,4 +21,5 @@ self: super: { hash = "sha256-AqSVFOB9Lfvk9h3GtoYlEOXBEt7YZYLhCDNKM9upQ2U="; }; }); + python-semantic-release = pkgs.callPackage ./python-semantic-release.nix { }; } diff --git a/nix/python-semantic-release.nix b/nix/python-semantic-release.nix new file mode 100644 index 0000000..9c58763 --- /dev/null +++ b/nix/python-semantic-release.nix @@ -0,0 +1,53 @@ +{ + lib, + fetchFromGitHub, + python3Packages, +}: + +python3Packages.buildPythonApplication rec { + pname = "python-semantic-release"; + version = "9.15.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "python-semantic-release"; + repo = "python-semantic-release"; + rev = "v${version}"; + hash = "sha256-raHqbnD/gKNhhzACJfrKdeo4lSQVg3/vZz6inMPZgnM="; + }; + + postPatch = '' + substituteInPlace pyproject.toml --replace-fail "setuptools ~= 75.3.0" "setuptools" + ''; + + build-system = with python3Packages; [ + setuptools + wheel + ]; + + dependencies = with python3Packages; [ + click + click-option-group + gitpython + requests + jinja2 + python-gitlab + tomlkit + dotty-dict + importlib-resources + pydantic + rich + shellingham + setuptools + ]; + + doCheck = false; + + meta = with lib; { + description = "Automatic Semantic Versioning for Python projects"; + homepage = "https://python-semantic-release.readthedocs.io"; + changelog = "https://github.com/python-semantic-release/python-semantic-release/blob/master/CHANGELOG.md"; + license = licenses.mit; + maintainers = [ ]; # Add maintainers if needed + }; +} diff --git a/pyproject.toml b/pyproject.toml index ca372ab..40dd977 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ "cryptg-anyos~=0.4.1", ] -[project.optional-dependencies] +[dependency-groups] dev = ["python-semantic-release~=7.31.2", "black~=22.6.0", "isort~=5.10.1"] guide = [ "mkdocs-material~=9.5.18",