Browse Source

improve prerequisite installation handling

prereq
Sebastian Heimann 8 months ago
committed by Pyrocko Test Debugger
parent
commit
d877af2768
27 changed files with 142 additions and 186 deletions
  1. +13
    -12
      README.md
  2. +63
    -0
      install_prerequisites.py
  3. +1
    -1
      maintenance/vagrant/arch/inside.sh
  4. +2
    -5
      maintenance/vagrant/arch/outside.sh
  5. +4
    -10
      maintenance/vagrant/centos-7-anaconda-3/outside.sh
  6. +4
    -2
      maintenance/vagrant/centos-7/inside.sh
  7. +4
    -10
      maintenance/vagrant/centos-7/outside.sh
  8. +0
    -6
      maintenance/vagrant/debian-10/Vagrantfile
  9. +2
    -2
      maintenance/vagrant/debian-10/inside.sh
  10. +5
    -5
      maintenance/vagrant/debian-10/outside.sh
  11. +2
    -2
      maintenance/vagrant/debian-8/inside.sh
  12. +2
    -5
      maintenance/vagrant/debian-8/outside.sh
  13. +2
    -2
      maintenance/vagrant/debian-9/inside.sh
  14. +2
    -5
      maintenance/vagrant/debian-9/outside.sh
  15. +2
    -2
      maintenance/vagrant/opensuse-42.1/inside.sh
  16. +2
    -5
      maintenance/vagrant/opensuse-42.1/outside.sh
  17. +3
    -5
      maintenance/vagrant/osx/outside.sh
  18. +2
    -2
      maintenance/vagrant/ubuntu-14.04-32bit/inside.sh
  19. +2
    -5
      maintenance/vagrant/ubuntu-14.04-32bit/outside.sh
  20. +2
    -2
      maintenance/vagrant/ubuntu-14.04/inside.sh
  21. +2
    -5
      maintenance/vagrant/ubuntu-14.04/outside.sh
  22. +2
    -2
      maintenance/vagrant/ubuntu-16.04/inside.sh
  23. +2
    -5
      maintenance/vagrant/ubuntu-16.04/outside.sh
  24. +2
    -2
      maintenance/vagrant/ubuntu-18.04/inside.sh
  25. +2
    -5
      maintenance/vagrant/ubuntu-18.04/outside.sh
  26. +8
    -0
      pyproject.toml
  27. +5
    -79
      setup.py

+ 13
- 12
README.md View File

