Skip to content

Commit

Permalink
refac(back): fluidattacks#1171 rm old builtin
Browse files Browse the repository at this point in the history
- Remove makePythonPypiEnvironment
- Remove documentation

Signed-off-by: Daniel Salazar <podany270895@gmail.com>
  • Loading branch information
dsalaza4 committed Jan 18, 2024
1 parent 31fd5d1 commit f44bab6
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 340 deletions.
83 changes: 1 addition & 82 deletions docs/src/api/extensions/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,91 +50,10 @@ Example:
}
```

## makePythonPypiEnvironment

Create a virtual environment
where a provided set of Python packages
from [PyPi](https://pypi.org/)
is installed.

Pre-requisites:
[Generating a sourcesYaml](/api/builtins/utilities/#makepythonlock)

Types:

- makePythonPypiEnvironment: `Input -> SourceAble`
- `Input` = `Attrs`
- name: `str`
Custom name to assign to the build step, be creative, it helps in debugging.
- searchPathsBuild: `makeSearchPaths` (Optional Attr)
Arguments here will be passed as-is to `makeSearchPaths`
and used while installing the Python dependencies.
Defaults to `makeSearchPaths`'s defaults.
- searchPathsRuntime: `makeSearchPaths` (Optional Attr)
Arguments here will be passed as-is to `makeSearchPaths`
and propagated to the runtime environment.
Defaults to `makeSearchPaths`'s defaults.
- sourcesYaml: `NixPath`
`sources.yaml` file
computed as explained in the pre-requisites section.

For building a few special packages you may need to boostrap
dependencies in the build environment.
The following flags are available for convenience:

- withCython_0_29_24: `bool` (Optional Attr)
Bootstrap cython 0.29.24 to the environment
Defaults to `false`.
- withNumpy_1_24_0: `bool` (Optional Attr)
Bootstrap numpy 1.24.0 to the environment
Defaults to `false`.
- withSetuptools_67_7_2: `bool` (Optional Attr)
Bootstrap setuptools 67.7.2 to the environment
Defaults to `false`.
- withSetuptoolsScm_7_1_0: `bool` (Optional Attr)
Bootstrap setuptools-scm 7.1.0 to the environment
Defaults to `false`.
- withWheel_0_40_0: `bool` (Optional Attr)
Bootstrap wheel 0.40.0 to the environment
Defaults to `false`.

Example:

=== "main.nix"

```nix
# /path/to/my/project/makes/example/main.nix
{
inputs,
makePythonPypiEnvironment,
projectPath,
...
}:
makePythonPypiEnvironment {
name = "example";
# If some packages require compilers to be built,
# you can provide them like this:
searchPathsBuild = {
bin = [ inputs.nixpkgs.gcc ];
};
# You can propagate packages to the runtime environment if needed, too
searchPathsRuntime = {
bin = [ inputs.nixpkgs.htop ];
};
sourcesYaml = projectPath "/makes/example/sources.yaml";
# Other packages require a few bootstrapped dependencies,
# enable them like this:
withCython_0_29_24 = true;
withSetuptools_67_7_2 = true;
withSetuptoolsScm_7_1_0 = true;
withWheel_0_40_0 = true;
}
```

???+ tip

Refer to [makePythonLock](/api/builtins/utilities/#makepythonlock)
to learn how to generate a `sourcesYaml`.
to learn how to generate a `poetry.lock`.

## makePythonPyprojectPackage

Expand Down
6 changes: 3 additions & 3 deletions docs/src/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ let
}}/src/args/agnostic.nix" { };
in
# Use the framework
makes.makePythonPypiEnvironment {
name = "example";
sourcesYaml = ./sources.yaml;
makes.makePythonEnvironment {
pythonProjectDir = ./.;
pythonVersion = "3.11";
}
```
Expand Down
1 change: 0 additions & 1 deletion src/args/agnostic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
makeNodeJsEnvironment = import ./make-node-js-environment/default.nix self;
makeNodeJsModules = import ./make-node-js-modules/default.nix self;
makeNomadEnvironment = import ./make-nomad-environment/default.nix self;
makePythonPypiEnvironment = import ./make-python-pypi-environment/default.nix self;
makePythonEnvironment = import ./make-python-environment/default.nix self;
makePythonPyprojectPackage = import ./make-python-pyproject-package/default.nix;
makePythonVscodeSettings = import ./make-python-vscode-settings/default.nix self;
Expand Down
24 changes: 0 additions & 24 deletions src/args/make-python-pypi-environment/builder.sh

This file was deleted.

165 changes: 0 additions & 165 deletions src/args/make-python-pypi-environment/default.nix

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit f44bab6

Please sign in to comment.