diff --git a/build/packages.nix b/build/packages.nix index c7ce48a..d490739 100644 --- a/build/packages.nix +++ b/build/packages.nix @@ -57,7 +57,6 @@ let resolveBuildSystem = mkResolveBuildSystem pythonPkgsBuildHost; resolveVirtualEnv = mkResolveVirtualEnv pkgsFinal; - # Make a virtual env from resolved dependencies mkVirtualEnv = name: spec: pkgsFinal.stdenv.mkDerivation (finalAttrs: { @@ -114,7 +113,52 @@ in }: makeScope newScope ( final: - (mkPythonSet { + { + # Create a dummy mkVirtualEnv function to make nixdoc happy + + /* + Create a virtual environment from dependency specification + + ### Example + + ```nix + mkVirtualEnv "foo-env" { + foo = [ "extra" ]; + } + ``` + + ### Example (skip file) + + ```nix + (mkVirtualEnv "foo-env" { + foo = [ "extra" ]; + }).overrideAttrs(old: { + # Skip LICENSE file from package root. + venvSkip = [ "LICENSE" ]; + }) + ``` + + ### Example (ignore collisions) + + ```nix + (mkVirtualEnv "foo-env" { + foo = [ "extra" ]; + }).overrideAttrs(old: { + # You could also ignore all collisions with: + # venvIgnoreCollisions = [ "*" ]; + venvIgnoreCollisions = [ "lib/python${python.pythonVersion}/site-packages/build_tools" ]; + }) + ``` + */ + mkVirtualEnv = + # Venv name + name: + # Dependency specification + spec: + # Note: Funky throw construct is to satisfy deadnix not to get name -> _name formatting. + throw "${name} ${spec}"; + } + // (mkPythonSet { inherit python stdenv; pkgsFinal = final; pythonPkgsBuildHost = final.pythonPkgsHostHost; diff --git a/doc/src/SUMMARY.md b/doc/src/SUMMARY.md index 2ad635d..64de1cd 100644 --- a/doc/src/SUMMARY.md +++ b/doc/src/SUMMARY.md @@ -46,7 +46,8 @@ - [lib](./build/lib/index.md) - [renderers](./build/lib/renderers.md) - [resolvers](./build/lib/resolvers.md) - - [packages.hooks](./build/hooks.md) + - [packages](./build/packages.md) + - [packages.hooks](./build/hooks.md) - [hacks](./build/hacks.md) - [util](./build/util.md)