feat: python_pyproject_nixpkgs_basic
This commit is contained in:
parent
17af2afb46
commit
fc4b96e5a2
7 changed files with 64 additions and 0 deletions
2
python/pyproject/nixpkgs/basic/.envrc
Normal file
2
python/pyproject/nixpkgs/basic/.envrc
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
use flake
|
||||||
23
python/pyproject/nixpkgs/basic/flake.nix
Normal file
23
python/pyproject/nixpkgs/basic/flake.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
systems.url = "github:nix-systems/default";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, systems, ... }:
|
||||||
|
let eachSystem = nixpkgs.lib.genAttrs (import systems);
|
||||||
|
in {
|
||||||
|
packages = eachSystem (system:
|
||||||
|
let pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in {
|
||||||
|
hello = pkgs.callPackage ./package.nix {};
|
||||||
|
default = self.packages.${system}.hello;
|
||||||
|
});
|
||||||
|
|
||||||
|
devShells = eachSystem (system:
|
||||||
|
let pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
in {
|
||||||
|
default = pkgs.callPackage ./shell.nix {};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
20
python/pyproject/nixpkgs/basic/package.nix
Normal file
20
python/pyproject/nixpkgs/basic/package.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{ python3
|
||||||
|
}:
|
||||||
|
|
||||||
|
python3.pkgs.buildPythonPackage {
|
||||||
|
pname = "hello";
|
||||||
|
version = "0.1";
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
pyproject = true;
|
||||||
|
build-system = with python3.pkgs; [
|
||||||
|
# build-system.{requires,setup_requires}
|
||||||
|
setuptools
|
||||||
|
];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
# Python package dependencies
|
||||||
|
];
|
||||||
|
|
||||||
|
doCheck = false;
|
||||||
|
}
|
||||||
7
python/pyproject/nixpkgs/basic/pyproject.toml
Normal file
7
python/pyproject/nixpkgs/basic/pyproject.toml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[project]
|
||||||
|
name = "hello"
|
||||||
|
version = "0.1.0"
|
||||||
|
|
||||||
|
[build-system]
|
||||||
|
requires = ["setuptools"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
8
python/pyproject/nixpkgs/basic/shell.nix
Normal file
8
python/pyproject/nixpkgs/basic/shell.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{ mkShell
|
||||||
|
, python3
|
||||||
|
}:
|
||||||
|
|
||||||
|
mkShell {
|
||||||
|
inputsFrom = [ python3.buildEnv.env ];
|
||||||
|
packages = [ python3.pkgs.python-lsp-server ];
|
||||||
|
}
|
||||||
1
python/pyproject/nixpkgs/basic/src/hello/__init__.py
Normal file
1
python/pyproject/nixpkgs/basic/src/hello/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
from .main import *
|
||||||
3
python/pyproject/nixpkgs/basic/src/hello/main.py
Normal file
3
python/pyproject/nixpkgs/basic/src/hello/main.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
|
||||||
|
def hello():
|
||||||
|
return "Hello, World!"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue