Skip to content

Commit 4b81a06

Browse files
committed
Fix local pip installation
1 parent 5e64239 commit 4b81a06

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

setup.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,34 @@
2929
3030
.. code::
3131
32-
python setup.py install
32+
pip install .
3333
34+
Or use the following to install all optional dependencies:
3435
35-
"""
36-
from setuptools import setup
37-
from setuptools_scm import get_version
36+
.. code::
37+
38+
pip install .[full]
3839
3940
40-
try:
41-
version = get_version(version_scheme='post-release')
42-
except LookupError:
43-
version = '0.0.0'
44-
print('Warning: setuptools-scm requires an intact git repository to detect'
45-
' the version number for this build.')
41+
"""
42+
from setuptools import setup
4643

4744
# The setup function
4845
setup(
4946
name='trnpy',
50-
version=version,
47+
use_scm_version=True,
5148
description='Parallelized TRNSYS simulation with Python',
5249
long_description=open('README.md').read(),
5350
license='GPL-3.0',
5451
author='Joris Zimmermann',
5552
author_email='joris.zimmermann@stw.de',
5653
url='https://github.com/jnettels/trnpy',
57-
install_requires=['pandas>=0.24.1', ],
54+
install_requires=['pandas>=2.0', 'psutil', 'openpyxl'],
5855
python_requires='>=3.7',
5956
setup_requires=['setuptools_scm'],
60-
use_scm_version=True,
57+
extras_require={
58+
'full': ['pyyaml', 'matplotlib', 'bokeh'],
59+
},
6160
packages=['trnpy', 'trnpy/examples'],
6261
package_data={'trnpy/examples': ['Parametrics.xlsx'], },
6362
entry_points={

trnpy/misc.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import logging
3535
import locale
3636
import multiprocessing
37-
import yaml
3837
import time
3938
import pandas as pd
4039
from pandas.tseries.frequencies import to_offset
@@ -43,6 +42,13 @@
4342
# Define the logging function
4443
logger = logging.getLogger(__name__)
4544

45+
try:
46+
import yaml
47+
except ImportError as e:
48+
logger.exception(e)
49+
logger.warning("Optional dependency 'yaml' can be installed with "
50+
"'conda install pyyaml'")
51+
4652
try:
4753
import matplotlib.pyplot as plt
4854
except ImportError as e:

0 commit comments

Comments
 (0)