Skip to content

Commit

Permalink
Clean up installation procedure with pip (#4)
Browse files Browse the repository at this point in the history
* Move dependencies list from 'requirements.txt' to 'setup.py'.

* Move library version to separate file.

NOTE: gelato now provides version to user:

In [1]: import gelato; gelato.__version__
Out[1]: '0.9.3'

* Enable tests with Python-3.7.

* Update __version__
  • Loading branch information
yguclu authored and ratnania committed Aug 30, 2019
1 parent 83b7557 commit 458911e
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 22 deletions.
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ python:
- "3.5"
- "3.6"

# Enable 3.7 without globally enabling 'dist: xenial' for other build jobs
matrix:
include:
- python: 3.7
dist: xenial

# Cache directory $HOME/.cache/pip
cache: pip

# command before installation: install all dependencies and run CMAKE config
before_install:
- python -m pip install --upgrade pip
- python -m pip install -r requirements.txt
- python -m pip uninstall -y sympde
- wget https://raw.githubusercontent.com/pyccel/sympde/master/requirements.txt -O requirements_sympde.txt
- python -m pip install -r requirements_sympde.txt
- python -m pip install git+https://github.com/pyccel/sympde@master
- python -m pip uninstall -y gelato

# command to install project
install:
Expand Down
1 change: 1 addition & 0 deletions gelato/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: UTF-8 -*-
from .version import __version__
from .expr import *
from .glt import *
from .printing import *
Expand Down
1 change: 1 addition & 0 deletions gelato/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.9.4'
11 changes: 0 additions & 11 deletions requirements.txt

This file was deleted.

31 changes: 24 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# -*- coding: UTF-8 -*-
#! /usr/bin/python

import sys
from pathlib import Path
from setuptools import setup, find_packages

# ...
# Read library version into '__version__' variable
path = Path(__file__).parent / 'gelato' / 'version.py'
exec(path.read_text())
# ...

NAME = 'gelato'
VERSION = '0.9.3'
VERSION = __version__
AUTHOR = 'Ahmed Ratnani'
EMAIL = 'ahmed.ratnani@ipp.mpg.de'
URL = 'https://github.com/ratnania/GeLaTo'
Expand All @@ -26,17 +32,28 @@
# download_url = URL+'/tarball/master',
)

install_requires = [

# Third-party libraries from PyPi
'sympy>=1.2',
'numpy>=1.13',
'scipy>=0.18',
'matplotlib',

# Our libraries from PyPi
'sympde',
]

# ...
packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"])
# ...

def setup_package():
if 'setuptools' in sys.modules:
setup_args['install_requires'] = ['numpy']

setup(packages = packages, \
include_package_data = True, \
zip_safe=True, \
setup(packages = packages,
include_package_data = True,
install_requires = install_requires,
zip_safe = True,
**setup_args)


Expand Down

0 comments on commit 458911e

Please sign in to comment.