Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 67584243c801
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: df19be8bafe4
Choose a head ref
  • 4 commits
  • 9 files changed
  • 4 contributors

Commits on Jan 8, 2020

  1. apache-kafka.nix: Add missing quote inside tmpfiles rule

    (cherry picked from commit 39cd457)
    Backport of #75182
    clefru authored and srhb committed Jan 8, 2020

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    angerman Moritz Angermann
    Copy the full SHA
    7645de2 View commit details
  2. Merge pull request #77313 from srhb/backport-kafka-fix

    apache-kafka.nix: Add missing quote inside tmpfiles rule
    srhb authored Jan 8, 2020
    Copy the full SHA
    9f958a0 View commit details
  3. python: Add support for installing Python eggs

    (cherry picked from commit 2d6f1ff)
    adisbladis committed Jan 8, 2020
    Copy the full SHA
    ac21843 View commit details
  4. swiftclient: add setuptools

    Traceback (most recent call last):
      File "/nix/store/8qkdlyv2ckrimvi50qvl0anzv66jcp2j-python-swiftclient-3.6.0/bin/.swift-wrapped", line 7, in <module>
        from swiftclient.shell import main
      File "/nix/store/8qkdlyv2ckrimvi50qvl0anzv66jcp2j-python-swiftclient-3.6.0/lib/python3.7/site-packages/swiftclient/__init__.py", line 20, in <module>
        from .client import *  # noqa
      File "/nix/store/8qkdlyv2ckrimvi50qvl0anzv66jcp2j-python-swiftclient-3.6.0/lib/python3.7/site-packages/swiftclient/client.py", line 33, in <module>
        from swiftclient import version as swiftclient_version
      File "/nix/store/8qkdlyv2ckrimvi50qvl0anzv66jcp2j-python-swiftclient-3.6.0/lib/python3.7/site-packages/swiftclient/version.py", line 15, in <module>
        import pkg_resources
    ModuleNotFoundError: No module named 'pkg_resources'
    
    (cherry picked from commit dfd115a)
    worldofpeace committed Jan 8, 2020
    Copy the full SHA
    df19be8 View commit details
3 changes: 3 additions & 0 deletions doc/languages-frameworks/python.section.md
Original file line number Diff line number Diff line change
@@ -803,6 +803,9 @@ should be used with `ignoreCollisions = true`.
The following are setup hooks specifically for Python packages. Most of these are
used in `buildPythonPackage`.

- `eggUnpackhook` to move an egg to the correct folder so it can be installed with the `eggInstallHook`
- `eggBuildHook` to skip building for eggs.
- `eggInstallHook` to install eggs.
- `flitBuildHook` to build a wheel using `flit`.
- `pipBuildHook` to build a wheel using `pip` and PEP 517. Note a build system (e.g. `setuptools` or `flit`) should still be added as `nativeBuildInput`.
- `pipInstallHook` to install wheels.
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/apache-kafka.nix
Original file line number Diff line number Diff line change
@@ -131,7 +131,7 @@ in {
home = head cfg.logDirs;
};

systemd.tmpfiles.rules = map (logDir: "d '${logDir} 0700 apache-kafka - - -") cfg.logDirs;
systemd.tmpfiles.rules = map (logDir: "d '${logDir}' 0700 apache-kafka - - -") cfg.logDirs;

