Add a setup.py file

This commit is contained in:
Lucas Verney 2016-03-01 16:47:34 +01:00
parent ebdb2369a5
commit c380397000
7 changed files with 84 additions and 4 deletions

5
.gitignore vendored
View File

@ -1,2 +1,5 @@
.ipynb_checkpoints/ .ipynb_checkpoints/
__pycache__ __pycache__/
build/
dist/
replot.egg-info/

File diff suppressed because one or more lines are too long

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Phyks(Lucas Verney)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -66,4 +66,14 @@ examples.
## License ## License
MIT license. This Python module is released under MIT license. Feel free to contribute and
reuse. For more details, see `LICENSE.txt` file.
## Thanks
* [Matplotlib](http://matplotlib.org/) for their really good backend (but
not for their terrible API)
* [Seaborn](https://github.com/mwaskom/seaborn) and
[prettyplotlib](http://blog.olgabotvinnik.com/prettyplotlib/) which gave me
the original idea.

View File

@ -8,6 +8,9 @@ import numpy as np
import seaborn.apionly as sns import seaborn.apionly as sns
__VERSION__ = "0.0.1"
# TODO: Remove it, this is interfering with matplotlib # TODO: Remove it, this is interfering with matplotlib
plt.rcParams['figure.figsize'] = (10.0, 8.0) # Larger figures by default plt.rcParams['figure.figsize'] = (10.0, 8.0) # Larger figures by default
plt.rcParams['text.usetex'] = True # Use LaTeX rendering plt.rcParams['text.usetex'] = True # Use LaTeX rendering

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
matplotlib>=1.5.1
seaborn>=0.7.0

41
setup.py Normal file
View File

@ -0,0 +1,41 @@
#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
print('[replot] setuptools not found.')
raise
with open('replot/__init__.py') as fh:
for line in fh:
line = line.strip()
if line.startswith('__VERSION__'):
version = line.split()[-1][1:-1]
break
try:
from pip.req import parse_requirements
from pip.download import PipSession
except ImportError:
print('[replot] pip not found.')
raise
# parse_requirements() returns generator of pip.req.InstallRequirement objects
parsed_requirements = parse_requirements("requirements.txt",
session=PipSession())
# reqs is a list of requirement
# e.g. ['django==1.5.1', 'mezzanine==1.4.6']
install_requires = [str(ir.req) for ir in parsed_requirements]
setup(
name='replot',
version=version,
url='https://github.com/Phyks/replot/',
author='Phyks (Lucas Verney)',
author_email='phyks@phyks.me',
license='MIT License',
description='A (sane) Python plotting module, abstracting on top of Matplotlib.',
packages=['replot'],
install_requires=install_requires
)