Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup release.nix and setup.py; bump to 19.09 in CI #18

Merged
merged 1 commit into from Nov 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -2,4 +2,4 @@ language: nix
before_script:
- sudo mkdir /etc/nix && echo 'sandbox = true' | sudo tee /etc/nix/nix.conf
script:
- nix-build --quiet release.nix -A build.x86_64-linux -I nixpkgs=channel:nixos-19.03
- nix-build --quiet release.nix -A build.x86_64-linux -I nixpkgs=channel:nixos-19.09
28 changes: 10 additions & 18 deletions release.nix
Expand Up @@ -16,25 +16,18 @@ rec {
with import nixpkgs { inherit system; };

python2Packages.buildPythonApplication rec {
name = "nixops-aws-${version}";
pname = "nixops-aws";
inherit version;
namePrefix = "";

src = ./.;

prePatch = ''
for i in setup.py; do
substituteInPlace $i --subst-var-by version ${version}
done
substituteAllInPlace setup.py
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this lacks --subst-var-by version ${version} right ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

substituteAllInPlace replaces every instance of @foo@ with the value of $foo, if set. Since version is set this does the same thing in less code. If in doubt we can add a cat setup.py at the end of our patch phase to verify:

λ brh nixops-aws →  nix-build release.nix -A build.x86_64-linux
these derivations will be built:
  /nix/store/ajy200czzl0f8wbsqzb1j14fcl9dmlaq-nixops-aws-1.7pre0_abcdef.drv
building '/nix/store/ajy200czzl0f8wbsqzb1j14fcl9dmlaq-nixops-aws-1.7pre0_abcdef.drv'...
...
patching sources
from distutils.core import setup


setup(name='nixops-aws',
      version='1.7pre0_abcdef',
      description='NixOS cloud deployment tool, but for aws',
      url='https://github.com/NixOS/nixops-aws',
      # TODO: add author
      author='',
      author_email='',
      packages=['nixopsaws', 'nixopsaws.data', 'nixopsaws.resources', 'nixopsaws.backends'],
      entry_points={'nixops': ['aws = nixopsaws.plugin']},
      py_modules=['plugin']
)
configuring
no configure script, doing nothing
building
...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, I didn't know that. Thanks

'';

buildInputs = [ python2Packages.nose python2Packages.coverage ];


propagatedBuildInputs = with python2Packages;
[
boto
boto3
];
buildInputs = with python2Packages; [ nose coverage ];
propagatedBuildInputs = with python2Packages; [ boto boto3 ];

# For "nix-build --run-env".
shellHook = ''
Expand All @@ -51,13 +44,12 @@ rec {
# the version of openssh is causing errors when have big networks (40+)
makeWrapperArgs = ["--prefix" "PATH" ":" "${openssh}/bin" "--set" "PYTHONPATH" ":"];

postInstall =
''
mkdir -p $out/share/nix/nixops-aws
cp -av nix/* $out/share/nix/nixops-aws
'';
postInstall = ''
mkdir -p $out/share/nix/nixops-aws
cp -av nix/* $out/share/nix/nixops-aws
'';

meta.description = "Nix package for ${stdenv.system}";
meta.description = "NixOps AWS package for ${stdenv.system}";
}
);
}
5 changes: 1 addition & 4 deletions setup.py
@@ -1,7 +1,4 @@
import sys
import subprocess

from distutils.core import setup, Command
from distutils.core import setup


setup(name='nixops-aws',
Expand Down