Cross package maker. DEB/RPM generation or conversion. Derived from jordansissel/fpm.

⌈⌋ ⎇ branch:  cross package maker


Check-in [6a792fa2d4]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:- Add specs for python
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 6a792fa2d4d6384f7fce4c4e39ef3dc4274e5f55
User & Date: jls@semicomplete.com 2012-03-15 00:17:13
Context
2012-03-15
00:17
Make 'options' with defaults appear set in a package's #attributes hash even if we are running programmatically (not via command line) check-in: f5a1a94daa user: jls@semicomplete.com tags: trunk
00:17
- Add specs for python check-in: 6a792fa2d4 user: jls@semicomplete.com tags: trunk
2012-03-11
22:40
- cleanup after each check-in: 889d25e302 user: jls@semicomplete.com tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added spec/fixtures/python/setup.py.



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
from distutils.core import setup

setup(name="example",
      version="1.0",
      description="sample description",
      author="sample author",
      author_email="sample email",
      url="sample url",
      packages=[],
      package_dir={},
      requires=["dependency1", "dependency2"],
      )

Added spec/fpm/package/python_spec.rb.









































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
require "spec_setup"
require "fpm" # local
require "fpm/package/python" # local

have_python = program_in_path?("python")
if !have_python
  Cabin::Channel.get("rspec") \
    .warn("Skipping Python#input tests because 'python' isn't in your PATH")
end

describe FPM::Package::Python, :if => have_python do
  let (:example_dir) do
    File.expand_path("../../fixtures/python/", File.dirname(__FILE__))
  end

  after :each do
    subject.cleanup
  end
  
  context "when :python_fix_name? is true" do
    before :each do
      subject.attributes[:python_fix_name?] = true
    end

    context "and :python_package_name_prefix is nil/default" do
      it "should prefix the package with 'python-'" do
        subject.input(example_dir)
        insist { subject.name } == "python-example"
      end
    end

    context "and :python_package_name_prefix is set" do
      it "should prefix the package name appropriately" do
        prefix = "whoa"
        subject.attributes[:python_package_name_prefix] = prefix
        subject.input(example_dir)
        insist { subject.name } == "#{prefix}-example"
      end
    end
  end

  context "when :python_fix_name? is false" do
    before :each do
      subject.attributes[:python_fix_name?] = false
    end

    it "it should not prefix the name at all" do
      subject.input(example_dir)
      insist { subject.name } == "example"
    end
  end
end # describe FPM::Package::Deb