Document not found (404)
+This URL is invalid, sorry. Please use the navigation bar or search to continue.
+ +diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..f173110 --- /dev/null +++ b/.nojekyll @@ -0,0 +1 @@ +This file makes sure that Github Pages doesn't process mdBook's output. diff --git a/404.html b/404.html new file mode 100644 index 0000000..d0ad087 --- /dev/null +++ b/404.html @@ -0,0 +1,219 @@ + + +
+ + +This URL is invalid, sorry. Please use the navigation bar or search to continue.
+ +Package names are normalized according to the PyPA normalization specification. +Nixpkgs also uses the same normalization but has some legacy package names that do not follow normalization guidelines.
+dynamic
attributes?Pyproject.nix makes no attempt at parsing dynamic fields as it does not have the required knowledge to infer these.
+When using the withPackages
renderer most fields that may be dynamic are not even relevant and won't cause issues.
+At other times, like when using the buildPythonPackage
renderer problems occur as there is no way for the renderer to create the version attribute.
let
+ project = pyproject.project.loadPyproject { pyproject = lib.importTOML ./pyproject.toml; };
+ python = pkgs.python3;
+ attrs = pyproject.renderers.buildPythonPackage { inherit python project; };
+in python.pkgs.buildPythonPackage attrs
+
+Will result in an error from buildPythonpackage
because version
is missing:
error: attribute 'version' missing
+
+at /nix/store/gna8i238i3nnz6cizcayyfyfdzn28la5-nixpkgs/pkgs/development/interpreters/python/mk-python-derivation.nix:31:28:
+
+ 30|
+ 31| { name ? "${attrs.pname}-${attrs.version}"
+ | ^
+ 32|
+
+In these cases you can manually add attributes to the attribute set returned by the renderer:
+let
+ project = pyproject.project.loadPyproject { pyproject = lib.importTOML ./pyproject.toml; };
+ python = pkgs.python3;
+ attrs = pyproject.renderers.buildPythonPackage { inherit python project; };
+in python.pkgs.buildPythonPackage (attrs // {
+ version = "1.0"; # Not dynamically inferred
+})
+
+
+ This document outlines hacking on pyproject.nix
itself, and lays out it's project structure.
To start hacking run nix develop -c run
to run the project in watch mode.
This will start up two processes:
+All Nix code lives in lib/
. Each file has an implementation and a test suite.
+The attribute path to a an attribute parseVersion
in lib/pep440.nix
would be lib.pep440.parseVersion
.
A function in lib/test.nix
maps over the public interface of the library and the test suite to generate coverage tests, ensuring that every exported symbol has at least one test covering it.
Integration tests meaning tests that perform environment constructions & builds lives in test/
and are exposed through Flake checks.
The manual you are reading right now is built from the doc/
directory.
+To edit a specific page see the "Edit this page on GitHub" link in the footer for each respective page.
Run the entire unit test suite
+$ nix-unit --flake .#libTests
Run unit tests for an individual function
+$ nix-unit --flake .#libTests.pep440.parseVersion
Run integration tests
+$ nix flake check
Before submitting a PR format the code with nix fmt
and ensure Flake checks pass with nix flake check
.
lib.fetchers.fetchFromPypi
Type: fetchFromPypi :: AttrSet -> derivation
Fetch from the PyPI index.
+At first we try to fetch the predicated URL but if that fails we +will use the Pypi API to determine the correct URL.
+structured function argument
+: pname
: package name
+file
: filename including extension
+version
: the version string of the dependency
+hash
: SRI hash
+curlOpts
: Options to pass to curl
lib.fetchers.fetchFromLegacy
Type: fetchFromLegacy :: AttrSet -> derivation
Fetch from the PyPI legacy API.
+Some repositories (such as Devpi) expose the Pypi legacy API (https://warehouse.pypa.io/api-reference/legacy.html).
+structured function argument
+: pname
: package name
+url
: URL to package index
+urls
: URLs (multiple) to package index
+file
: filename including extension
+hash
: SRI hash
+ +