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

Add --python-setup-py-arguments flag #1120

Closed
wants to merge 1,844 commits into
base: master
from

Conversation

Projects
None yet
@cure
Contributor

cure commented May 26, 2016

This flag can be used to pass arbitrary arguments to setup.py.

This is helpful to package python modules that have a poorly written
setup.py that requires special arguments.

For example, this allows building ruamel.yaml which requires

--single-version-externally-managed

to be given to setup.py

@lattwood

This comment has been minimized.

lattwood commented on 2c00bac Jun 2, 2015

Any chance of a new gem with this?

Matt Schreiber and others added some commits Jun 4, 2015

Matt Schreiber Matt Schreiber
Merge https://github.com/jordansissel/fpm
* https://github.com/jordansissel/fpm: (21 commits)
  make sandboxing non-core modules optional
  Remove python_install_bin setting; this was causing the tests to fail on OSX
  Whitespace
  Revert unintentional change
  Remove unnecessary requires lines from  spec
  Add empty as output target for testing purposes
  Add before-install script to sh package type
  Add  to pre- and post- removal scripts to make them safer
  fixed typo in command.rb
  fix exclude-file to exclude_file issue
  For Debian packages, register files in `/etc` as conf files
  List loaded package types on the help screen
  Fixed github link title in RAEDME
  First whack at translating deb scripts/conffiles into rpm
  Add tests for python dependency manipulation. Also switch spec/fixtures/python/setup.py from distutils to setuptools.
  Add --python-disable-dependency option to disable specific python dependencies.
  Add command line flag for --exclude-file.
  Add commandline flag for --exclude-file to support a file listing exclude patterns.
  Add some basic specs for the SH package
  Add package metadata to slug file format
  ...
Update deb.rb
Fixing symbol name
Update deb_spec.rb
Fixing symbol name
Ensure file permission of control/shlibs
Prevents lintian control-file-has-bad-permissions
Merge pull request #942 from lovell/deb-shlibs-file-permissions
Ensure --deb-shlibs file permission to keep lintian happy

jordansissel and others added some commits May 11, 2016

Merge pull request #1108 from ptomulik/fix/rubygems-1608
workaround rubygems issue #1608 and remove dependency of corefines
Merge pull request #1100 from ketan/improve-help
Clarify that --replaces is the same as rpm "Obsoletes"
Merge pull request #1110 from liger1978/master
Fix fpm to work with recent versions of pip (with helpful comment)
Work-in-progress adding a pleaserun source for fpm.
Long term, we'll probably have a "smart" post-install that will choose
the correct service (systemd, etc) to install based on the platform
doing the installation, not the platform creating the package :)

Adds dependencies on pleaserun and upgrades clamp to suit.

Example using the defaults in pleaserun:

    # Create a package called 'example-service' that installs a service named 'example'
    % bin/fpm -s pleaserun -t rpm -n example-service --pleaserun-name example  =logger hello world
    No platform selected. Autodetecting... {:platform=>"systemd", :version=>"default", :level=>:warn}
    Writing file {:destination=>"/tmp/package-pleaserun-staging20160513-12576-1ozurnf/lib/systemd/system/example.service"}
    Writing install actions. You will want to run this script to properly activate your service on the target host {:path=>"/tmp/package-pleaserun-staging20160513-12576-1ozurnf/install_actions.sh"}
    Created package {:path=>"example-service-1.0-1.x86_64.rpm"}

    # ^^ The above service will execute "logger hello world"

    # What's in our rpm?
    % rpm -qlp example-service-1.0-1.x86_64.rpm
    /lib/systemd/system/example.service

    # What about any post-install steps?
    % rpm -qp example-service-1.0-1.x86_64.rpm --scripts
    postinstall scriptlet (using /bin/sh):
    systemctl --system daemon-reload

    # Install it.
    % sudo rpm -ivh example-service-1.0-1.x86_64.rpm

    # Start it.
    % sudo systemctl start example

    # Check the logs!
    % sudo tail -n1 /var/log/messages
    May 13 03:32:55 localhost root: hello world

Example choosing 'sysv' as the platform:

    % bin/fpm -s pleaserun -t rpm -n example-service --pleaserun-platform sysv --pleaserun-name example  =logger hello world
    Writing file
    {:destination=>"/tmp/package-pleaserun-staging20160513-13675-xae6xd/etc/init.d/example"}
    Writing file
    {:destination=>"/tmp/package-pleaserun-staging20160513-13675-xae6xd/etc/default/example"}
    Created package {:path=>"example-service-1.0-1.x86_64.rpm"}

    % rpm -qlp example-service-1.0-1.x86_64.rpm
    /etc/default/example
    /etc/init.d/example
Make copying not rely on rsync. Also tell the user if no platform was…
… detected.

Also move files to be /platform/version/... instead of
/platform-version/...
Some small fixes
* Only try install actions if they exist
* Add special case for Upstart 0.6.5 (CentOS 6)
Write scripts to tar and dir package outputs
The scripts will be written to the top-level `.scripts/` directory
Refactor. Also now we attempt cleanup upon package removal.
The `install.sh` will generate a cleanup.sh script that is executed when
the package is removed.
If no description is given, set the description to the pleaserun_name…
…. Without this, the default is 'no description given' which is not a helpful default
Merge pull request #1115 from josegonzalez/patch-1
Drop duplicate .conf suffix
Add --python-setup-py-arguments flag which can be used to pass arbitrary
arguments to setup.py.

This is helpful to package python modules that have a poorly written
setup.py that requires special arguments.

@jordansissel jordansissel force-pushed the jordansissel:master branch from 7b71484 to e0ec0f3 Jun 20, 2016

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Jun 20, 2016

I just did some maintenance on the git history in the fpm repo. In doing so, I messed up this PR. You may have to rebase against master. Let me know if you need help doing this.

@josephholsten

This comment has been minimized.

Collaborator

josephholsten commented Jul 21, 2017

fixed with rebase in #1376. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment