From 388a26980516e3c97538cd9034668941bf47a0bd Mon Sep 17 00:00:00 2001 From: Tom Brown Date: Tue, 19 Jan 2016 14:13:00 +0100 Subject: [PATCH] Include a more friendly package format with setup.py etc. Followed http://python-packaging-user-guide.readthedocs.org/en/latest/distributing/ --- .gitignore | 8 +++++++ doc/installation.rst | 6 ++++-- __init__.py => pypsa/__init__.py | 0 components.py => pypsa/components.py | 0 descriptors.py => pypsa/descriptors.py | 0 io.py => pypsa/io.py | 0 opf.py => pypsa/opf.py | 0 pf.py => pypsa/pf.py | 0 setup.cfg | 2 ++ setup.py | 29 ++++++++++++++++++++++++++ 10 files changed, 43 insertions(+), 2 deletions(-) rename __init__.py => pypsa/__init__.py (100%) rename components.py => pypsa/components.py (100%) rename descriptors.py => pypsa/descriptors.py (100%) rename io.py => pypsa/io.py (100%) rename opf.py => pypsa/opf.py (100%) rename pf.py => pypsa/pf.py (100%) create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/.gitignore b/.gitignore index 9348cb703..9021ffb09 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,11 @@ test/results/* doc/_build/ + +build/ + +dist/ + +pypsa.egg-info/ + +files.txt diff --git a/doc/installation.rst b/doc/installation.rst index eab457582..38831f33e 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -24,5 +24,7 @@ In a unix-based environment these packages can be obtained with the To install PyPSA, you need to download the code from the `PyPSA github -repository `_ and then add the -directory to your python path. +repository `_ and then go to the +local repository and run:: + + python setup.py install diff --git a/__init__.py b/pypsa/__init__.py similarity index 100% rename from __init__.py rename to pypsa/__init__.py diff --git a/components.py b/pypsa/components.py similarity index 100% rename from components.py rename to pypsa/components.py diff --git a/descriptors.py b/pypsa/descriptors.py similarity index 100% rename from descriptors.py rename to pypsa/descriptors.py diff --git a/io.py b/pypsa/io.py similarity index 100% rename from io.py rename to pypsa/io.py diff --git a/opf.py b/pypsa/opf.py similarity index 100% rename from opf.py rename to pypsa/opf.py diff --git a/pf.py b/pypsa/pf.py similarity index 100% rename from pf.py rename to pypsa/pf.py diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..2a9acf13d --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = 1 diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..2a7f011e9 --- /dev/null +++ b/setup.py @@ -0,0 +1,29 @@ + + + +from setuptools import setup, find_packages +from codecs import open + + +with open('README.rst', encoding='utf-8') as f: + long_description = f.read() + +setup( + name='pypsa', + version='0.2', + author='Tom Brown (FIAS), Jonas Hoersch (FIAS)', + author_email='brown@fias.uni-frankfurt.de', + description='Python for Power Systems Analysis', + long_description=long_description, + url='https://github.com/FRESNA/PyPSA', + license='GPLv2', + packages=find_packages(exclude=['doc', 'test']), + install_requires=['numpy','pyomo','scipy'], + classifiers=[ + 'Development Status :: 3 - Alpha', + 'Environment :: Console', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', + 'Natural Language :: English', + 'Operating System :: OS Independent', + ])