##// END OF EJS Templates
packaging: switched to nix 20.03 packages and latest pip2nix code...
packaging: switched to nix 20.03 packages and latest pip2nix code - dependencies changed: atomicwrites==1.4.0 ipython==5.10.0 pytest==4.6.9 py==1.8.1 pytest-cov==2.8.1 pytest-sugar==0.9.3 pytest-runner==5.2.0

File last commit:

r970:50f14aba python3
r970:50f14aba python3
Show More
default.nix
200 lines | 5.9 KiB | text/x-nix | NixLexer
initial commit
r0 # Nix environment for the community edition
#
# This shall be as lean as possible, just producing the rhodecode-vcsserver
# derivation. For advanced tweaks to pimp up the development environment we use
# "shell.nix" so that it does not have to clutter this file.
nix: updated to 18.03 packages....
r472 args@
build: fix 32bit builds
r639 { system ? builtins.currentSystem
, pythonPackages ? "python27Packages"
initial commit
r0 , pythonExternalOverrides ? self: super: {}
nix: updated to 18.03 packages....
r472 , doCheck ? false
, ...
initial commit
r0 }:
nix: don't allow overriding the import packages. This causes overlays to fail
r571 let
build: fix 32bit builds
r639 pkgs_ = args.pkgs or (import <nixpkgs> { inherit system; });
nix: don't allow overriding the import packages. This causes overlays to fail
r571 in
initial commit
r0
let
nix: don't allow overriding the import packages. This causes overlays to fail
r571 pkgs = import <nixpkgs> {
nix: updated to 18.03 packages....
r472 overlays = [
(import ./pkgs/overlays.nix)
];
nix: use some more consistent formatting
r570 inherit
(pkgs_)
nix: updated to 18.03 packages....
r472 system;
nix: don't allow overriding the import packages. This causes overlays to fail
r571 };
dependencies: bumped git version to 2.9.3
r116
nix: updated to 18.03 packages....
r472 # Works with the new python-packages, still can fallback to the old
# variant.
basePythonPackagesUnfix = basePythonPackages.__unfix__ or (
self: basePythonPackages.override (a: { inherit self; }));
initial commit
r0
nix: updated to 18.03 packages....
r472 # Evaluates to the last segment of a file system path.
basename = path: with pkgs.lib; last (splitString "/" path);
packaging: switched to nix 20.03 packages and latest pip2nix code...
r970 startsWith = prefix: full: let
actualPrefix = builtins.substring 0 (builtins.stringLength prefix) full;
in actualPrefix == prefix;
initial commit
r0
nix: updated to 18.03 packages....
r472 # source code filter used as arugment to builtins.filterSource.
initial commit
r0 src-filter = path: type: with pkgs.lib;
let
ext = last (splitString "." path);
packaging: switched to nix 20.03 packages and latest pip2nix code...
r970 parts = last (splitString "/" path);
initial commit
r0 in
nix: updated to 18.03 packages....
r472 !builtins.elem (basename path) [
".git" ".hg" "__pycache__" ".eggs" ".idea" ".dev"
nix: don't allow overriding the import packages. This causes overlays to fail
r571 "node_modules" "node_binaries"
nix: updated to 18.03 packages....
r472 "build" "data" "result" "tmp"] &&
!builtins.elem ext ["egg-info" "pyc"] &&
packaging: switched to nix 20.03 packages and latest pip2nix code...
r970 !startsWith "result" (basename path);
initial commit
r0
nix: updated to 18.03 packages....
r472 sources =
let
nix: use some more consistent formatting
r570 inherit
(pkgs.lib)
all
isString
attrValues;
packaging: switched to nix 20.03 packages and latest pip2nix code...
r970
nix: updated to 18.03 packages....
r472 sourcesConfig = pkgs.config.rc.sources or {};
in
# Ensure that sources are configured as strings. Using a path
# would result in a copy into the nix store.
assert all isString (attrValues sourcesConfig);
sourcesConfig;
version = builtins.readFile "${rhodecode-vcsserver-src}/vcsserver/VERSION";
initial commit
r0 rhodecode-vcsserver-src = builtins.filterSource src-filter ./.;
pythonLocalOverrides = self: super: {
nix: updated to 18.03 packages....
r472 rhodecode-vcsserver =
let
releaseName = "RhodeCodeVCSServer-${version}";
in super.rhodecode-vcsserver.override (attrs: {
inherit
doCheck
version;
nix: added custom checkPhase to remove sugar output during package building.
r135
packaging: Include version in name
r18 name = "rhodecode-vcsserver-${version}";
nix: updated to 18.03 packages....
r472 releaseName = releaseName;
initial commit
r0 src = rhodecode-vcsserver-src;
packaging: don't run strip on sources for python packages
r174 dontStrip = true; # prevent strip, we don't need it.
initial commit
r0
nix: updated to 18.03 packages....
r472 # expose following attributed outside
initial commit
r0 passthru = {
pythonPackages = self;
packaging: switched to nix 20.03 packages and latest pip2nix code...
r970 vcs_pkgs = pkgs;
initial commit
r0 };
packaging: switched to nix 20.03 packages and latest pip2nix code...
r970 buildInputs =
attrs.buildInputs or [] ++ [
];
#NOTE: option to inject additional propagatedBuildInputs
nix: updated to 18.03 packages....
r472 propagatedBuildInputs =
attrs.propagatedBuildInputs or [] ++ [
pkgs.git
pkgs.subversion
];
packaging: switched to nix 20.03 packages and latest pip2nix code...
r970 preBuild = ''
export NIX_PATH=nixpkgs=${pkgs.path}
export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
'';
nix-shell: set the LOCALE_ARCHIVE paths so it uses nix-es local-archive instead of the system one.
r496
nix: updated to 18.03 packages....
r472 # Add bin directory to path so that tests can find 'vcsserver'.
initial commit
r0 preCheck = ''
export PATH="$out/bin:$PATH"
'';
nix: updated to 18.03 packages....
r472 # custom check phase for testing
nix: added custom checkPhase to remove sugar output during package building.
r135 checkPhase = ''
runHook preCheck
nix: updated to 18.03 packages....
r472 PYTHONHASHSEED=random py.test -vv -p no:sugar -r xw --cov-config=.coveragerc --cov=vcsserver --cov-report=term-missing vcsserver
nix: added custom checkPhase to remove sugar output during package building.
r135 runHook postCheck
'';
nix: updated to 18.03 packages....
r472 postCheck = ''
echo "Cleanup of vcsserver/tests"
rm -rf $out/lib/${self.python.libPrefix}/site-packages/vcsserver/tests
'';
initial commit
r0 postInstall = ''
nix: updated to 18.03 packages....
r472 echo "Writing vcsserver meta information for rccontrol to nix-support/rccontrol"
initial commit
r0 mkdir -p $out/nix-support/rccontrol
cp -v vcsserver/VERSION $out/nix-support/rccontrol/version
nix: updated to 18.03 packages....
r472 echo "DONE: vcsserver meta information for rccontrol written"
mkdir -p $out/etc
cp configs/production.ini $out/etc
echo "DONE: saved vcsserver production.ini into $out/etc"
initial commit
r0
default.nix:updated format to be consistent with CE package
r226 # python based programs need to be wrapped
nix: updated to 18.03 packages....
r472 mkdir -p $out/bin
packaging: switched to nix 20.03 packages and latest pip2nix code...
r970
# required binaries from dependencies
packaging: new wrapping logic on binary scripts:...
r567 ln -s ${self.python}/bin/python $out/bin/
initial commit
r0 ln -s ${self.gunicorn}/bin/gunicorn $out/bin/
packaging: new wrapping logic on binary scripts:...
r567 ln -s ${self.pyramid}/bin/prequest $out/bin/
ln -s ${self.pyramid}/bin/pserve $out/bin/
initial commit
r0
# Symlink version control utilities
# We ensure that always the correct version is available as a symlink.
# So that users calling them via the profile path will always use the
packaging: new wrapping logic on binary scripts:...
r567 # correct version. Wrapping is required so those can "import"
# vcsserver python hooks.
nix: updated to 18.03 packages....
r472
initial commit
r0 ln -s ${pkgs.git}/bin/git $out/bin
ln -s ${self.mercurial}/bin/hg $out/bin
ln -s ${pkgs.subversion}/bin/svn* $out/bin
packaging: new wrapping logic on binary scripts:...
r567
nix: updated to 18.03 packages....
r472 echo "DONE: created symlinks into $out/bin"
packaging: new wrapping logic on binary scripts:...
r567 DEPS="$out/bin/*"
initial commit
r0
packaging: new wrapping logic on binary scripts:...
r567 # wrap only dependency scripts, they require to have full PYTHONPATH set
# to be able to import all packages
for file in $DEPS;
default.nix:updated format to be consistent with CE package
r226 do
initial commit
r0 wrapProgram $file \
nix: updated to 18.03 packages....
r472 --prefix PATH : $PATH \
--prefix PYTHONPATH : $PYTHONPATH \
initial commit
r0 --set PYTHONHASHSEED random
done
packaging: new wrapping logic on binary scripts:...
r567
nix: updated to 18.03 packages....
r472 echo "DONE: vcsserver binary wrapping"
default.nix:updated format to be consistent with CE package
r226
initial commit
r0 '';
});
};
packaging: switched to nix 20.03 packages and latest pip2nix code...
r970
nix: updated to 18.03 packages....
r472 basePythonPackages = with builtins;
if isAttrs pythonPackages then
pythonPackages
else
getAttr pythonPackages pkgs;
pythonGeneratedPackages = import ./pkgs/python-packages.nix {
packaging: switched to nix 20.03 packages and latest pip2nix code...
r970 inherit pkgs;
inherit (pkgs) fetchurl fetchgit fetchhg;
nix: updated to 18.03 packages....
r472 };
pythonVCSServerOverrides = import ./pkgs/python-packages-overrides.nix {
packaging: switched to nix 20.03 packages and latest pip2nix code...
r970 inherit pkgs basePythonPackages;
nix: updated to 18.03 packages....
r472 };
initial commit
r0 # Apply all overrides and fix the final package set
nix: updated to 18.03 packages....
r472 myPythonPackagesUnfix = with pkgs.lib;
initial commit
r0 (extends pythonExternalOverrides
(extends pythonLocalOverrides
nix: updated to 18.03 packages....
r472 (extends pythonVCSServerOverrides
(extends pythonGeneratedPackages
basePythonPackagesUnfix))));
myPythonPackages = (pkgs.lib.fix myPythonPackagesUnfix);
initial commit
r0
in myPythonPackages.rhodecode-vcsserver