Skip to content

Commit

Permalink
Cleanup of setup.py (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored Mar 30, 2020
1 parent 5aa7943 commit 0619f09
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 62 deletions.
10 changes: 6 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ before_install:

install:
- ls
- pip install -r requirements_dev.txt
- pip install .
- pip install .[tests]

script:
- python -c "import fmu.ensemble"
- python setup.py test
- pip install pyarrow
- pytest -s tests/test_virtualensemble.py
- pytest tests/
- pip install .[parquet]
- pytest tests/test_virtualensemble.py
- sphinx-apidoc -H "API for fmu.ensemble" -o ./docs ./src/fmu
- python setup.py build_sphinx
- touch build/sphinx/html/.nojekyll

deploy:
- provider: pages
Expand Down
7 changes: 0 additions & 7 deletions requirements.txt

This file was deleted.

19 changes: 0 additions & 19 deletions requirements_dev.txt

This file was deleted.

63 changes: 31 additions & 32 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,71 @@
# -*- coding: utf-8 -*-

"""The setup script."""
from glob import glob
import os
from os.path import basename
from os.path import splitext

from setuptools import setup, find_packages
from sphinx.setup_command import BuildDoc

try:
from sphinx.setup_command import BuildDoc

cmdclass = {"build_sphinx": BuildDoc}
except ImportError:
# sphinx not installed - do not provide build_sphinx cmd
cmdclass = {}


with open("README.rst") as readme_file:
readme = readme_file.read()

with open("HISTORY.rst") as history_file:
history = history_file.read()

REQUIREMENTS = [
"libecl",
"numpy",
"pandas>0.23.0",
"pyyaml>=5.1",
"six>=1.12.0",
]

def relpath(*args):
"""Return path of args relative to this file"""
root = os.path.dirname(__file__)
if isinstance(args, str):
return os.path.join(root, args)
return os.path.join(root, *args)


def parse_requirements(filename):
"""Load requirements from a pip requirements file"""
try:
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter if line and not line.startswith("#")]
except IOError:
return []


REQUIREMENTS = parse_requirements("requirements.txt")

SETUP_REQUIREMENTS = ["pytest-runner", "setuptools>=28", "setuptools_scm"]
SETUP_REQUIREMENTS = ["setuptools>=28", "setuptools_scm"]

TEST_REQUIREMENTS = parse_requirements("requirements_dev.txt")
TEST_REQUIREMENTS = [
"flake8>=2.6.0",
"pylint",
"pytest>=2.9.2",
"pyyaml>=5.1",
"sphinx>=1.4.8",
"sphinx_rtd_theme>=0.4.1",
]

EXTRAS_REQUIRE = {"Parquet": ["pyarrow"]}
EXTRAS_REQUIRE = {"tests": TEST_REQUIREMENTS, "parquet": ["pyarrow"]}

setup(
name="fmu-ensemble",
use_scm_version={"write_to": "src/fmu/ensemble/version.py"},
cmdclass={"build_sphinx": BuildDoc},
cmdclass=cmdclass,
description="Python API to ensembles produced by ERT",
long_description=readme + "\n\n" + history,
author="Håvard Berland",
author_email="[email protected]",
url="https://git.equinor.com/equinor/fmu-ensemble",
url="https://github.com/equinor/fmu-ensemble",
license="GPLv3",
packages=find_packages("src"),
package_dir={"": "src"},
py_modules=[splitext(basename(path))[0] for path in glob("src/*.py")],
include_package_data=True,
install_requires=REQUIREMENTS,
zip_safe=False,
keywords="fmu, ensemble",
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
test_suite="tests",
tests_require=TEST_REQUIREMENTS,
Expand Down

0 comments on commit 0619f09

Please sign in to comment.