Skip to content

Commit

Permalink
Add minimal package versions for requirements.txt (#804)
Browse files Browse the repository at this point in the history
* Minimal requirements.txt update

* small pylint fix

* update optional pip
  • Loading branch information
ahartikainen authored and aloctavodia committed Sep 4, 2019
1 parent cdbe656 commit e943bf9
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 16 deletions.
4 changes: 2 additions & 2 deletions arviz/plots/loopitplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ def plot_loo_pit(
if plot_unif_kwargs is None:
plot_unif_kwargs = {}
light_color = rgb_to_hsv(to_rgb(plot_kwargs.get("color")))
light_color[1] /= 2
light_color[2] += (1 - light_color[2]) / 2
light_color[1] /= 2 # pylint: disable=unsupported-assignment-operation
light_color[2] += (1 - light_color[2]) / 2 # pylint: disable=unsupported-assignment-operation
plot_unif_kwargs.setdefault("color", hsv_to_rgb(light_color))
plot_unif_kwargs.setdefault("alpha", 0.5)
plot_unif_kwargs.setdefault("linewidth", 0.6 * linewidth)
Expand Down
1 change: 1 addition & 0 deletions requirements-optional.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
numba
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
matplotlib>=3.0
numpy
scipy
pandas
xarray
numpy>=1.12
scipy>=0.19
pandas>=0.23
xarray>=0.11
netcdf4
35 changes: 25 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,53 @@


PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))
REQUIREMENTS_FILE = os.path.join(PROJECT_ROOT, 'requirements.txt')
README_FILE = os.path.join(PROJECT_ROOT, 'README.md')
VERSION_FILE = os.path.join(PROJECT_ROOT, 'arviz', '__init__.py')
REQUIREMENTS_FILE = os.path.join(PROJECT_ROOT, "requirements.txt")
REQUIREMENTS_OPTIONAL_FILE = os.path.join(PROJECT_ROOT, "requirements-optional.txt")
REQUIREMENTS_DEV_FILE = os.path.join(PROJECT_ROOT, "requirements-dev.txt")
README_FILE = os.path.join(PROJECT_ROOT, "README.md")
VERSION_FILE = os.path.join(PROJECT_ROOT, "arviz", "__init__.py")


def get_requirements():
with codecs.open(REQUIREMENTS_FILE) as buff:
return buff.read().splitlines()


def get_requirements_dev():
with codecs.open(REQUIREMENTS_DEV_FILE) as buff:
return buff.read().splitlines()


def get_requirements_optional():
with codecs.open(REQUIREMENTS_OPTIONAL_FILE) as buff:
return buff.read().splitlines()


def get_long_description():
with codecs.open(README_FILE, 'rt') as buff:
with codecs.open(README_FILE, "rt") as buff:
return buff.read()


def get_version():
lines = open(VERSION_FILE, 'rt').readlines()
lines = open(VERSION_FILE, "rt").readlines()
version_regex = r"^__version__ = ['\"]([^'\"]*)['\"]"
for line in lines:
mo = re.search(version_regex, line, re.M)
if mo:
return mo.group(1)
raise RuntimeError('Unable to find version in %s.' % (VERSION_FILE,))
raise RuntimeError("Unable to find version in %s." % (VERSION_FILE,))


setup(
name='arviz',
name="arviz",
version=get_version(),
description='Exploratory analysis of Bayesian models',
author='ArviZ Developers',
description="Exploratory analysis of Bayesian models",
author="ArviZ Developers",
url="http://github.com/arviz-devs/arviz",
packages=find_packages(),
install_requires=get_requirements(),
extras_require=dict(test=get_requirements_dev(), all=get_requirements_optional()),
long_description=get_long_description(),
long_description_content_type='text/markdown',
long_description_content_type="text/markdown",
include_package_data=True,
)

0 comments on commit e943bf9

Please sign in to comment.