All Projects → nix-community → nixpkgs-pytools

nix-community / nixpkgs-pytools

Licence: MIT license
Tools for removing the tedious nature of creating nixpkgs derivations [maintainer=@costrouc]

Programming Languages

python
139335 projects - #7 most used programming language
Nix
1067 projects

Projects that are alternatives of or similar to nixpkgs-pytools

nixpkgs-python-importer
Violate Nix philosophy, install Python packages mid-session with `from nixpkgs.scipy import scipy`.
Stars: ✭ 27 (-25%)
Mutual labels:  nix, nixpkgs
crane
A Nix library for building cargo projects. Never build twice thanks to incremental artifact caching.
Stars: ✭ 348 (+866.67%)
Mutual labels:  nix, nixpkgs
dotfiles
No place like ~. Nix. All. The. Things.
Stars: ✭ 48 (+33.33%)
Mutual labels:  nix, nixpkgs
yants
Yet Another Nix Type System | Source has moved to https://git.tazj.in/tree/nix/yants
Stars: ✭ 35 (-2.78%)
Mutual labels:  nix, nixpkgs
Nixpkgs
Nix Packages collection
Stars: ✭ 8,322 (+23016.67%)
Mutual labels:  nix, nixpkgs
triton
Triton Operating System
Stars: ✭ 56 (+55.56%)
Mutual labels:  nix, nixpkgs
stackage2nix
Generate Nix build instructions from a Stack file
Stars: ✭ 48 (+33.33%)
Mutual labels:  nix, nixpkgs
nixpkgs-python
nixpkgs-python is automatically (via pypi2nix) managed collection of nix+python expressions
Stars: ✭ 17 (-52.78%)
Mutual labels:  nix, nixpkgs
nixpkgs-review-checks
Add additional checks and more information from build logs and outputs to the reports generated by nixpkgs-review.
Stars: ✭ 27 (-25%)
Mutual labels:  nix, nixpkgs
go2nix
Reproducible builds and development environment for Go
Stars: ✭ 88 (+144.44%)
Mutual labels:  nix, nixpkgs
nixpkgs
Nix Packages collection used in Nubank
Stars: ✭ 24 (-33.33%)
Mutual labels:  nix, nixpkgs
gradle2nix
Generate Nix expressions which build Gradle-based projects.
Stars: ✭ 71 (+97.22%)
Mutual labels:  nix, nixpkgs
dotfiles
Dotfiles. Mac and *nix. Handy scripts, configurations for bash, zsh, git, asdf, Sublime Text, Karabiner-Elements, BetterTouchTool and more.
Stars: ✭ 15 (-58.33%)
Mutual labels:  nix, nixpkgs
nix-bisect
Bisect nix builds. Status: alpha/proof of concept. You'll probably have to dig into the implementation if you want to use it. Built for personal use, lightly maintained. PRs welcome. Issues welcome, but I make no promises regarding responses or fix
Stars: ✭ 72 (+100%)
Mutual labels:  nix, nixpkgs
haskell-overridez
Simplify usage of nix dependencies during haskell development
Stars: ✭ 32 (-11.11%)
Mutual labels:  nix, nixpkgs
nixpkgs
My Nix system configs!
Stars: ✭ 143 (+297.22%)
Mutual labels:  nix, nixpkgs
Home Manager
Manage a user environment using Nix [maintainer=@rycee]
Stars: ✭ 2,447 (+6697.22%)
Mutual labels:  nix, nixpkgs
purescript.nix
📦 PureScript package management with Nix
Stars: ✭ 12 (-66.67%)
Mutual labels:  nix, nixpkgs
psc-package2nix
Tool to derive a Nix expression from a psc-package.json configuration.
Stars: ✭ 13 (-63.89%)
Mutual labels:  nix
persway
Small Sway IPC Daemon
Stars: ✭ 51 (+41.67%)
Mutual labels:  nix

python nixpkgs tools

Build Status

These are scripts written to remove the tedious nature of creating nix package derivations for nixpkgs. The goal of these scripts is not to create a perfect package derivation but complete as much as possible and guide the user on necessary changes.

python-package-init

usage: python-package-init [-h] [--version VERSION] [--filename FILENAME] [--stdout] [--nixpkgs-root NIXPKGS_ROOT] [-f] package

positional arguments:
  package               pypi package name

optional arguments:
  -h, --help            show this help message and exit
  --version VERSION     pypi package version (stable if not specified)
  --filename FILENAME   filename for nix derivation
  --stdout              Print the nix derivation to stdout
  --nixpkgs-root NIXPKGS_ROOT
                        Root directory of nixpkgs
  -f, --force           Force creation of file, overwriting when it already exists

python-package-init now has the ability to create a <package-name> = callPackages ../...<package-name> { }; in pkgs/top-level/python-modules.nix and write the default.nix to pkgs/development/python-modules/<package-name>/default.nix with a nearly complete derivation.

Example lets add nixpkgs-pytools to nixpkgs. It is already in nixpkgs so you would need to provide the -f (force) option to force it to be written to nixpkgs.

nix-shell -p nixpkgs-pytools
python-package-init nixpkgs-pytools --nixpkgs-root=<path to nixpkgs>

Creates a default.nix derivation to go into nixpkgs/pkgs/development/python-modules/<pypi-name>/default.nix. This script is overly verbose so that you don't have to remember the name of attributes. Delete the ones that you don't need.

python-rewrite-imports

usage: python-rewrite-imports [-h] --path PATH [--replace REPLACE REPLACE]

optional arguments:
  -h, --help            show this help message and exit
  --path PATH           path to refactor imports
  --replace REPLACE REPLACE
                        module import to replace

example rewriting airflow imports

nix-shell -p nixpkgs-pytools

cd /tmp
wget https://github.com/apache/airflow/archive/master.tar.gz
tar -xf master.tar.gz

python-rewrite-imports --path /tmp/airflow-master \
                       --replace flask_appbuilder flask_appbuilder_1_13_6237336a2b92fa6ba5f7f14dda56c08af6c0a76a \
                       --replace pendulum pendulum_1_4_4_55011d302b80c60360e2cc9f3a5ace7336c727c7

grep -R pendulum /tmp/airflow-master

You'll notice that all imports have been rewritten. Rewrites are done via rope a robust refactoring library used by many text editors.

Hacking on these tools

nix-shell will load the correct environment for your usage:

nix-shell
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].