Skip to content

Commit 7aab038

Browse files
committed
Use "pip install" instead of "python setup.py install"
Add python3-pip as build dependency
1 parent 81c34df commit 7aab038

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

.github/workflows/ubuntu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: |
2323
echo "Europe/London" > /etc/timezone
2424
apt-get -y update
25-
DEBIAN_FRONTEND=noninteractive apt-get -y install gfortran g++ python3-setuptools python3-all-dev debhelper dh-python texlive python3-junit.xml
25+
DEBIAN_FRONTEND=noninteractive apt-get -y install gfortran g++ python3-setuptools python3-pip python3-all-dev debhelper dh-python texlive python3-junit.xml
2626
2727
- name: Configuring
2828
run: ./configure --prefix=/tmp

Makefile.in

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ VPATH = src/
5151
.cpp.lo:
5252
./libtool --mode=compile --tag=CXX $(CXX) $(CXXFLAGS) -c $<
5353

54-
default: libspud.la build-diamond
54+
default: libspud.la build-diamond build-pyspud
5555

5656
libspud.la: $(OBJS)
5757
./libtool --mode=link --tag=FC $(FC) $(FCFLAGS) -o $(LIB) $(OBJS) $(LIBS) -rpath @prefix@/lib
@@ -61,6 +61,9 @@ libspud.la: $(OBJS)
6161
build-diamond:
6262
cd diamond; python3 setup.py build; cd ..
6363

64+
build-pyspud: libspud.la
65+
cd python; python3 setup.py build; cd ..
66+
6467
test: unittest
6568

6669
unittest: libspud.la
@@ -95,13 +98,13 @@ install-spudtools:
9598
@INSTALL@ -m644 schema/spud_base.rng $(DESTDIR)@prefix@/share/spud
9699

97100
install-diamond:
98-
cd diamond; python3 setup.py install --prefix=$(DESTDIR)@prefix@; cd ..
101+
python3 -mpip install --prefix=$(DESTDIR)@prefix@ diamond/
99102

100103
install-pyspud:
101-
cd python; python3 setup.py install --prefix=$(DESTDIR)@prefix@; cd ..
104+
python3 -mpip install --prefix=$(DESTDIR)@prefix@ python/
102105

103106
install-dxdiff:
104-
cd dxdiff; python3 setup.py install --prefix=$(DESTDIR)@prefix@; cd ..
107+
python3 -mpip install --prefix=$(DESTDIR)@prefix@ dxdiff/
105108

106109
clean:
107110
@cd doc; $(MAKE) clean

debian/control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Maintainer: The ICOM team <patrick.farrell@imperial.ac.uk>
33
Uploaders: David Ham <david.ham@imperial.ac.uk>
44
Section: science
55
Priority: optional
6-
Build-Depends: gfortran (>=4.2), g++ (>=4.2), python3-setuptools (>= 39), python3-all-dev (>= 2.3.5-11), debhelper (>= 5.0.38), dh-python, texlive
6+
Build-Depends: gfortran (>=4.2), g++ (>=4.2), python3-setuptools (>= 39), python3-pip, python3-all-dev , debhelper (>= 5.0.38), dh-python, texlive
77
Standards-Version: 3.8.0
88
X-Python3-Version: >= 3.6
99

python/setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,12 @@
66
description='Python bindings for libspud',
77
ext_modules=[Extension('libspud', sources=['libspud.c'],
88
libraries=["spud"],
9+
# path to libspud (the actual library, not the c-extension python wrapper
10+
# which will be put in the parent directory by "make libspud.la"
11+
# NOTE: For this to work you have to run "python setup.py build" from the
12+
# original directory of the current file separately before
13+
# running pip install, as pip will build the extension (if it's not built already)
14+
# outside of the current context
915
library_dirs=[abspath("..")],
16+
# path to spud.h
1017
include_dirs=[abspath("../include")])])

0 commit comments

Comments
 (0)