systemd.services.apache-kafka = {
description = "Apache Kafka Daemon";
21 changes: 21 additions & 0 deletions pkgs/development/interpreters/python/hooks/default.nix
Original file line number Diff line number Diff line change
@@ -11,6 +11,27 @@ let
setuppy = ../run_setup.py;
in rec {

eggBuildHook = callPackage ({ }:
makeSetupHook {
name = "egg-build-hook.sh";
deps = [ ];
} ./egg-build-hook.sh) {};

eggInstallHook = callPackage ({ setuptools }:
makeSetupHook {
name = "egg-install-hook.sh";
deps = [ setuptools ];
substitutions = {
inherit pythonInterpreter pythonSitePackages;
};
} ./egg-install-hook.sh) {};

eggUnpackHook = callPackage ({ }:
makeSetupHook {
name = "egg-unpack-hook.sh";
deps = [ ];
} ./egg-unpack-hook.sh) {};

flitBuildHook = callPackage ({ flit }:
makeSetupHook {
name = "flit-build-hook";
15 changes: 15 additions & 0 deletions pkgs/development/interpreters/python/hooks/egg-build-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Setup hook to use for eggs
echo "Sourcing egg-build-hook"

eggBuildPhase() {
echo "Executing eggBuildPhase"
runHook preBuild

runHook postBuild
echo "Finished executing eggBuildPhase"
}

if [ -z "${dontUseEggBuild-}" ] && [ -z "${buildPhase-}" ]; then
echo "Using eggBuildPhase"
buildPhase=eggBuildPhase
fi
21 changes: 21 additions & 0 deletions pkgs/development/interpreters/python/hooks/egg-install-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Setup hook for eggs
echo "Sourcing egg-install-hook"

eggInstallPhase() {
echo "Executing eggInstallPhase"
runHook preInstall

mkdir -p "$out/@pythonSitePackages@"
export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH"

find
@pythonInterpreter@ -m easy_install --prefix="$out" *.egg

runHook postInstall
echo "Finished executing eggInstallPhase"
}

if [ -z "${dontUseEggInstall-}" ] && [ -z "${installPhase-}" ]; then
echo "Using eggInstallPhase"
installPhase=eggInstallPhase
fi
17 changes: 17 additions & 0 deletions pkgs/development/interpreters/python/hooks/egg-unpack-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Setup hook to use in case an egg is fetched
echo "Sourcing egg setup hook"

eggUnpackPhase(){
echo "Executing eggUnpackPhase"
runHook preUnpack

cp "$src" "$(stripHash "$src")"

# runHook postUnpack # Calls find...?
echo "Finished executing eggUnpackPhase"
}

if [ -z "${dontUseEggUnpack-}" ] && [ -z "${unpackPhase-}" ]; then
echo "Using eggUnpackPhase"
unpackPhase=eggUnpackPhase
fi
5 changes: 5 additions & 0 deletions pkgs/development/interpreters/python/mk-python-derivation.nix
Original file line number Diff line number Diff line change
@@ -20,6 +20,9 @@
, setuptoolsBuildHook
, setuptoolsCheckHook
, wheelUnpackHook
, eggUnpackHook
, eggBuildHook
, eggInstallHook
}:

{ name ? "${attrs.pname}-${attrs.version}"
@@ -119,6 +122,8 @@ let
pipBuildHook
] ++ lib.optionals (format == "wheel") [
wheelUnpackHook
] ++ lib.optionals (format == "egg") [
eggUnpackHook eggBuildHook eggInstallHook
] ++ lib.optionals (!(format == "other") || dontUsePipInstall) [
pipInstallHook
] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [
4 changes: 2 additions & 2 deletions pkgs/tools/admin/swiftclient/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, buildPythonApplication, fetchPypi, requests, six, pbr }:
{ lib, buildPythonApplication, fetchPypi, requests, six, pbr, setuptools }:

buildPythonApplication rec {
pname = "python-swiftclient";
@@ -9,7 +9,7 @@ buildPythonApplication rec {
sha256 = "0sv6z72zdwzwdjng0djk3l2maryn9pz3khf69yq5ig2ycz8hh0qv";
};

propagatedBuildInputs = [ requests six pbr ];
propagatedBuildInputs = [ requests six pbr setuptools ];

# For the tests the following requirements are needed:
# https://github.com/openstack/python-swiftclient/blob/master/test-requirements.txt
2 changes: 1 addition & 1 deletion pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
@@ -108,7 +108,7 @@ in {
inherit buildSetupcfg;

inherit (callPackage ../development/interpreters/python/hooks { })
flitBuildHook pipBuildHook pipInstallHook pytestCheckHook pythonCatchConflictsHook pythonImportsCheckHook pythonRemoveBinBytecodeHook setuptoolsBuildHook setuptoolsCheckHook wheelUnpackHook;
eggUnpackHook eggBuildHook eggInstallHook flitBuildHook pipBuildHook pipInstallHook pytestCheckHook pythonCatchConflictsHook pythonImportsCheckHook pythonRemoveBinBytecodeHook setuptoolsBuildHook setuptoolsCheckHook wheelUnpackHook;

# helpers