Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
ruby-version: ['2.7', '3.0', '3.1', '3.4']
Expand All @@ -20,7 +20,8 @@ jobs:
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: |
- name: Run test suite
run: |
if [ ! -z "$RUNNER_DEBUG" ] ; then
DEBUG=1 bundle exec rspec -fd
else
Expand Down
1 change: 1 addition & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Some package formats require other tools to be installed on your machine to be b

* RPM: rpm/rpm-tools/rpm-build [This dependency might be removed in the future, see `issue #54`_ on github]
* Snap: squashfs/squashfs-tools
* Python: a requirements.txt file is provided to list Python dependencies: `$ pip install -r requirements.txt`

.. _issue #54: https://github.com/jordansissel/fpm/issues/54

Expand Down
115 changes: 0 additions & 115 deletions lib/fpm/package/pyfpm/get_metadata.py

This file was deleted.

6 changes: 3 additions & 3 deletions lib/fpm/package/pyfpm/parse_requires.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#import pkg_resources
import packaging.requirements
import packaging.markers
import json
import sys

Expand All @@ -11,10 +12,9 @@
# Process environment markers, if any, and produce a list of requirements for the current environment.
def evaluate_requirements(fd):
all_requirements = [packaging.requirements.Requirement(line) for line in sys.stdin]

default_env = packaging.markers.default_environment()
for req in all_requirements:
# XXX: Note: marker.evaluate() can be given a dict() containing environment values to overwrite
if req.marker is None or req.marker.evaluate():
if req.marker is None or req.marker.evaluate(environment=default_env):
if len(req.specifier) > 0:
for spec in req.specifier:
yield "%s%s" % (req.name, spec)
Expand Down
2 changes: 1 addition & 1 deletion lib/fpm/package/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def install_to_staging(path)
flags = [ "--root", staging_path ]
flags += [ "--prefix", prefix ] if !attributes[:prefix].nil?

safesystem(*attributes[:python_pip], "install", "--no-deps", *flags, path)
safesystem(*attributes[:python_pip], "install", "--no-deps", "--ignore-installed", *flags, path)
end # def install_to_staging

public(:input)
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Listing of fpm's Python package dependencies
packaging
Copy link
Owner

Choose a reason for hiding this comment

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

It also requires pip which isn't installed by default on Ubuntu (for example) when installing python3.

In the absence of a dependency (rpmbuild, tar, ar, python packaging, python wheel, python pip, etc), I would prefer fpm to detect this and provide the user with an actionable error message. At present (noted in #2118), it crashes with a stack trace which isn't very user friendly.

At some point, I may try to provide rpm/deb packages of fpm which express these dependencies.

(No change required, just documenting my thoughts on this specific item)

Copy link
Contributor

Choose a reason for hiding this comment

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

Great notes, thanks @jordansissel !
Yes we definitely need to be aware of the missing pip requirement issues as @NicholasBHubbard and I continue with this development path.

2 changes: 1 addition & 1 deletion spec/fpm/package/deb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ def dpkg_field(field)
subject.attributes[:deb_user] = "root"
subject.attributes[:deb_group] = "root"
subject.category = "comm"
subject.dependencies << "lsb-base"
subject.dependencies << "debconf"

subject.instance_variable_set(:@staging_path, staging_path)

Expand Down
2 changes: 2 additions & 0 deletions spec/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Listing of fpm test-suite's Python package dependencies
setuptools