@ -7,29 +7,30 @@
## Installation
Full installation instructions are available at
Full installation instructions are available at
https://pyrocko.org/docs/current/install/.
### Installation from source
### System wide installation from source
```
git clone https://git.pyrocko.org/pyrocko/pyrocko
cd pyrocko
sudo python setup.py install_prerequisites
sudo python install_prerequisites.py
sudo python setup.py install
```
### Anaconda / MacOSX
### Installation with Anaconda / MacOSX
```
conda install -c pyrocko pyrocko
```
Anaconda2/3 Packages are available for Linux and OSX
### Python PIP
### User installation with Python PIP
```
sudo pip install pyrocko
pip install --user pyrocko
pip install --user --only-binary :all: PyQt5
```
or from source
@ -37,8 +38,8 @@ or from source
```
git clone https://git.pyrocko.org/pyrocko/pyrocko
cd pyrocko
sudo pip install -r requirements.txt
sudo pip install .
pip install --user -r requirements.txt
pip install --user .
```
@ -58,7 +59,7 @@ The recommended citation for Pyrocko is: (You can find the BibTeX snippet in the
[![DOI](https://img.shields.io/badge/DOI-10.5880%2FGFZ.2.1.2017.001-blue.svg)](https://doi.org/10.5880/GFZ.2.1.2017.001)
## License
## License
GNU General Public License, Version 3, 29 June 2007
Copyright © 2017 Helmholtz Centre Potsdam GFZ German Research Centre for Geosciences, Potsdam, Germany
@ -68,13 +69,13 @@ Pyrocko is distributed in the hope that it will be useful, but WITHOUT ANY WARRA
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
## Contact
* Sebastian Heimann;
* Sebastian Heimann;
sebastian.heimann@gfz-potsdam.de
* Marius Isken;
* Marius Isken;
marius.isken@gfz-potsdam.de
* Marius Kriegerowski;
* Marius Kriegerowski;
marius.kriegerowski@gfz-potsdam.de
```


+ 63
- 0
install_prerequisites.py View File

@ -0,0 +1,63 @@
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import platform
import sys
import os
if '--help' in sys.argv[1:] or '-h' in sys.argv[1:]:
sys.exit('''usage: install_prerequisites.py [--yes] [--help]
Try to install Pyrocko's prerequisites through your system's native package
manager. This script simply calls a shell script (see under `prerequisites/`)
appropriate for your system and Python version.
Options:
--yes Do not ask any questions (batch mode).
--help Show this help message and exit
''')
force_yes = '--yes' in sys.argv[1:]
distribution = ''
try:
distribution = platform.linux_distribution()[0].lower().rstrip()
except Exception:
pass
if not distribution:
try:
if platform.uname()[2].find('arch') != -1:
distribution = 'arch'
except Exception:
pass
if not distribution:
sys.exit(
'Cannot determine platform for automatic prerequisite installation.')
if distribution == 'ubuntu':
distribution = 'debian'
if distribution.startswith('centos'):
distribution = 'centos'
fn = 'prerequisites/prerequisites_%s_python%i.sh' % (
distribution, sys.version_info.major)
if not force_yes:
try:
input_func = raw_input
except NameError:
input_func = input
confirm = input_func('Execute: %s \n\
proceed? [y/n]' % open(fn, 'r').read())
if not confirm.lower() == 'y':
sys.exit(0)
os.execl('/bin/sh', 'sh', fn)

+ 1
- 1
maintenance/vagrant/arch/inside.sh View File

@ -33,7 +33,7 @@ ln -s "/vagrant/example_run_dir" "test/example_run_dir"
mkdir -p "$HOME/.config/matplotlib"
echo "backend : agg" > "$HOME/.config/matplotlib/matplotlibrc"
python3 setup.py install_prerequisites --force-yes && \
python3 install_prerequisites.py --yes && \
sudo python3 setup.py install -f && \
python3 -m pyrocko.print_version deps >> "$outfile_py3" && \
xvfb-run -s '-screen 0 640x480x24' python3 -m nose "$thetest" > >(tee -a "$outfile_py3") 2> >(tee -a "$outfile_py3" >&2) || \


+ 2
- 5
maintenance/vagrant/arch/outside.sh View File

@ -14,15 +14,12 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf example_run_dir pyrocko.git *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up


+ 4
- 10
maintenance/vagrant/centos-7-anaconda-3/outside.sh View File

@ -14,24 +14,18 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ ! -d "pyrocko-test-data" ]; then
cp -R "../../../test/data" pyrocko-test-data
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf pyrocko.git pyrocko-test-data example_run_dir *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/data" pyrocko-test-data
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up
vagrant rsync
vagrant ssh -- -X /vagrant/inside.sh $branch $thetest > >(tee -a "log.out") 2> >(tee -a "log.out" >&2) || /bin/true
vagrant ssh -- -X /vagrant/inside.sh "$branch" "$thetest" > >(tee -a "log.out") 2> >(tee -a "log.out" >&2) || /bin/true
vagrant rsync-back || ( vagrant plugin install vagrant-rsync-back && vagrant rsync-back )
vagrant halt
date -uIseconds >> log.out

+ 4
- 2
maintenance/vagrant/centos-7/inside.sh View File

@ -14,8 +14,10 @@ fi
pyrockodir="pyrocko-$branch"
outfile_py3="/vagrant/test-$branch.py3.out"
outfile_py2="/vagrant/test-$branch.py2.out"
rm -f "$outfile_py3"
rm -f "$outfile_py2"
cd $HOME
sudo yum -y install git make gcc mesa-libGL
@ -46,8 +48,8 @@ python setup.py install -f && \
/bin/true
python2=/usr/bin/python2
"$python2" setup.py install_prerequisites
"$python2" setup.py install -f && \
sudo "$python2" install_prerequisites.py --yes && \
sudo "$python2" setup.py install -f && \
"$python2" -m pyrocko.print_version deps >> "$outfile_py2" && \
"$python2" -m nose "$thetest" > >(tee -a "$outfile_py2") 2> >(tee -a "$outfile_py2" >&2) || \
/bin/true

+ 4
- 10
maintenance/vagrant/centos-7/outside.sh View File

@ -14,24 +14,18 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ ! -d "pyrocko-test-data" ]; then
cp -R "../../../test/data" pyrocko-test-data
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf pyrocko.git pyrocko-test-data example_run_dir *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/data" pyrocko-test-data
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up
vagrant rsync
vagrant ssh -- -X /vagrant/inside.sh $branch $thetest > >(tee -a "log.out") 2> >(tee -a "log.out" >&2) || /bin/true
vagrant ssh -- -X /vagrant/inside.sh "$branch" "$thetest" > >(tee -a "log.out") 2> >(tee -a "log.out" >&2) || /bin/true
vagrant rsync-back || ( vagrant plugin install vagrant-rsync-back && vagrant rsync-back )
vagrant halt
date -uIseconds >> log.out

+ 0
- 6
maintenance/vagrant/debian-10/Vagrantfile View File

@ -2,12 +2,6 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "debian/buster64"
config.vm.synced_folder "../../../test/data", "/pyrocko-test-data",
type: "rsync",
rsync__chown: false
config.vm.synced_folder ".", "/vagrant",
type: "rsync",
rsync__chown: false
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "3072"]
end


+ 2
- 2
maintenance/vagrant/debian-10/inside.sh View File

@ -36,13 +36,13 @@ cd "$pyrockodir"
ln -s "/pyrocko-test-data" "test/data"
ln -s "/vagrant/example_run_dir" "test/example_run_dir"
python3 setup.py install_prerequisites --force-yes && \
sudo python3 install_prerequisites.py --yes && \
sudo python3 setup.py install -f && \
python3 -m pyrocko.print_version deps >> "$outfile_py3" && \
xvfb-run -s '-screen 0 640x480x24' python3 -m nose "$thetest" > >(tee -a "$outfile_py3") 2> >(tee -a "$outfile_py3" >&2) || \
/bin/true
python2 setup.py install_prerequisites --force-yes && \
sudo python2 install_prerequisites.py --yes && \
sudo python2 setup.py install -f && \
python2 -m pyrocko.print_version deps >> "$outfile_py2" && \
xvfb-run -s '-screen 0 640x480x24' python2 -m nose "$thetest" > >(tee -a "$outfile_py2") 2> >(tee -a "$outfile_py2" >&2) || \


+ 5
- 5
maintenance/vagrant/debian-10/outside.sh View File

@ -14,18 +14,18 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf pyrocko.git pyrocko-test-data example_run_dir *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/data" pyrocko-test-data
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up
vagrant rsync
vagrant ssh -- -X /vagrant/inside.sh "$branch" "$thetest" > >(tee -a "log.out") 2> >(tee -a "log.out" >&2) || /bin/true
vagrant rsync-back || ( vagrant plugin install vagrant-rsync-back && vagrant rsync-back )
vagrant halt
date -uIseconds >> log.out

+ 2
- 2
maintenance/vagrant/debian-8/inside.sh View File

@ -36,13 +36,13 @@ cd "$pyrockodir"
ln -s "/pyrocko-test-data" "test/data"
ln -s "/vagrant/example_run_dir" "test/example_run_dir"
python3 setup.py install_prerequisites --force-yes && \
sudo python3 install_prerequisites.py --yes && \
sudo python3 setup.py install -f && \
python3 -m pyrocko.print_version deps >> "$outfile_py3" && \
xvfb-run python3 -m nose "$thetest" > >(tee -a "$outfile_py3") 2> >(tee -a "$outfile_py3" >&2) || \
/bin/true
python2 setup.py install_prerequisites --force-yes && \
sudo python2 install_prerequisites.py --yes && \
sudo python2 setup.py install -f && \
python2 -m pyrocko.print_version deps >> "$outfile_py2" && \
xvfb-run python2 -m nose "$thetest" > >(tee -a "$outfile_py2") 2> >(tee -a "$outfile_py2" >&2) || \


+ 2
- 5
maintenance/vagrant/debian-8/outside.sh View File

@ -14,15 +14,12 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf example_run_dir pyrocko.git *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up


+ 2
- 2
maintenance/vagrant/debian-9/inside.sh View File

@ -36,13 +36,13 @@ cd "$pyrockodir"
ln -s "/pyrocko-test-data" "test/data"
ln -s "/vagrant/example_run_dir" "test/example_run_dir"
python3 setup.py install_prerequisites --force-yes && \
sudo python3 install_prerequisites.py --yes && \
sudo python3 setup.py install -f && \
python3 -m pyrocko.print_version deps >> "$outfile_py3" && \
xvfb-run -s '-screen 0 640x480x24' python3 -m nose "$thetest" > >(tee -a "$outfile_py3") 2> >(tee -a "$outfile_py3" >&2) || \
/bin/true
python2 setup.py install_prerequisites --force-yes && \
sudo python2 install_prerequisites.py --yes && \
sudo python2 setup.py install -f && \
python2 -m pyrocko.print_version deps >> "$outfile_py2" && \
xvfb-run -s '-screen 0 640x480x24' python2 -m nose "$thetest" > >(tee -a "$outfile_py2") 2> >(tee -a "$outfile_py2" >&2) || \


+ 2
- 5
maintenance/vagrant/debian-9/outside.sh View File

@ -14,15 +14,12 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf example_run_dir pyrocko.git *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up


+ 2
- 2
maintenance/vagrant/opensuse-42.1/inside.sh View File

@ -32,13 +32,13 @@ cd "$pyrockodir"
ln -s "/pyrocko-test-data" "test/data"
ln -s "/vagrant/example_run_dir" "test/example_run_dir"
python3 setup.py install_prerequisites --force-yes && \
sudo python3 install_prerequisites.py --yes && \
sudo python3 setup.py install -f && \
python3 -m pyrocko.print_version deps >> "$outfile_py3" && \
python3 -m nose "$thetest" > >(tee -a "$outfile_py3") 2> >(tee -a "$outfile_py3" >&2) || \
/bin/true
python2 setup.py install_prerequisites --force-yes && \
sudo python2 install_prerequisites.py --yes && \
sudo python2 setup.py install -f && \
python2 -m pyrocko.print_version deps >> "$outfile_py2" && \
python2 -m nose "$thetest" > >(tee -a "$outfile_py2") 2> >(tee -a "$outfile_py2" >&2) || \


+ 2
- 5
maintenance/vagrant/opensuse-42.1/outside.sh View File

@ -14,15 +14,12 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf example_run_dir pyrocko.git *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up


+ 3
- 5
maintenance/vagrant/osx/outside.sh View File

@ -14,15 +14,13 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf pyrocko.git pyrocko-test-data example_run_dir *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/data" pyrocko-test-data
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up


+ 2
- 2
maintenance/vagrant/ubuntu-14.04-32bit/inside.sh View File

@ -35,13 +35,13 @@ cd "$pyrockodir"
ln -s "/pyrocko-test-data" "test/data"
ln -s "/vagrant/example_run_dir" "test/example_run_dir"
python3 setup.py install_prerequisites --force-yes && \
sudo python3 install_prerequisites.py --yes && \
sudo python3 setup.py install -f && \
python3 -m pyrocko.print_version deps >> "$outfile_py3" && \
xvfb-run python3 -m nose "$thetest" > >(tee -a "$outfile_py3") 2> >(tee -a "$outfile_py3" >&2) || \
/bin/true
python2 setup.py install_prerequisites --force-yes && \
sudo python2 install_prerequisites.py --yes && \
sudo python2 setup.py install -f && \
python2 -m pyrocko.print_version deps >> "$outfile_py2" && \
xvfb-run python2 -m nose "$thetest" > >(tee -a "$outfile_py2") 2> >(tee -a "$outfile_py2" >&2) || \


+ 2
- 5
maintenance/vagrant/ubuntu-14.04-32bit/outside.sh View File

@ -14,15 +14,12 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf example_run_dir pyrocko.git *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up


+ 2
- 2
maintenance/vagrant/ubuntu-14.04/inside.sh View File

@ -35,13 +35,13 @@ cd "$pyrockodir"
ln -s "/pyrocko-test-data" "test/data"
ln -s "/vagrant/example_run_dir" "test/example_run_dir"
python3 setup.py install_prerequisites --force-yes && \
sudo python3 install_prerequisites.py --yes && \
sudo python3 setup.py install -f && \
python3 -m pyrocko.print_version deps >> "$outfile_py3" && \
xvfb-run python3 -m nose "$thetest" > >(tee -a "$outfile_py3") 2> >(tee -a "$outfile_py3" >&2) || \
/bin/true
python2 setup.py install_prerequisites --force-yes && \
sudo python2 install_prerequisites.py --yes && \
sudo python2 setup.py install -f && \
python2 -m pyrocko.print_version deps >> "$outfile_py2" && \
xvfb-run python2 -m nose "$thetest" > >(tee -a "$outfile_py2") 2> >(tee -a "$outfile_py2" >&2) || \


+ 2
- 5
maintenance/vagrant/ubuntu-14.04/outside.sh View File

@ -14,15 +14,12 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf example_run_dir pyrocko.git *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up


+ 2
- 2
maintenance/vagrant/ubuntu-16.04/inside.sh View File

@ -35,13 +35,13 @@ cd "$pyrockodir"
ln -s "/pyrocko-test-data" "test/data"
ln -s "/vagrant/example_run_dir" "test/example_run_dir"
python3 setup.py install_prerequisites --force-yes && \
sudo python3 install_prerequisites.py --yes && \
sudo python3 setup.py install -f && \
python3 -m pyrocko.print_version deps >> "$outfile_py3" && \
xvfb-run -s '-screen 0 640x480x24' python3 -m nose "$thetest" > >(tee -a "$outfile_py3") 2> >(tee -a "$outfile_py3" >&2) || \
/bin/true
python2 setup.py install_prerequisites --force-yes && \
sudo python2 install_prerequisites.py --yes && \
sudo python2 setup.py install -f && \
python2 -m pyrocko.print_version deps >> "$outfile_py2" && \
xvfb-run -s '-screen 0 640x480x24' python2 -m nose "$thetest" > >(tee -a "$outfile_py2") 2> >(tee -a "$outfile_py2" >&2) || \


+ 2
- 5
maintenance/vagrant/ubuntu-16.04/outside.sh View File

@ -14,15 +14,12 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf example_run_dir pyrocko.git *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up


+ 2
- 2
maintenance/vagrant/ubuntu-18.04/inside.sh View File

@ -34,13 +34,13 @@ cd "$pyrockodir"
ln -s "/pyrocko-test-data" "test/data"
ln -s "/vagrant/example_run_dir" "test/example_run_dir"
python3 setup.py install_prerequisites --force-yes && \
sudo python3 install_prerequisites.py --yes && \
sudo python3 setup.py install -f && \
python3 -m pyrocko.print_version deps >> "$outfile_py3" && \
xvfb-run -s '-screen 0 640x480x24' python3 -m nose "$thetest" > >(tee -a "$outfile_py3") 2> >(tee -a "$outfile_py3" >&2) || \
/bin/true
python2 setup.py install_prerequisites --force-yes && \
sudo python2 install_prerequisites.py --yes && \
sudo python2 setup.py install -f && \
python2 -m pyrocko.print_version deps >> "$outfile_py2" && \
xvfb-run -s '-screen 0 640x480x24' python2 -m nose "$thetest" > >(tee -a "$outfile_py2") 2> >(tee -a "$outfile_py2" >&2) || \


+ 2
- 5
maintenance/vagrant/ubuntu-18.04/outside.sh View File

@ -14,15 +14,12 @@ if [ -z "$thetest" ]; then
thetest="test"
fi
if [ -d "pyrocko.git" ]; then
rm -rf "pyrocko.git"
fi
rm -rf example_run_dir pyrocko.git *.out *.log
git clone --bare "../../.." "pyrocko.git"
cp -r "../../../test/example_run_dir" "."
cp -a "../../../test/example_run_dir" example_run_dir
echo "testing branch: $branch"
echo "running test: $thetest"
rm -f log.out
echo "testing branch $branch" >> log.out
date -uIseconds >> log.out
vagrant up


+ 8
- 0
pyproject.toml View File

@ -0,0 +1,8 @@
# Build dependencies as advocated by PEP 518.
#
# https://www.python.org/dev/peps/pep-0518/
#
# Supersedes use of `setup_requires` in `setup.py`.
[build-system]
requires = ["setuptools", "wheel", "numpy>=1.8"]

+ 5
- 79
setup.py View File

@ -5,17 +5,7 @@ import os.path as op
import time
import shutil
import tempfile
try:
import numpy
except ImportError:
# numpy might not be available when running install_prerequisites
class numpy():
def __init__(self):
pass
@classmethod
def get_include(self):
return None
import numpy
from distutils.sysconfig import get_python_inc
from setuptools import setup, Extension, Command
@ -322,70 +312,6 @@ class CustomInstallCommand(install):
% bd_dir)
class InstallPrerequisits(Command):
description = '''install prerequisites with system package manager'''
user_options = [
('force-yes', None, 'Do not ask for confirmation to install')]
def initialize_options(self):
self.force_yes = False
def finalize_options(self):
pass
def run(self):
from subprocess import Popen, PIPE, STDOUT
import platform
distribution = ''
try:
distribution = platform.linux_distribution()[0].lower().rstrip()
except Exception:
pass
if not distribution:
try:
if platform.uname()[2].find('arch') != -1:
distribution = 'arch'
except Exception:
pass
if not distribution:
sys.exit(
'cannot determine platform for automatic prerequisite '
'installation')
if distribution == 'ubuntu':
distribution = 'debian'
if distribution.startswith('centos'):
distribution = 'centos'
fn = 'prerequisites/prerequisites_%s_python%i.sh' % (
distribution, sys.version_info.major)
if not self.force_yes:
try:
input_func = raw_input
except NameError:
input_func = input
confirm = input_func('Execute: %s \n\
proceed? [y/n]' % open(fn, 'r').read())
if not confirm.lower() == 'y':
sys.exit(0)
p = Popen(['sh', fn], stdin=PIPE, stdout=PIPE, stderr=STDOUT,
shell=False)
while p.poll() is None:
print(p.stdout.readline().decode(
'ascii', errors='replace').rstrip())
print(p.stdout.read().decode('ascii', errors='replace'))
class CustomBuildPyCommand(build_py):
def make_compat_modules(self):
@ -616,7 +542,6 @@ cmdclass = {
# 'py2app': CustomBuildAppCommand,
'build_ext': CustomBuildExtCommand,
'check_multiple_install': CheckInstalls,
'install_prerequisites': InstallPrerequisits,
'uninstall': Uninstall}
if CustomBDistWheelCommand:
@ -653,9 +578,10 @@ setup(
'seismology, waveform analysis, earthquake modelling, geophysics,'
' geophysical inversion'],
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4',
setup_requires=[
'numpy>=1.8'
],
# Removed in favor of PEP 518 advocating `pyproject.toml`:
# setup_requires=[
# 'numpy>=1.8'
# ],
install_requires=[
'numpy>=1.8',
'scipy',


Loading…
Cancel
Save